Merge lp:~adamringhede/lenasys/branch2 into lp:~lenasysimpl1/lenasys/TheBugSquad
- branch2
- Merge into TheBugSquad
Proposed by
Adam Ringhede
Status: | Merged | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 15 | ||||||||||||||||||||
Proposed branch: | lp:~adamringhede/lenasys/branch2 | ||||||||||||||||||||
Merge into: | lp:~lenasysimpl1/lenasys/TheBugSquad | ||||||||||||||||||||
Diff against target: |
9667 lines (+9244/-44) 32 files modified
Code Viewer Alt/Codeviewer/showcode.php (+1/-1) Code Viewer Alt/index.html (+5/-4) Code Viewer Alt/index.js (+13/-4) Code Viewer Alt/style.css (+19/-9) CodeViewer/codeviewer.css (+3/-3) DuggaSys/changePassword/pageframe.html.php (+1/-1) DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/bak_dugga1_bits_1/index.php (+1/-1) DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/bak_dugga1_bits_1/old_index.php (+1/-1) DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/bak_dugga1_bits_1/tindex.php (+1/-1) DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/bak_dugga1_colors_1/index.php (+1/-1) DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_bits_1/index.php (+1/-1) DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_bits_2/dugga1_bits_1/index.php (+1/-1) DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_bits_2/index.php (+1/-1) DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_colors_1/index.php (+1/-1) DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_colors_2/index.php (+1/-1) DuggaSys/duggor/Dugga 2 Datorgrafik - Geometri/dugga2_geometri_1/bak_index.php (+1/-1) DuggaSys/duggor/Dugga 2 Datorgrafik - Geometri/dugga2_geometri_1/index.php (+1/-1) DuggaSys/duggor/Dugga 2 Datorgrafik - Geometri/dugga2_geometri_2/bak_index.php (+1/-1) DuggaSys/duggor/Dugga 2 Datorgrafik - Geometri/dugga2_geometri_2/index.php (+1/-1) DuggaSys/duggor/Dugga 3 Datorgrafik - Transformationer/dugga3_transf_1/index.php (+1/-1) DuggaSys/duggor/Dugga 3 Datorgrafik - Transformationer/dugga3_transf_2/index.php (+1/-1) DuggaSys/duggor/Dugga 3 Datorgrafik - Transformationer/johan_dugga_datorgrafik_1_transforms.php (+1/-1) DuggaSys/duggor/Dugga 4 Datorgrafik - 3D och Koordinater/test1.html (+1/-1) DuggaSys/duggor/Dugga Databassystem - ER Modellering Test/canvas_ER_demo_duggajs.html (+1/-1) DuggaSys/quizAjax/index.html (+1/-1) DuggaSys/quizSystem/pageframe.html.php (+1/-1) etc/PIE/PIE.htc (+96/-0) etc/PIE/PIE.js (+88/-0) etc/PIE/PIE.php (+19/-0) etc/PIE/PIE_uncompressed.htc (+4505/-0) etc/PIE/PIE_uncompressed.js (+4474/-0) js/jquery-1.8.0.min.js (+0/-2) |
||||||||||||||||||||
To merge this branch: | bzr merge lp:~adamringhede/lenasys/branch2 | ||||||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
GammaBjörn | Pending | ||
Review via email: mp+157079@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
lp:~adamringhede/lenasys/branch2
updated
- 14. By Adam Ringhede
-
Adds PIE for CSS3 compatability issues with IE
- 15. By Adam Ringhede
-
Changes file paths in codeviewer.css
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Code Viewer Alt/Codeviewer/showcode.php' |
2 | --- Code Viewer Alt/Codeviewer/showcode.php 2013-04-03 12:27:12 +0000 |
3 | +++ Code Viewer Alt/Codeviewer/showcode.php 2013-04-04 15:11:27 +0000 |
4 | @@ -2,7 +2,7 @@ |
5 | |
6 | function menulayout($forward, $backward, $downloadlink, $heading, $headinglink, $filecontent) { |
7 | echo "<body onload='resize();' onresize='resize();'>"; |
8 | - echo "<script language=\"javascript\" src=\"../jquery/jquery-1.8.2.min.js\"></script>"; |
9 | + echo "<script language=\"javascript\" src=\"../../js/jquery.js\"></script>"; |
10 | |
11 | echo "<div class='Topmenu'>"; |
12 | echo "<table style='width:100%;height:100%;border:solid 1px;'>"; |
13 | |
14 | === modified file 'Code Viewer Alt/index.html' |
15 | --- Code Viewer Alt/index.html 2013-04-03 12:25:58 +0000 |
16 | +++ Code Viewer Alt/index.html 2013-04-04 15:11:27 +0000 |
17 | @@ -3,15 +3,16 @@ |
18 | <head> |
19 | <title>Webbprogrammering DA330G</title> |
20 | <link rel="stylesheet" href="style.css" type="text/css" /> |
21 | - <script type="text/javascript" src="../js/jquery-1.8.2.min.js"></script> |
22 | + <script type="text/javascript" src="../js/jquery.js"></script> |
23 | + <script type="text/javascript" src="../etc/PIE/PIE.js"></script> |
24 | <script type="text/javascript" src="index.js"></script> |
25 | </head> |
26 | <body> |
27 | <div id="sidebar"> |
28 | - <div id="menu"> |
29 | - <div id="menuHeader"> |
30 | + <div id="menu" class="ieCSS3Fix"> |
31 | + <div id="menuHeader" class="ieCSS3Fix"> |
32 | <h3>Quick links</h3> |
33 | - <img id="menuArrow" class="arrow" src="img/menuArrow.png" alt="arrow" /> |
34 | + <img id="menuArrow" class="arrow" src="../media/codeviewer/CodeViewerLeftbutton.png" alt="arrow" /> |
35 | </div> |
36 | <div id="menuItems"> |
37 | <a href="javascript" class="menuLink">JavaScript</a> |
38 | |
39 | === modified file 'Code Viewer Alt/index.js' |
40 | --- Code Viewer Alt/index.js 2013-04-03 12:25:58 +0000 |
41 | +++ Code Viewer Alt/index.js 2013-04-04 15:11:27 +0000 |
42 | @@ -2,16 +2,25 @@ |
43 | var menuLeftOffset = 25; |
44 | |
45 | $(document).ready(function() { |
46 | - window.onresize = fixMenuLeft; |
47 | +// window.onresize = fixMenuLeft; |
48 | //$('#menu').offset({ top: menuTopOffset, left: $('#menu').offset().left }); |
49 | //window.onscroll = moveMenu; |
50 | - $('#menuHeader').click(toggleMenu); |
51 | + $('#menuHeader').click(toggleMenu);/* |
52 | + |
53 | + */ |
54 | $("a.menuLink").click(function(event) { |
55 | event.preventDefault(); |
56 | event.stopPropagation(); |
57 | var destination = event.target.href.substring(event.target.href.lastIndexOf('/') + 1); |
58 | scrollTo(destination); |
59 | }); |
60 | + var sidebar = $('#sidebar'); |
61 | + $(document).bind('scroll', function() { |
62 | + sidebar.css("top", $(window).scrollTop()); |
63 | + }); |
64 | + $('.ieCSS3Fix, .menuLink').each(function() { |
65 | + PIE.attach(this); |
66 | + }); |
67 | }); |
68 | |
69 | function fixMenuLeft(ev) { |
70 | @@ -23,10 +32,10 @@ |
71 | |
72 | function toggleMenu(ev) { |
73 | if($('#menu').offset().left == 0) { |
74 | - $('#menu').animate({ left: -($('#menu').width()-menuLeftOffset) },{duration:900}); |
75 | + $('#menu').stop().animate({ left: -($('#menu').width()-menuLeftOffset) },{duration:900}); |
76 | $("#menuArrow").addClass("rotateArrowCW"); |
77 | } else { |
78 | - $('#menu').animate({ left: 0 },{duration:900}); |
79 | + $('#menu').stop().animate({ left: 0 },{duration:900}); |
80 | $("#menuArrow").removeClass("rotateArrowCW"); |
81 | } |
82 | } |
83 | |
84 | === modified file 'Code Viewer Alt/style.css' |
85 | --- Code Viewer Alt/style.css 2013-04-03 08:51:28 +0000 |
86 | +++ Code Viewer Alt/style.css 2013-04-04 15:11:27 +0000 |
87 | @@ -72,14 +72,17 @@ |
88 | } |
89 | |
90 | #menu { |
91 | - position:fixed; |
92 | + position:absolute; |
93 | top:40px; |
94 | + left:0px; |
95 | width:10.5%; |
96 | + width:96%; |
97 | padding: 10px 0 1% 0.3%; |
98 | background: #c0d0e0; |
99 | background-color: #c0d0e0; |
100 | - border-bottom-right-radius: 1.3em; |
101 | - border-top-right-radius: 1.3em; |
102 | + _border-bottom-right-radius: 1.3em; |
103 | + _border-top-right-radius: 1.3em; |
104 | + border-radius: 0 1.3em 1.3em 0; |
105 | border-bottom: 2px solid #000; |
106 | border-right: 1px solid #000; |
107 | color: #fff; |
108 | @@ -99,7 +102,8 @@ |
109 | height:31px; |
110 | padding-left:10px; |
111 | margin-left:-10px; |
112 | - border-radius: 0 10px 10px 0 |
113 | + border-radius: 0 10px 10px 0; |
114 | + cursor:pointer; |
115 | } |
116 | |
117 | #menuHeader h3{ |
118 | @@ -139,15 +143,21 @@ |
119 | } |
120 | |
121 | #sidebar { |
122 | + position:absolute; |
123 | + left:0px; |
124 | + top:0px; |
125 | float:left; |
126 | - min-width:11%; |
127 | - min-height:100px; |
128 | + min-width:8em; |
129 | + width:auto; |
130 | + height:100%; |
131 | overflow:auto; |
132 | } |
133 | |
134 | -#content { |
135 | - float:left; |
136 | - width:75%; |
137 | +#content { |
138 | + position:absolute; |
139 | + left:8em; |
140 | + max-width:75%; |
141 | + min-width:20em; |
142 | } |
143 | |
144 | .arrow{ |
145 | |
146 | === modified file 'CodeViewer/codeviewer.css' |
147 | --- CodeViewer/codeviewer.css 2013-04-03 09:09:01 +0000 |
148 | +++ CodeViewer/codeviewer.css 2013-04-04 15:11:27 +0000 |
149 | @@ -22,7 +22,7 @@ |
150 | width: 100%; |
151 | height: 44px; |
152 | background: #ffeedd; |
153 | - background-image: url('../media../codeviewer/CodeViewerMenuareaBack.png'); |
154 | + background-image: url('../media/codeviewer/CodeViewerMenuareaBack.png'); |
155 | } |
156 | .RestContainer { |
157 | width: 100%; |
158 | @@ -34,7 +34,7 @@ |
159 | width: 450px; |
160 | border: 1px solid black; |
161 | background-color: #ffffff; |
162 | - background-image: url('../media../codeviewer/CodeViewerDescareaBack.png'); |
163 | + background-image: url('../media/codeviewer/CodeViewerDescareaBack.png'); |
164 | background-repeat: repeat-x; |
165 | } |
166 | .codecontent { |
167 | @@ -50,7 +50,7 @@ |
168 | .menubarstyle { |
169 | width: 100%; |
170 | height: 44px; |
171 | - background-image: url('../media../codeviewer/CodeViewerMenuareaBack.png'); |
172 | + background-image: url('../media/codeviewer/CodeViewerMenuareaBack.png'); |
173 | } |
174 | .buttonstyle { |
175 | width: 44px; |
176 | |
177 | === modified file 'DuggaSys/changePassword/pageframe.html.php' |
178 | --- DuggaSys/changePassword/pageframe.html.php 2013-04-03 12:44:23 +0000 |
179 | +++ DuggaSys/changePassword/pageframe.html.php 2013-04-04 15:11:27 +0000 |
180 | @@ -4,7 +4,7 @@ |
181 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
182 | <link href="../../css/base.css" rel="stylesheet" type="text/css" /> |
183 | <link href="../../css/app.css" rel="stylesheet" type="text/css" /> |
184 | - <script type="text/javascript" src="../../js/jquery-1.8.0.min.js"></script> |
185 | + <script type="text/javascript" src="../../js/jquery.js"></script> |
186 | <title><?php $pagetitle ?></title> |
187 | <script type="text/javascript"> |
188 | $(document).ready(function() { |
189 | |
190 | === modified file 'DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/bak_dugga1_bits_1/index.php' |
191 | --- DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/bak_dugga1_bits_1/index.php 2013-04-03 12:44:23 +0000 |
192 | +++ DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/bak_dugga1_bits_1/index.php 2013-04-04 15:11:27 +0000 |
193 | @@ -14,7 +14,7 @@ |
194 | <head> |
195 | <meta charset="UTF-8"/> |
196 | |
197 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
198 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
199 | <script lang='Javascript'> |
200 | var account="<?php echo $accountname ?>"; |
201 | var duggaNr="<?php echo $duggaNr ?>"; |
202 | |
203 | === modified file 'DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/bak_dugga1_bits_1/old_index.php' |
204 | --- DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/bak_dugga1_bits_1/old_index.php 2013-04-03 12:44:23 +0000 |
205 | +++ DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/bak_dugga1_bits_1/old_index.php 2013-04-04 15:11:27 +0000 |
206 | @@ -13,7 +13,7 @@ |
207 | <html> |
208 | <head> |
209 | <meta charset="UTF-8"/> |
210 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
211 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
212 | <script lang='Javascript'> |
213 | var account="<?php echo $accountname ?>"; |
214 | var duggaNr="<?php echo $duggaNr ?>"; |
215 | |
216 | === modified file 'DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/bak_dugga1_bits_1/tindex.php' |
217 | --- DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/bak_dugga1_bits_1/tindex.php 2013-04-03 12:44:23 +0000 |
218 | +++ DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/bak_dugga1_bits_1/tindex.php 2013-04-04 15:11:27 +0000 |
219 | @@ -13,7 +13,7 @@ |
220 | <html> |
221 | <head> |
222 | <meta charset="UTF-8"/> |
223 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
224 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
225 | <script lang='Javascript'> |
226 | var account="<?php echo $accountname ?>"; |
227 | var duggaNr="<?php echo $duggaNr ?>"; |
228 | |
229 | === modified file 'DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/bak_dugga1_colors_1/index.php' |
230 | --- DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/bak_dugga1_colors_1/index.php 2013-04-03 12:44:23 +0000 |
231 | +++ DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/bak_dugga1_colors_1/index.php 2013-04-04 15:11:27 +0000 |
232 | @@ -15,7 +15,7 @@ |
233 | <html> |
234 | <head> |
235 | <meta charset="UTF-8"/> |
236 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
237 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
238 | <script lang='Javascript'> |
239 | var account="<?php echo $accountname ?>"; |
240 | var duggaNr="<?php echo $duggaNr ?>"; |
241 | |
242 | === modified file 'DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_bits_1/index.php' |
243 | --- DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_bits_1/index.php 2013-04-03 12:44:23 +0000 |
244 | +++ DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_bits_1/index.php 2013-04-04 15:11:27 +0000 |
245 | @@ -13,7 +13,7 @@ |
246 | <html> |
247 | <head> |
248 | <meta charset="UTF-8"/> |
249 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
250 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
251 | <script lang='Javascript'> |
252 | var account="<?php echo $accountname ?>"; |
253 | var duggaNr="<?php echo $duggaNr ?>"; |
254 | |
255 | === modified file 'DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_bits_2/dugga1_bits_1/index.php' |
256 | --- DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_bits_2/dugga1_bits_1/index.php 2013-04-03 12:44:23 +0000 |
257 | +++ DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_bits_2/dugga1_bits_1/index.php 2013-04-04 15:11:27 +0000 |
258 | @@ -13,7 +13,7 @@ |
259 | <html> |
260 | <head> |
261 | <meta charset="UTF-8"/> |
262 | - <script type="text/javascript" src="../../../../../js/jquery-1.8.0.min.js"></script> |
263 | + <script type="text/javascript" src="../../../../../js/jquery.js"></script> |
264 | <script lang='Javascript'> |
265 | var account="<?php echo $accountname ?>"; |
266 | var duggaNr="<?php echo $duggaNr ?>"; |
267 | |
268 | === modified file 'DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_bits_2/index.php' |
269 | --- DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_bits_2/index.php 2013-04-03 12:44:23 +0000 |
270 | +++ DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_bits_2/index.php 2013-04-04 15:11:27 +0000 |
271 | @@ -13,7 +13,7 @@ |
272 | <html> |
273 | <head> |
274 | <meta charset="UTF-8"/> |
275 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
276 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
277 | <script lang='Javascript'> |
278 | var account="<?php echo $accountname ?>"; |
279 | var duggaNr="<?php echo $duggaNr ?>"; |
280 | |
281 | === modified file 'DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_colors_1/index.php' |
282 | --- DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_colors_1/index.php 2013-04-03 12:44:23 +0000 |
283 | +++ DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_colors_1/index.php 2013-04-04 15:11:27 +0000 |
284 | @@ -15,7 +15,7 @@ |
285 | <html> |
286 | <head> |
287 | <meta charset="UTF-8"/> |
288 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
289 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
290 | <script lang='Javascript'> |
291 | var account="<?php echo $accountname ?>"; |
292 | var duggaNr="<?php echo $duggaNr ?>"; |
293 | |
294 | === modified file 'DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_colors_2/index.php' |
295 | --- DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_colors_2/index.php 2013-04-03 12:44:23 +0000 |
296 | +++ DuggaSys/duggor/Dugga 1 Datorgrafik - Bithantering och Farger/dugga1_colors_2/index.php 2013-04-04 15:11:27 +0000 |
297 | @@ -15,7 +15,7 @@ |
298 | <html> |
299 | <head> |
300 | <meta charset="UTF-8"/> |
301 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
302 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
303 | <script lang='Javascript'> |
304 | var account="<?php echo $accountname ?>"; |
305 | var duggaNr="<?php echo $duggaNr ?>"; |
306 | |
307 | === modified file 'DuggaSys/duggor/Dugga 2 Datorgrafik - Geometri/dugga2_geometri_1/bak_index.php' |
308 | --- DuggaSys/duggor/Dugga 2 Datorgrafik - Geometri/dugga2_geometri_1/bak_index.php 2013-04-03 12:44:23 +0000 |
309 | +++ DuggaSys/duggor/Dugga 2 Datorgrafik - Geometri/dugga2_geometri_1/bak_index.php 2013-04-04 15:11:27 +0000 |
310 | @@ -13,7 +13,7 @@ |
311 | <html> |
312 | <head> |
313 | <meta charset="UTF-8"/> |
314 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
315 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
316 | <script lang='Javascript'> |
317 | var account="<?php echo $accountname ?>"; |
318 | var duggaNr="<?php echo $duggaNr ?>"; |
319 | |
320 | === modified file 'DuggaSys/duggor/Dugga 2 Datorgrafik - Geometri/dugga2_geometri_1/index.php' |
321 | --- DuggaSys/duggor/Dugga 2 Datorgrafik - Geometri/dugga2_geometri_1/index.php 2013-04-03 12:44:23 +0000 |
322 | +++ DuggaSys/duggor/Dugga 2 Datorgrafik - Geometri/dugga2_geometri_1/index.php 2013-04-04 15:11:27 +0000 |
323 | @@ -18,7 +18,7 @@ |
324 | <style> |
325 | p, a, h1, h2, h3, h4, h5, table, td, th, label, caption{font-family:Helvetica, Arial, sans-serif;} |
326 | </style> |
327 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
328 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
329 | <script lang='Javascript'> |
330 | var account="<?php echo $accountname ?>"; |
331 | var duggaNr="<?php echo $duggaNr ?>"; |
332 | |
333 | === modified file 'DuggaSys/duggor/Dugga 2 Datorgrafik - Geometri/dugga2_geometri_2/bak_index.php' |
334 | --- DuggaSys/duggor/Dugga 2 Datorgrafik - Geometri/dugga2_geometri_2/bak_index.php 2013-04-03 12:44:23 +0000 |
335 | +++ DuggaSys/duggor/Dugga 2 Datorgrafik - Geometri/dugga2_geometri_2/bak_index.php 2013-04-04 15:11:27 +0000 |
336 | @@ -13,7 +13,7 @@ |
337 | <html> |
338 | <head> |
339 | <meta charset="UTF-8"/> |
340 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
341 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
342 | <script lang='Javascript'> |
343 | var account="<?php echo $accountname ?>"; |
344 | var duggaNr="<?php echo $duggaNr ?>"; |
345 | |
346 | === modified file 'DuggaSys/duggor/Dugga 2 Datorgrafik - Geometri/dugga2_geometri_2/index.php' |
347 | --- DuggaSys/duggor/Dugga 2 Datorgrafik - Geometri/dugga2_geometri_2/index.php 2013-04-03 12:44:23 +0000 |
348 | +++ DuggaSys/duggor/Dugga 2 Datorgrafik - Geometri/dugga2_geometri_2/index.php 2013-04-04 15:11:27 +0000 |
349 | @@ -17,7 +17,7 @@ |
350 | <style> |
351 | p, a, h1, h2, h3, h4, h5, table, td, th, label, caption{font-family:Helvetica, Arial, sans-serif;} |
352 | </style> |
353 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
354 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
355 | <script lang='Javascript'> |
356 | var account="<?php echo $accountname ?>"; |
357 | var duggaNr="<?php echo $duggaNr ?>"; |
358 | |
359 | === modified file 'DuggaSys/duggor/Dugga 3 Datorgrafik - Transformationer/dugga3_transf_1/index.php' |
360 | --- DuggaSys/duggor/Dugga 3 Datorgrafik - Transformationer/dugga3_transf_1/index.php 2013-04-03 12:44:23 +0000 |
361 | +++ DuggaSys/duggor/Dugga 3 Datorgrafik - Transformationer/dugga3_transf_1/index.php 2013-04-04 15:11:27 +0000 |
362 | @@ -21,7 +21,7 @@ |
363 | <style> |
364 | p, a, h1, h2, h3, h4, h5, table, td, th, label, caption{font-family:Helvetica, Arial, sans-serif;} |
365 | </style> |
366 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
367 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
368 | <script type="text/javascript" src="../../../../js/dugga.js"></script> |
369 | <script lang='Javascript'> |
370 | var account="<?php echo $accountname ?>"; |
371 | |
372 | === modified file 'DuggaSys/duggor/Dugga 3 Datorgrafik - Transformationer/dugga3_transf_2/index.php' |
373 | --- DuggaSys/duggor/Dugga 3 Datorgrafik - Transformationer/dugga3_transf_2/index.php 2013-04-03 12:44:23 +0000 |
374 | +++ DuggaSys/duggor/Dugga 3 Datorgrafik - Transformationer/dugga3_transf_2/index.php 2013-04-04 15:11:27 +0000 |
375 | @@ -21,7 +21,7 @@ |
376 | <style> |
377 | p, a, h1, h2, h3, h4, h5, table, td, th, label, caption{font-family:Helvetica, Arial, sans-serif;} |
378 | </style> |
379 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
380 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
381 | <script type="text/javascript" src="../../../../js/dugga.js"></script> |
382 | <script lang='Javascript'> |
383 | var account="<?php echo $accountname ?>"; |
384 | |
385 | === modified file 'DuggaSys/duggor/Dugga 3 Datorgrafik - Transformationer/johan_dugga_datorgrafik_1_transforms.php' |
386 | --- DuggaSys/duggor/Dugga 3 Datorgrafik - Transformationer/johan_dugga_datorgrafik_1_transforms.php 2013-04-03 12:44:23 +0000 |
387 | +++ DuggaSys/duggor/Dugga 3 Datorgrafik - Transformationer/johan_dugga_datorgrafik_1_transforms.php 2013-04-04 15:11:27 +0000 |
388 | @@ -9,7 +9,7 @@ |
389 | <html> |
390 | <head> |
391 | <meta charset="UTF-8"/> |
392 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
393 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
394 | <script lang='Javascript'> |
395 | var account="<?php echo $accountname ?>"; |
396 | var duggaNr="<?php echo $duggaNr ?>"; |
397 | |
398 | === modified file 'DuggaSys/duggor/Dugga 4 Datorgrafik - 3D och Koordinater/test1.html' |
399 | --- DuggaSys/duggor/Dugga 4 Datorgrafik - 3D och Koordinater/test1.html 2013-04-03 12:44:23 +0000 |
400 | +++ DuggaSys/duggor/Dugga 4 Datorgrafik - 3D och Koordinater/test1.html 2013-04-04 15:11:27 +0000 |
401 | @@ -23,7 +23,7 @@ |
402 | } |
403 | button, input[type="submit"]{min-width:130px;} |
404 | </style>--> |
405 | - <script type="text/javascript" src="../../js/jquery-1.8.0.min.js"></script> |
406 | + <script type="text/javascript" src="../../js/jquery.js"></script> |
407 | <script type="text/javascript" src="../../js/three.min.js"></script> |
408 | <script type="text/javascript" src="../../js/helvetiker_regular.typeface.js"></script> |
409 | </head> |
410 | |
411 | === modified file 'DuggaSys/duggor/Dugga Databassystem - ER Modellering Test/canvas_ER_demo_duggajs.html' |
412 | --- DuggaSys/duggor/Dugga Databassystem - ER Modellering Test/canvas_ER_demo_duggajs.html 2013-04-03 12:44:23 +0000 |
413 | +++ DuggaSys/duggor/Dugga Databassystem - ER Modellering Test/canvas_ER_demo_duggajs.html 2013-04-04 15:11:27 +0000 |
414 | @@ -1,7 +1,7 @@ |
415 | <html> |
416 | <head> |
417 | |
418 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
419 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
420 | |
421 | <script lang='Javascript'> |
422 | |
423 | |
424 | === modified file 'DuggaSys/quizAjax/index.html' |
425 | --- DuggaSys/quizAjax/index.html 2013-04-04 06:42:25 +0000 |
426 | +++ DuggaSys/quizAjax/index.html 2013-04-04 15:11:27 +0000 |
427 | @@ -5,7 +5,7 @@ |
428 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
429 | <link href="../../../../css/base.css" rel="stylesheet" type="text/css" /> |
430 | <link href="../../../../css/app.css" rel="stylesheet" type="text/css" /> |
431 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
432 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
433 | <script type="text/javascript" src="../../../../js/test.js"></script> |
434 | <title>Quiz Test</title> |
435 | </head> |
436 | |
437 | === modified file 'DuggaSys/quizSystem/pageframe.html.php' |
438 | --- DuggaSys/quizSystem/pageframe.html.php 2013-04-03 12:44:23 +0000 |
439 | +++ DuggaSys/quizSystem/pageframe.html.php 2013-04-04 15:11:27 +0000 |
440 | @@ -4,7 +4,7 @@ |
441 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
442 | <link href="../../../../css/base.css" rel="stylesheet" type="text/css" /> |
443 | <link href="../../../../css/app.css" rel="stylesheet" type="text/css" /> |
444 | - <script type="text/javascript" src="../../../../js/jquery-1.8.0.min.js"></script> |
445 | + <script type="text/javascript" src="../../../../js/jquery.js"></script> |
446 | <title><?php $pagetitle ?></title> |
447 | <script type="text/javascript"> |
448 | $(document).ready(function() { |
449 | |
450 | === added directory 'etc/PIE' |
451 | === added file 'etc/PIE/PIE.htc' |
452 | --- etc/PIE/PIE.htc 1970-01-01 00:00:00 +0000 |
453 | +++ etc/PIE/PIE.htc 2013-04-04 15:11:27 +0000 |
454 | @@ -0,0 +1,96 @@ |
455 | +<!-- |
456 | +PIE: CSS3 rendering for IE |
457 | +Version 1.0.0 |
458 | +http://css3pie.com |
459 | +Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2. |
460 | +--> |
461 | +<PUBLIC:COMPONENT lightWeight="true"> |
462 | +<!-- saved from url=(0014)about:internet --> |
463 | +<PUBLIC:ATTACH EVENT="oncontentready" FOR="element" ONEVENT="init()" /> |
464 | +<PUBLIC:ATTACH EVENT="ondocumentready" FOR="element" ONEVENT="init()" /> |
465 | +<PUBLIC:ATTACH EVENT="ondetach" FOR="element" ONEVENT="cleanup()" /> |
466 | + |
467 | +<script type="text/javascript"> |
468 | +var doc = element.document;var f=window.PIE; |
469 | +if(!f){f=window.PIE={F:"-pie-",nb:"Pie",La:"pie_",Ac:{TD:1,TH:1},cc:{TABLE:1,THEAD:1,TBODY:1,TFOOT:1,TR:1,INPUT:1,TEXTAREA:1,SELECT:1,OPTION:1,IMG:1,HR:1},fc:{A:1,INPUT:1,TEXTAREA:1,SELECT:1,BUTTON:1},Gd:{submit:1,button:1,reset:1},aa:function(){}};try{doc.execCommand("BackgroundImageCache",false,true)}catch(aa){}for(var ba=4,Z=doc.createElement("div"),ca=Z.getElementsByTagName("i"),ga;Z.innerHTML="<!--[if gt IE "+ ++ba+"]><i></i><![endif]--\>",ca[0];);f.O=ba;if(ba===6)f.F=f.F.replace(/^-/,"");f.ja= |
470 | +doc.documentMode||f.O;Z.innerHTML='<v:shape adj="1"/>';ga=Z.firstChild;ga.style.behavior="url(#default#VML)";f.zc=typeof ga.adj==="object";(function(){var a,b=0,c={};f.p={Za:function(d){if(!a){a=doc.createDocumentFragment();a.namespaces.add("css3vml","urn:schemas-microsoft-com:vml")}return a.createElement("css3vml:"+d)},Ba:function(d){return d&&d._pieId||(d._pieId="_"+ ++b)},Eb:function(d){var e,g,j,i,h=arguments;e=1;for(g=h.length;e<g;e++){i=h[e];for(j in i)if(i.hasOwnProperty(j))d[j]=i[j]}return d}, |
471 | +Rb:function(d,e,g){var j=c[d],i,h;if(j)Object.prototype.toString.call(j)==="[object Array]"?j.push([e,g]):e.call(g,j);else{h=c[d]=[[e,g]];i=new Image;i.onload=function(){j=c[d]={h:i.width,f:i.height};for(var k=0,n=h.length;k<n;k++)h[k][0].call(h[k][1],j);i.onload=null};i.src=d}}}})();f.Na={gc:function(a,b,c,d){function e(){k=j>=90&&j<270?b:0;n=j<180?c:0;m=b-k;p=c-n}function g(){for(;j<0;)j+=360;j%=360}var j=d.sa;d=d.zb;var i,h,k,n,m,p,r,t;if(d){d=d.coords(a,b,c);i=d.x;h=d.y}if(j){j=j.jd();g();e(); |
472 | +if(!d){i=k;h=n}d=f.Na.tc(i,h,j,m,p);a=d[0];d=d[1]}else if(d){a=b-i;d=c-h}else{i=h=a=0;d=c}r=a-i;t=d-h;if(j===void 0){j=!r?t<0?90:270:!t?r<0?180:0:-Math.atan2(t,r)/Math.PI*180;g();e()}return{sa:j,xc:i,yc:h,td:a,ud:d,Wd:k,Xd:n,rd:m,sd:p,kd:r,ld:t,rc:f.Na.dc(i,h,a,d)}},tc:function(a,b,c,d,e){if(c===0||c===180)return[d,b];else if(c===90||c===270)return[a,e];else{c=Math.tan(-c*Math.PI/180);a=c*a-b;b=-1/c;d=b*d-e;e=b-c;return[(d-a)/e,(c*d-b*a)/e]}},dc:function(a,b,c,d){a=c-a;b=d-b;return Math.abs(a===0? |
473 | +b:b===0?a:Math.sqrt(a*a+b*b))}};f.ea=function(){this.Gb=[];this.oc={}};f.ea.prototype={ba:function(a){var b=f.p.Ba(a),c=this.oc,d=this.Gb;if(!(b in c)){c[b]=d.length;d.push(a)}},Ha:function(a){a=f.p.Ba(a);var b=this.oc;if(a&&a in b){delete this.Gb[b[a]];delete b[a]}},xa:function(){for(var a=this.Gb,b=a.length;b--;)a[b]&&a[b]()}};f.Oa=new f.ea;f.Oa.Rd=function(){var a=this,b;if(!a.Sd){b=doc.documentElement.currentStyle.getAttribute(f.F+"poll-interval")||250;(function c(){a.xa();setTimeout(c,b)})(); |
474 | +a.Sd=1}};(function(){function a(){f.L.xa();window.detachEvent("onunload",a);window.PIE=null}f.L=new f.ea;window.attachEvent("onunload",a);f.L.ta=function(b,c,d){b.attachEvent(c,d);this.ba(function(){b.detachEvent(c,d)})}})();f.Qa=new f.ea;f.L.ta(window,"onresize",function(){f.Qa.xa()});(function(){function a(){f.mb.xa()}f.mb=new f.ea;f.L.ta(window,"onscroll",a);f.Qa.ba(a)})();(function(){function a(){c=f.kb.md()}function b(){if(c){for(var d=0,e=c.length;d<e;d++)f.attach(c[d]);c=0}}var c;if(f.ja<9){f.L.ta(window, |
475 | +"onbeforeprint",a);f.L.ta(window,"onafterprint",b)}})();f.lb=new f.ea;f.L.ta(doc,"onmouseup",function(){f.lb.xa()});f.he=function(){function a(h){this.Y=h}var b=doc.createElement("length-calc"),c=doc.body||doc.documentElement,d=b.style,e={},g=["mm","cm","in","pt","pc"],j=g.length,i={};d.position="absolute";d.top=d.left="-9999px";for(c.appendChild(b);j--;){d.width="100"+g[j];e[g[j]]=b.offsetWidth/100}c.removeChild(b);d.width="1em";a.prototype={Kb:/(px|em|ex|mm|cm|in|pt|pc|%)$/,ic:function(){var h= |
476 | +this.Jd;if(h===void 0)h=this.Jd=parseFloat(this.Y);return h},yb:function(){var h=this.ae;if(!h)h=this.ae=(h=this.Y.match(this.Kb))&&h[0]||"px";return h},a:function(h,k){var n=this.ic(),m=this.yb();switch(m){case "px":return n;case "%":return n*(typeof k==="function"?k():k)/100;case "em":return n*this.xb(h);case "ex":return n*this.xb(h)/2;default:return n*e[m]}},xb:function(h){var k=h.currentStyle.fontSize,n,m;if(k.indexOf("px")>0)return parseFloat(k);else if(h.tagName in f.cc){m=this;n=h.parentNode; |
477 | +return f.n(k).a(n,function(){return m.xb(n)})}else{h.appendChild(b);k=b.offsetWidth;b.parentNode===h&&h.removeChild(b);return k}}};f.n=function(h){return i[h]||(i[h]=new a(h))};return a}();f.Ja=function(){function a(e){this.X=e}var b=f.n("50%"),c={top:1,center:1,bottom:1},d={left:1,center:1,right:1};a.prototype={zd:function(){if(!this.ac){var e=this.X,g=e.length,j=f.v,i=j.qa,h=f.n("0");i=i.na;h=["left",h,"top",h];if(g===1){e.push(new j.ob(i,"center"));g++}if(g===2){i&(e[0].k|e[1].k)&&e[0].d in c&& |
478 | +e[1].d in d&&e.push(e.shift());if(e[0].k&i)if(e[0].d==="center")h[1]=b;else h[0]=e[0].d;else if(e[0].W())h[1]=f.n(e[0].d);if(e[1].k&i)if(e[1].d==="center")h[3]=b;else h[2]=e[1].d;else if(e[1].W())h[3]=f.n(e[1].d)}this.ac=h}return this.ac},coords:function(e,g,j){var i=this.zd(),h=i[1].a(e,g);e=i[3].a(e,j);return{x:i[0]==="right"?g-h:h,y:i[2]==="bottom"?j-e:e}}};return a}();f.Ka=function(){function a(b,c){this.h=b;this.f=c}a.prototype={a:function(b,c,d,e,g){var j=this.h,i=this.f,h=c/d;e=e/g;if(j=== |
479 | +"contain"){j=e>h?c:d*e;i=e>h?c/e:d}else if(j==="cover"){j=e<h?c:d*e;i=e<h?c/e:d}else if(j==="auto"){i=i==="auto"?g:i.a(b,d);j=i*e}else{j=j.a(b,c);i=i==="auto"?j/e:i.a(b,d)}return{h:j,f:i}}};a.Kc=new a("auto","auto");return a}();f.Ec=function(){function a(b){this.Y=b}a.prototype={Kb:/[a-z]+$/i,yb:function(){return this.ad||(this.ad=this.Y.match(this.Kb)[0].toLowerCase())},jd:function(){var b=this.Vc,c;if(b===undefined){b=this.yb();c=parseFloat(this.Y,10);b=this.Vc=b==="deg"?c:b==="rad"?c/Math.PI*180: |
480 | +b==="grad"?c/400*360:b==="turn"?c*360:0}return b}};return a}();f.Jc=function(){function a(c){this.Y=c}var b={};a.Qd=/\s*rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d+|\d*\.\d+)\s*\)\s*/;a.Fb={aliceblue:"F0F8FF",antiquewhite:"FAEBD7",aqua:"0FF",aquamarine:"7FFFD4",azure:"F0FFFF",beige:"F5F5DC",bisque:"FFE4C4",black:"000",blanchedalmond:"FFEBCD",blue:"00F",blueviolet:"8A2BE2",brown:"A52A2A",burlywood:"DEB887",cadetblue:"5F9EA0",chartreuse:"7FFF00",chocolate:"D2691E",coral:"FF7F50",cornflowerblue:"6495ED", |
481 | +cornsilk:"FFF8DC",crimson:"DC143C",cyan:"0FF",darkblue:"00008B",darkcyan:"008B8B",darkgoldenrod:"B8860B",darkgray:"A9A9A9",darkgreen:"006400",darkkhaki:"BDB76B",darkmagenta:"8B008B",darkolivegreen:"556B2F",darkorange:"FF8C00",darkorchid:"9932CC",darkred:"8B0000",darksalmon:"E9967A",darkseagreen:"8FBC8F",darkslateblue:"483D8B",darkslategray:"2F4F4F",darkturquoise:"00CED1",darkviolet:"9400D3",deeppink:"FF1493",deepskyblue:"00BFFF",dimgray:"696969",dodgerblue:"1E90FF",firebrick:"B22222",floralwhite:"FFFAF0", |
482 | +forestgreen:"228B22",fuchsia:"F0F",gainsboro:"DCDCDC",ghostwhite:"F8F8FF",gold:"FFD700",goldenrod:"DAA520",gray:"808080",green:"008000",greenyellow:"ADFF2F",honeydew:"F0FFF0",hotpink:"FF69B4",indianred:"CD5C5C",indigo:"4B0082",ivory:"FFFFF0",khaki:"F0E68C",lavender:"E6E6FA",lavenderblush:"FFF0F5",lawngreen:"7CFC00",lemonchiffon:"FFFACD",lightblue:"ADD8E6",lightcoral:"F08080",lightcyan:"E0FFFF",lightgoldenrodyellow:"FAFAD2",lightgreen:"90EE90",lightgrey:"D3D3D3",lightpink:"FFB6C1",lightsalmon:"FFA07A", |
483 | +lightseagreen:"20B2AA",lightskyblue:"87CEFA",lightslategray:"789",lightsteelblue:"B0C4DE",lightyellow:"FFFFE0",lime:"0F0",limegreen:"32CD32",linen:"FAF0E6",magenta:"F0F",maroon:"800000",mediumauqamarine:"66CDAA",mediumblue:"0000CD",mediumorchid:"BA55D3",mediumpurple:"9370D8",mediumseagreen:"3CB371",mediumslateblue:"7B68EE",mediumspringgreen:"00FA9A",mediumturquoise:"48D1CC",mediumvioletred:"C71585",midnightblue:"191970",mintcream:"F5FFFA",mistyrose:"FFE4E1",moccasin:"FFE4B5",navajowhite:"FFDEAD", |
484 | +navy:"000080",oldlace:"FDF5E6",olive:"808000",olivedrab:"688E23",orange:"FFA500",orangered:"FF4500",orchid:"DA70D6",palegoldenrod:"EEE8AA",palegreen:"98FB98",paleturquoise:"AFEEEE",palevioletred:"D87093",papayawhip:"FFEFD5",peachpuff:"FFDAB9",peru:"CD853F",pink:"FFC0CB",plum:"DDA0DD",powderblue:"B0E0E6",purple:"800080",red:"F00",rosybrown:"BC8F8F",royalblue:"4169E1",saddlebrown:"8B4513",salmon:"FA8072",sandybrown:"F4A460",seagreen:"2E8B57",seashell:"FFF5EE",sienna:"A0522D",silver:"C0C0C0",skyblue:"87CEEB", |
485 | +slateblue:"6A5ACD",slategray:"708090",snow:"FFFAFA",springgreen:"00FF7F",steelblue:"4682B4",tan:"D2B48C",teal:"008080",thistle:"D8BFD8",tomato:"FF6347",turquoise:"40E0D0",violet:"EE82EE",wheat:"F5DEB3",white:"FFF",whitesmoke:"F5F5F5",yellow:"FF0",yellowgreen:"9ACD32"};a.prototype={parse:function(){if(!this.Ua){var c=this.Y,d;if(d=c.match(a.Qd)){this.Ua="rgb("+d[1]+","+d[2]+","+d[3]+")";this.Yb=parseFloat(d[4])}else{if((d=c.toLowerCase())in a.Fb)c="#"+a.Fb[d];this.Ua=c;this.Yb=c==="transparent"?0: |
486 | +1}}},U:function(c){this.parse();return this.Ua==="currentColor"?c.currentStyle.color:this.Ua},fa:function(){this.parse();return this.Yb}};f.ha=function(c){return b[c]||(b[c]=new a(c))};return a}();f.v=function(){function a(c){this.$a=c;this.ch=0;this.X=[];this.Ga=0}var b=a.qa={Ia:1,Wb:2,z:4,Lc:8,Xb:16,na:32,K:64,oa:128,pa:256,Ra:512,Tc:1024,URL:2048};a.ob=function(c,d){this.k=c;this.d=d};a.ob.prototype={Ca:function(){return this.k&b.K||this.k&b.oa&&this.d==="0"},W:function(){return this.Ca()||this.k& |
487 | +b.Ra}};a.prototype={de:/\s/,Kd:/^[\+\-]?(\d*\.)?\d+/,url:/^url\(\s*("([^"]*)"|'([^']*)'|([!#$%&*-~]*))\s*\)/i,nc:/^\-?[_a-z][\w-]*/i,Yd:/^("([^"]*)"|'([^']*)')/,Bd:/^#([\da-f]{6}|[\da-f]{3})/i,be:{px:b.K,em:b.K,ex:b.K,mm:b.K,cm:b.K,"in":b.K,pt:b.K,pc:b.K,deg:b.Ia,rad:b.Ia,grad:b.Ia},fd:{rgb:1,rgba:1,hsl:1,hsla:1},next:function(c){function d(p,r){p=new a.ob(p,r);if(!c){k.X.push(p);k.Ga++}return p}function e(){k.Ga++;return null}var g,j,i,h,k=this;if(this.Ga<this.X.length)return this.X[this.Ga++];for(;this.de.test(this.$a.charAt(this.ch));)this.ch++; |
488 | +if(this.ch>=this.$a.length)return e();j=this.ch;g=this.$a.substring(this.ch);i=g.charAt(0);switch(i){case "#":if(h=g.match(this.Bd)){this.ch+=h[0].length;return d(b.z,h[0])}break;case '"':case "'":if(h=g.match(this.Yd)){this.ch+=h[0].length;return d(b.Tc,h[2]||h[3]||"")}break;case "/":case ",":this.ch++;return d(b.pa,i);case "u":if(h=g.match(this.url)){this.ch+=h[0].length;return d(b.URL,h[2]||h[3]||h[4]||"")}}if(h=g.match(this.Kd)){i=h[0];this.ch+=i.length;if(g.charAt(i.length)==="%"){this.ch++; |
489 | +return d(b.Ra,i+"%")}if(h=g.substring(i.length).match(this.nc)){i+=h[0];this.ch+=h[0].length;return d(this.be[h[0].toLowerCase()]||b.Lc,i)}return d(b.oa,i)}if(h=g.match(this.nc)){i=h[0];this.ch+=i.length;if(i.toLowerCase()in f.Jc.Fb||i==="currentColor"||i==="transparent")return d(b.z,i);if(g.charAt(i.length)==="("){this.ch++;if(i.toLowerCase()in this.fd){g=function(p){return p&&p.k&b.oa};h=function(p){return p&&p.k&(b.oa|b.Ra)};var n=function(p,r){return p&&p.d===r},m=function(){return k.next(1)}; |
490 | +if((i.charAt(0)==="r"?h(m()):g(m()))&&n(m(),",")&&h(m())&&n(m(),",")&&h(m())&&(i==="rgb"||i==="hsa"||n(m(),",")&&g(m()))&&n(m(),")"))return d(b.z,this.$a.substring(j,this.ch));return e()}return d(b.Xb,i)}return d(b.na,i)}this.ch++;return d(b.Wb,i)},D:function(){return this.X[this.Ga-- -2]},all:function(){for(;this.next(););return this.X},ma:function(c,d){for(var e=[],g,j;g=this.next();){if(c(g)){j=true;this.D();break}e.push(g)}return d&&!j?null:e}};return a}();var ha=function(a){this.e=a};ha.prototype= |
491 | +{Z:0,Od:function(){var a=this.qb,b;return!a||(b=this.o())&&(a.x!==b.x||a.y!==b.y)},Td:function(){var a=this.qb,b;return!a||(b=this.o())&&(a.h!==b.h||a.f!==b.f)},hc:function(){var a=this.e,b=a.getBoundingClientRect(),c=f.ja===9,d=f.O===7,e=b.right-b.left;return{x:b.left,y:b.top,h:c||d?a.offsetWidth:e,f:c||d?a.offsetHeight:b.bottom-b.top,Hd:d&&e?a.offsetWidth/e:1}},o:function(){return this.Z?this.Va||(this.Va=this.hc()):this.hc()},Ad:function(){return!!this.qb},cb:function(){++this.Z},hb:function(){if(!--this.Z){if(this.Va)this.qb= |
492 | +this.Va;this.Va=null}}};(function(){function a(b){var c=f.p.Ba(b);return function(){if(this.Z){var d=this.$b||(this.$b={});return c in d?d[c]:(d[c]=b.call(this))}else return b.call(this)}}f.B={Z:0,ka:function(b){function c(d){this.e=d;this.Zb=this.ia()}f.p.Eb(c.prototype,f.B,b);c.$c={};return c},j:function(){var b=this.ia(),c=this.constructor.$c;return b?b in c?c[b]:(c[b]=this.la(b)):null},ia:a(function(){var b=this.e,c=this.constructor,d=b.style;b=b.currentStyle;var e=this.wa,g=this.Fa,j=c.Yc||(c.Yc= |
493 | +f.F+e);c=c.Zc||(c.Zc=f.nb+g.charAt(0).toUpperCase()+g.substring(1));return d[c]||b.getAttribute(j)||d[g]||b.getAttribute(e)}),i:a(function(){return!!this.j()}),H:a(function(){var b=this.ia(),c=b!==this.Zb;this.Zb=b;return c}),va:a,cb:function(){++this.Z},hb:function(){--this.Z||delete this.$b}}})();f.Sb=f.B.ka({wa:f.F+"background",Fa:f.nb+"Background",cd:{scroll:1,fixed:1,local:1},fb:{"repeat-x":1,"repeat-y":1,repeat:1,"no-repeat":1},sc:{"padding-box":1,"border-box":1,"content-box":1},Pd:{top:1,right:1, |
494 | +bottom:1,left:1,center:1},Ud:{contain:1,cover:1},eb:{Ma:"backgroundClip",z:"backgroundColor",da:"backgroundImage",Pa:"backgroundOrigin",S:"backgroundPosition",T:"backgroundRepeat",Sa:"backgroundSize"},la:function(a){function b(s){return s&&s.W()||s.k&k&&s.d in t}function c(s){return s&&(s.W()&&f.n(s.d)||s.d==="auto"&&"auto")}var d=this.e.currentStyle,e,g,j,i=f.v.qa,h=i.pa,k=i.na,n=i.z,m,p,r=0,t=this.Pd,v,l,q={M:[]};if(this.wb()){e=new f.v(a);for(j={};g=e.next();){m=g.k;p=g.d;if(!j.P&&m&i.Xb&&p=== |
495 | +"linear-gradient"){v={ca:[],P:p};for(l={};g=e.next();){m=g.k;p=g.d;if(m&i.Wb&&p===")"){l.color&&v.ca.push(l);v.ca.length>1&&f.p.Eb(j,v);break}if(m&n){if(v.sa||v.zb){g=e.D();if(g.k!==h)break;e.next()}l={color:f.ha(p)};g=e.next();if(g.W())l.db=f.n(g.d);else e.D()}else if(m&i.Ia&&!v.sa&&!l.color&&!v.ca.length)v.sa=new f.Ec(g.d);else if(b(g)&&!v.zb&&!l.color&&!v.ca.length){e.D();v.zb=new f.Ja(e.ma(function(s){return!b(s)},false))}else if(m&h&&p===","){if(l.color){v.ca.push(l);l={}}}else break}}else if(!j.P&& |
496 | +m&i.URL){j.Ab=p;j.P="image"}else if(b(g)&&!j.$){e.D();j.$=new f.Ja(e.ma(function(s){return!b(s)},false))}else if(m&k)if(p in this.fb&&!j.bb)j.bb=p;else if(p in this.sc&&!j.Wa){j.Wa=p;if((g=e.next())&&g.k&k&&g.d in this.sc)j.ub=g.d;else{j.ub=p;e.D()}}else if(p in this.cd&&!j.bc)j.bc=p;else return null;else if(m&n&&!q.color)q.color=f.ha(p);else if(m&h&&p==="/"&&!j.Xa&&j.$){g=e.next();if(g.k&k&&g.d in this.Ud)j.Xa=new f.Ka(g.d);else if(g=c(g)){m=c(e.next());if(!m){m=g;e.D()}j.Xa=new f.Ka(g,m)}else return null}else if(m& |
497 | +h&&p===","&&j.P){j.Hb=a.substring(r,e.ch-1);r=e.ch;q.M.push(j);j={}}else return null}if(j.P){j.Hb=a.substring(r);q.M.push(j)}}else this.Bc(f.ja<9?function(){var s=this.eb,o=d[s.S+"X"],u=d[s.S+"Y"],x=d[s.da],y=d[s.z];if(y!=="transparent")q.color=f.ha(y);if(x!=="none")q.M=[{P:"image",Ab:(new f.v(x)).next().d,bb:d[s.T],$:new f.Ja((new f.v(o+" "+u)).all())}]}:function(){var s=this.eb,o=/\s*,\s*/,u=d[s.da].split(o),x=d[s.z],y,z,B,E,D,C;if(x!=="transparent")q.color=f.ha(x);if((E=u.length)&&u[0]!=="none"){x= |
498 | +d[s.T].split(o);y=d[s.S].split(o);z=d[s.Pa].split(o);B=d[s.Ma].split(o);s=d[s.Sa].split(o);q.M=[];for(o=0;o<E;o++)if((D=u[o])&&D!=="none"){C=s[o].split(" ");q.M.push({Hb:D+" "+x[o]+" "+y[o]+" / "+s[o]+" "+z[o]+" "+B[o],P:"image",Ab:(new f.v(D)).next().d,bb:x[o],$:new f.Ja((new f.v(y[o])).all()),Wa:z[o],ub:B[o],Xa:new f.Ka(C[0],C[1])})}}});return q.color||q.M[0]?q:null},Bc:function(a){var b=f.ja>8,c=this.eb,d=this.e.runtimeStyle,e=d[c.da],g=d[c.z],j=d[c.T],i,h,k,n;if(e)d[c.da]="";if(g)d[c.z]="";if(j)d[c.T]= |
499 | +"";if(b){i=d[c.Ma];h=d[c.Pa];n=d[c.S];k=d[c.Sa];if(i)d[c.Ma]="";if(h)d[c.Pa]="";if(n)d[c.S]="";if(k)d[c.Sa]=""}a=a.call(this);if(e)d[c.da]=e;if(g)d[c.z]=g;if(j)d[c.T]=j;if(b){if(i)d[c.Ma]=i;if(h)d[c.Pa]=h;if(n)d[c.S]=n;if(k)d[c.Sa]=k}return a},ia:f.B.va(function(){return this.wb()||this.Bc(function(){var a=this.e.currentStyle,b=this.eb;return a[b.z]+" "+a[b.da]+" "+a[b.T]+" "+a[b.S+"X"]+" "+a[b.S+"Y"]})}),wb:f.B.va(function(){var a=this.e;return a.style[this.Fa]||a.currentStyle.getAttribute(this.wa)}), |
500 | +qc:function(){var a=0;if(f.O<7){a=this.e;a=""+(a.style[f.nb+"PngFix"]||a.currentStyle.getAttribute(f.F+"png-fix"))==="true"}return a},i:f.B.va(function(){return(this.wb()||this.qc())&&!!this.j()})});f.Vb=f.B.ka({wc:["Top","Right","Bottom","Left"],Id:{thin:"1px",medium:"3px",thick:"5px"},la:function(){var a={},b={},c={},d=false,e=true,g=true,j=true;this.Cc(function(){for(var i=this.e.currentStyle,h=0,k,n,m,p,r,t,v;h<4;h++){m=this.wc[h];v=m.charAt(0).toLowerCase();k=b[v]=i["border"+m+"Style"];n=i["border"+ |
501 | +m+"Color"];m=i["border"+m+"Width"];if(h>0){if(k!==p)g=false;if(n!==r)e=false;if(m!==t)j=false}p=k;r=n;t=m;c[v]=f.ha(n);m=a[v]=f.n(b[v]==="none"?"0":this.Id[m]||m);if(m.a(this.e)>0)d=true}});return d?{J:a,Zd:b,gd:c,ee:j,hd:e,$d:g}:null},ia:f.B.va(function(){var a=this.e,b=a.currentStyle,c;a.tagName in f.Ac&&a.offsetParent.currentStyle.borderCollapse==="collapse"||this.Cc(function(){c=b.borderWidth+"|"+b.borderStyle+"|"+b.borderColor});return c}),Cc:function(a){var b=this.e.runtimeStyle,c=b.borderWidth, |
502 | +d=b.borderColor;if(c)b.borderWidth="";if(d)b.borderColor="";a=a.call(this);if(c)b.borderWidth=c;if(d)b.borderColor=d;return a}});(function(){f.jb=f.B.ka({wa:"border-radius",Fa:"borderRadius",la:function(b){var c=null,d,e,g,j,i=false;if(b){e=new f.v(b);var h=function(){for(var k=[],n;(g=e.next())&&g.W();){j=f.n(g.d);n=j.ic();if(n<0)return null;if(n>0)i=true;k.push(j)}return k.length>0&&k.length<5?{tl:k[0],tr:k[1]||k[0],br:k[2]||k[0],bl:k[3]||k[1]||k[0]}:null};if(b=h()){if(g){if(g.k&f.v.qa.pa&&g.d=== |
503 | +"/")d=h()}else d=b;if(i&&b&&d)c={x:b,y:d}}}return c}});var a=f.n("0");a={tl:a,tr:a,br:a,bl:a};f.jb.Dc={x:a,y:a}})();f.Ub=f.B.ka({wa:"border-image",Fa:"borderImage",fb:{stretch:1,round:1,repeat:1,space:1},la:function(a){var b=null,c,d,e,g,j,i,h=0,k=f.v.qa,n=k.na,m=k.oa,p=k.Ra;if(a){c=new f.v(a);b={};for(var r=function(l){return l&&l.k&k.pa&&l.d==="/"},t=function(l){return l&&l.k&n&&l.d==="fill"},v=function(){g=c.ma(function(l){return!(l.k&(m|p))});if(t(c.next())&&!b.fill)b.fill=true;else c.D();if(r(c.next())){h++; |
504 | +j=c.ma(function(l){return!l.W()&&!(l.k&n&&l.d==="auto")});if(r(c.next())){h++;i=c.ma(function(l){return!l.Ca()})}}else c.D()};a=c.next();){d=a.k;e=a.d;if(d&(m|p)&&!g){c.D();v()}else if(t(a)&&!b.fill){b.fill=true;v()}else if(d&n&&this.fb[e]&&!b.repeat){b.repeat={f:e};if(a=c.next())if(a.k&n&&this.fb[a.d])b.repeat.Ob=a.d;else c.D()}else if(d&k.URL&&!b.src)b.src=e;else return null}if(!b.src||!g||g.length<1||g.length>4||j&&j.length>4||h===1&&j.length<1||i&&i.length>4||h===2&&i.length<1)return null;if(!b.repeat)b.repeat= |
505 | +{f:"stretch"};if(!b.repeat.Ob)b.repeat.Ob=b.repeat.f;a=function(l,q){return{t:q(l[0]),r:q(l[1]||l[0]),b:q(l[2]||l[0]),l:q(l[3]||l[1]||l[0])}};b.slice=a(g,function(l){return f.n(l.k&m?l.d+"px":l.d)});if(j&&j[0])b.J=a(j,function(l){return l.W()?f.n(l.d):l.d});if(i&&i[0])b.Da=a(i,function(l){return l.Ca()?f.n(l.d):l.d})}return b}});f.Ic=f.B.ka({wa:"box-shadow",Fa:"boxShadow",la:function(a){var b,c=f.n,d=f.v.qa,e;if(a){e=new f.v(a);b={Da:[],Bb:[]};for(a=function(){for(var g,j,i,h,k,n;g=e.next();){i=g.d; |
506 | +j=g.k;if(j&d.pa&&i===",")break;else if(g.Ca()&&!k){e.D();k=e.ma(function(m){return!m.Ca()})}else if(j&d.z&&!h)h=i;else if(j&d.na&&i==="inset"&&!n)n=true;else return false}g=k&&k.length;if(g>1&&g<5){(n?b.Bb:b.Da).push({fe:c(k[0].d),ge:c(k[1].d),blur:c(k[2]?k[2].d:"0"),Vd:c(k[3]?k[3].d:"0"),color:f.ha(h||"currentColor")});return true}return false};a(););}return b&&(b.Bb.length||b.Da.length)?b:null}});f.Uc=f.B.ka({ia:f.B.va(function(){var a=this.e.currentStyle;return a.visibility+"|"+a.display}),la:function(){var a= |
507 | +this.e,b=a.runtimeStyle;a=a.currentStyle;var c=b.visibility,d;b.visibility="";d=a.visibility;b.visibility=c;return{ce:d!=="hidden",nd:a.display!=="none"}},i:function(){return false}});f.u={R:function(a){function b(c,d,e,g){this.e=c;this.s=d;this.g=e;this.parent=g}f.p.Eb(b.prototype,f.u,a);return b},Cb:false,Q:function(){return false},Ea:f.aa,Lb:function(){this.m();this.i()&&this.V()},ib:function(){this.Cb=true},Mb:function(){this.i()?this.V():this.m()},sb:function(a,b){this.vc(a);for(var c=this.ra|| |
508 | +(this.ra=[]),d=a+1,e=c.length,g;d<e;d++)if(g=c[d])break;c[a]=b;this.I().insertBefore(b,g||null)},za:function(a){var b=this.ra;return b&&b[a]||null},vc:function(a){var b=this.za(a),c=this.Ta;if(b&&c){c.removeChild(b);this.ra[a]=null}},Aa:function(a,b,c,d){var e=this.rb||(this.rb={}),g=e[a];if(!g){g=e[a]=f.p.Za("shape");if(b)g.appendChild(g[b]=f.p.Za(b));if(d){c=this.za(d);if(!c){this.sb(d,doc.createElement("group"+d));c=this.za(d)}}c.appendChild(g);a=g.style;a.position="absolute";a.left=a.top=0;a.behavior= |
509 | +"url(#default#VML)"}return g},vb:function(a){var b=this.rb,c=b&&b[a];if(c){c.parentNode.removeChild(c);delete b[a]}return!!c},kc:function(a){var b=this.e,c=this.s.o(),d=c.h,e=c.f,g,j,i,h,k,n;c=a.x.tl.a(b,d);g=a.y.tl.a(b,e);j=a.x.tr.a(b,d);i=a.y.tr.a(b,e);h=a.x.br.a(b,d);k=a.y.br.a(b,e);n=a.x.bl.a(b,d);a=a.y.bl.a(b,e);d=Math.min(d/(c+j),e/(i+k),d/(n+h),e/(g+a));if(d<1){c*=d;g*=d;j*=d;i*=d;h*=d;k*=d;n*=d;a*=d}return{x:{tl:c,tr:j,br:h,bl:n},y:{tl:g,tr:i,br:k,bl:a}}},ya:function(a,b,c){b=b||1;var d,e, |
510 | +g=this.s.o();e=g.h*b;g=g.f*b;var j=this.g.G,i=Math.floor,h=Math.ceil,k=a?a.Jb*b:0,n=a?a.Ib*b:0,m=a?a.tb*b:0;a=a?a.Db*b:0;var p,r,t,v,l;if(c||j.i()){d=this.kc(c||j.j());c=d.x.tl*b;j=d.y.tl*b;p=d.x.tr*b;r=d.y.tr*b;t=d.x.br*b;v=d.y.br*b;l=d.x.bl*b;b=d.y.bl*b;e="m"+i(a)+","+i(j)+"qy"+i(c)+","+i(k)+"l"+h(e-p)+","+i(k)+"qx"+h(e-n)+","+i(r)+"l"+h(e-n)+","+h(g-v)+"qy"+h(e-t)+","+h(g-m)+"l"+i(l)+","+h(g-m)+"qx"+i(a)+","+h(g-b)+" x e"}else e="m"+i(a)+","+i(k)+"l"+h(e-n)+","+i(k)+"l"+h(e-n)+","+h(g-m)+"l"+i(a)+ |
511 | +","+h(g-m)+"xe";return e},I:function(){var a=this.parent.za(this.N),b;if(!a){a=doc.createElement(this.Ya);b=a.style;b.position="absolute";b.top=b.left=0;this.parent.sb(this.N,a)}return a},mc:function(){var a=this.e,b=a.currentStyle,c=a.runtimeStyle,d=a.tagName,e=f.O===6,g;if(e&&(d in f.cc||d==="FIELDSET")||d==="BUTTON"||d==="INPUT"&&a.type in f.Gd){c.borderWidth="";d=this.g.w.wc;for(g=d.length;g--;){e=d[g];c["padding"+e]="";c["padding"+e]=f.n(b["padding"+e]).a(a)+f.n(b["border"+e+"Width"]).a(a)+(f.O!== |
512 | +8&&g%2?1:0)}c.borderWidth=0}else if(e){if(a.childNodes.length!==1||a.firstChild.tagName!=="ie6-mask"){b=doc.createElement("ie6-mask");d=b.style;d.visibility="visible";for(d.zoom=1;d=a.firstChild;)b.appendChild(d);a.appendChild(b);c.visibility="hidden"}}else c.borderColor="transparent"},ie:function(){},m:function(){this.parent.vc(this.N);delete this.rb;delete this.ra}};f.Rc=f.u.R({i:function(){var a=this.ed;for(var b in a)if(a.hasOwnProperty(b)&&a[b].i())return true;return false},Q:function(){return this.g.Pb.H()}, |
513 | +ib:function(){if(this.i()){var a=this.jc(),b=a,c;a=a.currentStyle;var d=a.position,e=this.I().style,g=0,j=0;j=this.s.o();var i=j.Hd;if(d==="fixed"&&f.O>6){g=j.x*i;j=j.y*i;b=d}else{do b=b.offsetParent;while(b&&b.currentStyle.position==="static");if(b){c=b.getBoundingClientRect();b=b.currentStyle;g=(j.x-c.left)*i-(parseFloat(b.borderLeftWidth)||0);j=(j.y-c.top)*i-(parseFloat(b.borderTopWidth)||0)}else{b=doc.documentElement;g=(j.x+b.scrollLeft-b.clientLeft)*i;j=(j.y+b.scrollTop-b.clientTop)*i}b="absolute"}e.position= |
514 | +b;e.left=g;e.top=j;e.zIndex=d==="static"?-1:a.zIndex;this.Cb=true}},Mb:f.aa,Nb:function(){var a=this.g.Pb.j();this.I().style.display=a.ce&&a.nd?"":"none"},Lb:function(){this.i()?this.Nb():this.m()},jc:function(){var a=this.e;return a.tagName in f.Ac?a.offsetParent:a},I:function(){var a=this.Ta,b;if(!a){b=this.jc();a=this.Ta=doc.createElement("css3-container");a.style.direction="ltr";this.Nb();b.parentNode.insertBefore(a,b)}return a},ab:f.aa,m:function(){var a=this.Ta,b;if(a&&(b=a.parentNode))b.removeChild(a); |
515 | +delete this.Ta;delete this.ra}});f.Fc=f.u.R({N:2,Ya:"background",Q:function(){var a=this.g;return a.C.H()||a.G.H()},i:function(){var a=this.g;return a.q.i()||a.G.i()||a.C.i()||a.ga.i()&&a.ga.j().Bb},V:function(){var a=this.s.o();if(a.h&&a.f){this.od();this.pd()}},od:function(){var a=this.g.C.j(),b=this.s.o(),c=this.e,d=a&&a.color,e,g;if(d&&d.fa()>0){this.lc();a=this.Aa("bgColor","fill",this.I(),1);e=b.h;b=b.f;a.stroked=false;a.coordsize=e*2+","+b*2;a.coordorigin="1,1";a.path=this.ya(null,2);g=a.style; |
516 | +g.width=e;g.height=b;a.fill.color=d.U(c);c=d.fa();if(c<1)a.fill.opacity=c}else this.vb("bgColor")},pd:function(){var a=this.g.C.j(),b=this.s.o();a=a&&a.M;var c,d,e,g,j;if(a){this.lc();d=b.h;e=b.f;for(j=a.length;j--;){b=a[j];c=this.Aa("bgImage"+j,"fill",this.I(),2);c.stroked=false;c.fill.type="tile";c.fillcolor="none";c.coordsize=d*2+","+e*2;c.coordorigin="1,1";c.path=this.ya(0,2);g=c.style;g.width=d;g.height=e;if(b.P==="linear-gradient")this.bd(c,b);else{c.fill.src=b.Ab;this.Nd(c,j)}}}for(j=a?a.length: |
517 | +0;this.vb("bgImage"+j++););},Nd:function(a,b){var c=this;f.p.Rb(a.fill.src,function(d){var e=c.e,g=c.s.o(),j=g.h;g=g.f;if(j&&g){var i=a.fill,h=c.g,k=h.w.j(),n=k&&k.J;k=n?n.t.a(e):0;var m=n?n.r.a(e):0,p=n?n.b.a(e):0;n=n?n.l.a(e):0;h=h.C.j().M[b];e=h.$?h.$.coords(e,j-d.h-n-m,g-d.f-k-p):{x:0,y:0};h=h.bb;p=m=0;var r=j+1,t=g+1,v=f.O===8?0:1;n=Math.round(e.x)+n+0.5;k=Math.round(e.y)+k+0.5;i.position=n/j+","+k/g;i.size.x=1;i.size=d.h+"px,"+d.f+"px";if(h&&h!=="repeat"){if(h==="repeat-x"||h==="no-repeat"){m= |
518 | +k+1;t=k+d.f+v}if(h==="repeat-y"||h==="no-repeat"){p=n+1;r=n+d.h+v}a.style.clip="rect("+m+"px,"+r+"px,"+t+"px,"+p+"px)"}}})},bd:function(a,b){var c=this.e,d=this.s.o(),e=d.h,g=d.f;a=a.fill;d=b.ca;var j=d.length,i=Math.PI,h=f.Na,k=h.tc,n=h.dc;b=h.gc(c,e,g,b);h=b.sa;var m=b.xc,p=b.yc,r=b.Wd,t=b.Xd,v=b.rd,l=b.sd,q=b.kd,s=b.ld;b=b.rc;e=h%90?Math.atan2(q*e/g,s)/i*180:h+90;e+=180;e%=360;v=k(r,t,h,v,l);g=n(r,t,v[0],v[1]);i=[];v=k(m,p,h,r,t);n=n(m,p,v[0],v[1])/g*100;k=[];for(h=0;h<j;h++)k.push(d[h].db?d[h].db.a(c, |
519 | +b):h===0?0:h===j-1?b:null);for(h=1;h<j;h++){if(k[h]===null){m=k[h-1];b=h;do p=k[++b];while(p===null);k[h]=m+(p-m)/(b-h+1)}k[h]=Math.max(k[h],k[h-1])}for(h=0;h<j;h++)i.push(n+k[h]/g*100+"% "+d[h].color.U(c));a.angle=e;a.type="gradient";a.method="sigma";a.color=d[0].color.U(c);a.color2=d[j-1].color.U(c);if(a.colors)a.colors.value=i.join(",");else a.colors=i.join(",")},lc:function(){var a=this.e.runtimeStyle;a.backgroundImage="url(about:blank)";a.backgroundColor="transparent"},m:function(){f.u.m.call(this); |
520 | +var a=this.e.runtimeStyle;a.backgroundImage=a.backgroundColor=""}});f.Gc=f.u.R({N:4,Ya:"border",Q:function(){var a=this.g;return a.w.H()||a.G.H()},i:function(){var a=this.g;return a.G.i()&&!a.q.i()&&a.w.i()},V:function(){var a=this.e,b=this.g.w.j(),c=this.s.o(),d=c.h;c=c.f;var e,g,j,i,h;if(b){this.mc();b=this.wd(2);i=0;for(h=b.length;i<h;i++){j=b[i];e=this.Aa("borderPiece"+i,j.stroke?"stroke":"fill",this.I());e.coordsize=d*2+","+c*2;e.coordorigin="1,1";e.path=j.path;g=e.style;g.width=d;g.height=c; |
521 | +e.filled=!!j.fill;e.stroked=!!j.stroke;if(j.stroke){e=e.stroke;e.weight=j.Qb+"px";e.color=j.color.U(a);e.dashstyle=j.stroke==="dashed"?"2 2":j.stroke==="dotted"?"1 1":"solid";e.linestyle=j.stroke==="double"&&j.Qb>2?"ThinThin":"Single"}else e.fill.color=j.fill.U(a)}for(;this.vb("borderPiece"+i++););}},wd:function(a){var b=this.e,c,d,e,g=this.g.w,j=[],i,h,k,n,m=Math.round,p,r,t;if(g.i()){c=g.j();g=c.J;r=c.Zd;t=c.gd;if(c.ee&&c.$d&&c.hd){if(t.t.fa()>0){c=g.t.a(b);k=c/2;j.push({path:this.ya({Jb:k,Ib:k, |
522 | +tb:k,Db:k},a),stroke:r.t,color:t.t,Qb:c})}}else{a=a||1;c=this.s.o();d=c.h;e=c.f;c=m(g.t.a(b));k=m(g.r.a(b));n=m(g.b.a(b));b=m(g.l.a(b));var v={t:c,r:k,b:n,l:b};b=this.g.G;if(b.i())p=this.kc(b.j());i=Math.floor;h=Math.ceil;var l=function(o,u){return p?p[o][u]:0},q=function(o,u,x,y,z,B){var E=l("x",o),D=l("y",o),C=o.charAt(1)==="r";o=o.charAt(0)==="b";return E>0&&D>0?(B?"al":"ae")+(C?h(d-E):i(E))*a+","+(o?h(e-D):i(D))*a+","+(i(E)-u)*a+","+(i(D)-x)*a+","+y*65535+","+2949075*(z?1:-1):(B?"m":"l")+(C?d- |
523 | +u:u)*a+","+(o?e-x:x)*a},s=function(o,u,x,y){var z=o==="t"?i(l("x","tl"))*a+","+h(u)*a:o==="r"?h(d-u)*a+","+i(l("y","tr"))*a:o==="b"?h(d-l("x","br"))*a+","+i(e-u)*a:i(u)*a+","+h(e-l("y","bl"))*a;o=o==="t"?h(d-l("x","tr"))*a+","+h(u)*a:o==="r"?h(d-u)*a+","+h(e-l("y","br"))*a:o==="b"?i(l("x","bl"))*a+","+i(e-u)*a:i(u)*a+","+i(l("y","tl"))*a;return x?(y?"m"+o:"")+"l"+z:(y?"m"+z:"")+"l"+o};b=function(o,u,x,y,z,B){var E=o==="l"||o==="r",D=v[o],C,F;if(D>0&&r[o]!=="none"&&t[o].fa()>0){C=v[E?o:u];u=v[E?u: |
524 | +o];F=v[E?o:x];x=v[E?x:o];if(r[o]==="dashed"||r[o]==="dotted"){j.push({path:q(y,C,u,B+45,0,1)+q(y,0,0,B,1,0),fill:t[o]});j.push({path:s(o,D/2,0,1),stroke:r[o],Qb:D,color:t[o]});j.push({path:q(z,F,x,B,0,1)+q(z,0,0,B-45,1,0),fill:t[o]})}else j.push({path:q(y,C,u,B+45,0,1)+s(o,D,0,0)+q(z,F,x,B,0,0)+(r[o]==="double"&&D>2?q(z,F-i(F/3),x-i(x/3),B-45,1,0)+s(o,h(D/3*2),1,0)+q(y,C-i(C/3),u-i(u/3),B,1,0)+"x "+q(y,i(C/3),i(u/3),B+45,0,1)+s(o,i(D/3),1,0)+q(z,i(F/3),i(x/3),B,0,0):"")+q(z,0,0,B-45,1,0)+s(o,0,1, |
525 | +0)+q(y,0,0,B,1,0),fill:t[o]})}};b("t","l","r","tl","tr",90);b("r","t","b","tr","br",0);b("b","r","l","br","bl",-90);b("l","b","t","bl","tl",-180)}}return j},m:function(){if(this.ec||!this.g.q.i())this.e.runtimeStyle.borderColor="";f.u.m.call(this)}});f.Tb=f.u.R({N:5,Md:["t","tr","r","br","b","bl","l","tl","c"],Q:function(){return this.g.q.H()},i:function(){return this.g.q.i()},V:function(){this.I();var a=this.g.q.j(),b=this.g.w.j(),c=this.s.o(),d=this.e,e=this.uc;f.p.Rb(a.src,function(g){function j(s, |
526 | +o,u,x,y){s=e[s].style;var z=Math.max;s.width=z(o,0);s.height=z(u,0);s.left=x;s.top=y}function i(s,o,u){for(var x=0,y=s.length;x<y;x++)e[s[x]].imagedata[o]=u}var h=c.h,k=c.f,n=f.n("0"),m=a.J||(b?b.J:{t:n,r:n,b:n,l:n});n=m.t.a(d);var p=m.r.a(d),r=m.b.a(d);m=m.l.a(d);var t=a.slice,v=t.t.a(d),l=t.r.a(d),q=t.b.a(d);t=t.l.a(d);j("tl",m,n,0,0);j("t",h-m-p,n,m,0);j("tr",p,n,h-p,0);j("r",p,k-n-r,h-p,n);j("br",p,r,h-p,k-r);j("b",h-m-p,r,m,k-r);j("bl",m,r,0,k-r);j("l",m,k-n-r,0,n);j("c",h-m-p,k-n-r,m,n);i(["tl", |
527 | +"t","tr"],"cropBottom",(g.f-v)/g.f);i(["tl","l","bl"],"cropRight",(g.h-t)/g.h);i(["bl","b","br"],"cropTop",(g.f-q)/g.f);i(["tr","r","br"],"cropLeft",(g.h-l)/g.h);i(["l","r","c"],"cropTop",v/g.f);i(["l","r","c"],"cropBottom",q/g.f);i(["t","b","c"],"cropLeft",t/g.h);i(["t","b","c"],"cropRight",l/g.h);e.c.style.display=a.fill?"":"none"},this)},I:function(){var a=this.parent.za(this.N),b,c,d,e=this.Md,g=e.length;if(!a){a=doc.createElement("border-image");b=a.style;b.position="absolute";this.uc={};for(d= |
528 | +0;d<g;d++){c=this.uc[e[d]]=f.p.Za("rect");c.appendChild(f.p.Za("imagedata"));b=c.style;b.behavior="url(#default#VML)";b.position="absolute";b.top=b.left=0;c.imagedata.src=this.g.q.j().src;c.stroked=false;c.filled=false;a.appendChild(c)}this.parent.sb(this.N,a)}return a},Ea:function(){if(this.i()){var a=this.e,b=a.runtimeStyle,c=this.g.q.j().J;b.borderStyle="solid";if(c){b.borderTopWidth=c.t.a(a)+"px";b.borderRightWidth=c.r.a(a)+"px";b.borderBottomWidth=c.b.a(a)+"px";b.borderLeftWidth=c.l.a(a)+"px"}this.mc()}}, |
529 | +m:function(){var a=this.e.runtimeStyle;a.borderStyle="";if(this.ec||!this.g.w.i())a.borderColor=a.borderWidth="";f.u.m.call(this)}});f.Hc=f.u.R({N:1,Ya:"outset-box-shadow",Q:function(){var a=this.g;return a.ga.H()||a.G.H()},i:function(){var a=this.g.ga;return a.i()&&a.j().Da[0]},V:function(){function a(C,F,O,H,M,P,I){C=b.Aa("shadow"+C+F,"fill",d,j-C);F=C.fill;C.coordsize=n*2+","+m*2;C.coordorigin="1,1";C.stroked=false;C.filled=true;F.color=M.U(c);if(P){F.type="gradienttitle";F.color2=F.color;F.opacity= |
530 | +0}C.path=I;l=C.style;l.left=O;l.top=H;l.width=n;l.height=m;return C}var b=this,c=this.e,d=this.I(),e=this.g,g=e.ga.j().Da;e=e.G.j();var j=g.length,i=j,h,k=this.s.o(),n=k.h,m=k.f;k=f.O===8?1:0;for(var p=["tl","tr","br","bl"],r,t,v,l,q,s,o,u,x,y,z,B,E,D;i--;){t=g[i];q=t.fe.a(c);s=t.ge.a(c);h=t.Vd.a(c);o=t.blur.a(c);t=t.color;u=-h-o;if(!e&&o)e=f.jb.Dc;u=this.ya({Jb:u,Ib:u,tb:u,Db:u},2,e);if(o){x=(h+o)*2+n;y=(h+o)*2+m;z=x?o*2/x:0;B=y?o*2/y:0;if(o-h>n/2||o-h>m/2)for(h=4;h--;){r=p[h];E=r.charAt(0)==="b"; |
531 | +D=r.charAt(1)==="r";r=a(i,r,q,s,t,o,u);v=r.fill;v.focusposition=(D?1-z:z)+","+(E?1-B:B);v.focussize="0,0";r.style.clip="rect("+((E?y/2:0)+k)+"px,"+(D?x:x/2)+"px,"+(E?y:y/2)+"px,"+((D?x/2:0)+k)+"px)"}else{r=a(i,"",q,s,t,o,u);v=r.fill;v.focusposition=z+","+B;v.focussize=1-z*2+","+(1-B*2)}}else{r=a(i,"",q,s,t,o,u);q=t.fa();if(q<1)r.fill.opacity=q}}}});f.Pc=f.u.R({N:6,Ya:"imgEl",Q:function(){var a=this.g;return this.e.src!==this.Xc||a.G.H()},i:function(){var a=this.g;return a.G.i()||a.C.qc()},V:function(){this.Xc= |
532 | +j;this.Cd();var a=this.Aa("img","fill",this.I()),b=a.fill,c=this.s.o(),d=c.h;c=c.f;var e=this.g.w.j(),g=e&&e.J;e=this.e;var j=e.src,i=Math.round,h=e.currentStyle,k=f.n;if(!g||f.O<7){g=f.n("0");g={t:g,r:g,b:g,l:g}}a.stroked=false;b.type="frame";b.src=j;b.position=(d?0.5/d:0)+","+(c?0.5/c:0);a.coordsize=d*2+","+c*2;a.coordorigin="1,1";a.path=this.ya({Jb:i(g.t.a(e)+k(h.paddingTop).a(e)),Ib:i(g.r.a(e)+k(h.paddingRight).a(e)),tb:i(g.b.a(e)+k(h.paddingBottom).a(e)),Db:i(g.l.a(e)+k(h.paddingLeft).a(e))}, |
533 | +2);a=a.style;a.width=d;a.height=c},Cd:function(){this.e.runtimeStyle.filter="alpha(opacity=0)"},m:function(){f.u.m.call(this);this.e.runtimeStyle.filter=""}});f.Oc=f.u.R({ib:f.aa,Mb:f.aa,Nb:f.aa,Lb:f.aa,Ld:/^,+|,+$/g,Fd:/,+/g,gb:function(a,b){(this.pb||(this.pb=[]))[a]=b||void 0},ab:function(){var a=this.pb,b;if(a&&(b=a.join(",").replace(this.Ld,"").replace(this.Fd,","))!==this.Wc)this.Wc=this.e.runtimeStyle.background=b},m:function(){this.e.runtimeStyle.background="";delete this.pb}});f.Mc=f.u.R({ua:1, |
534 | +Q:function(){return this.g.C.H()},i:function(){var a=this.g;return a.C.i()||a.q.i()},V:function(){var a=this.g.C.j(),b,c,d=0,e,g;if(a){b=[];if(c=a.M)for(;e=c[d++];)if(e.P==="linear-gradient"){g=this.vd(e.Wa);g=(e.Xa||f.Ka.Kc).a(this.e,g.h,g.f,g.h,g.f);b.push("url(data:image/svg+xml,"+escape(this.xd(e,g.h,g.f))+") "+this.dd(e.$)+" / "+g.h+"px "+g.f+"px "+(e.bc||"")+" "+(e.Wa||"")+" "+(e.ub||""))}else b.push(e.Hb);a.color&&b.push(a.color.Y);this.parent.gb(this.ua,b.join(","))}},dd:function(a){return a? |
535 | +a.X.map(function(b){return b.d}).join(" "):"0 0"},vd:function(a){var b=this.e,c=this.s.o(),d=c.h;c=c.f;var e;if(a!=="border-box")if((e=this.g.w.j())&&(e=e.J)){d-=e.l.a(b)+e.l.a(b);c-=e.t.a(b)+e.b.a(b)}if(a==="content-box"){a=f.n;e=b.currentStyle;d-=a(e.paddingLeft).a(b)+a(e.paddingRight).a(b);c-=a(e.paddingTop).a(b)+a(e.paddingBottom).a(b)}return{h:d,f:c}},xd:function(a,b,c){var d=this.e,e=a.ca,g=e.length,j=f.Na.gc(d,b,c,a);a=j.xc;var i=j.yc,h=j.td,k=j.ud;j=j.rc;var n,m,p,r,t;n=[];for(m=0;m<g;m++)n.push(e[m].db? |
536 | +e[m].db.a(d,j):m===0?0:m===g-1?j:null);for(m=1;m<g;m++)if(n[m]===null){r=n[m-1];p=m;do t=n[++p];while(t===null);n[m]=r+(t-r)/(p-m+1)}b=['<svg width="'+b+'" height="'+c+'" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="g" gradientUnits="userSpaceOnUse" x1="'+a/b*100+'%" y1="'+i/c*100+'%" x2="'+h/b*100+'%" y2="'+k/c*100+'%">'];for(m=0;m<g;m++)b.push('<stop offset="'+n[m]/j+'" stop-color="'+e[m].color.U(d)+'" stop-opacity="'+e[m].color.fa()+'"/>');b.push('</linearGradient></defs><rect width="100%" height="100%" fill="url(#g)"/></svg>'); |
537 | +return b.join("")},m:function(){this.parent.gb(this.ua)}});f.Nc=f.u.R({T:"repeat",Sc:"stretch",Qc:"round",ua:0,Q:function(){return this.g.q.H()},i:function(){return this.g.q.i()},V:function(){var a=this,b=a.g.q.j(),c=a.g.w.j(),d=a.s.o(),e=b.repeat,g=e.f,j=e.Ob,i=a.e,h=0;f.p.Rb(b.src,function(k){function n(Q,R,U,V,W,Y,X,S,w,A){K.push('<pattern patternUnits="userSpaceOnUse" id="pattern'+G+'" x="'+(g===l?Q+U/2-w/2:Q)+'" y="'+(j===l?R+V/2-A/2:R)+'" width="'+w+'" height="'+A+'"><svg width="'+w+'" height="'+ |
538 | +A+'" viewBox="'+W+" "+Y+" "+X+" "+S+'" preserveAspectRatio="none"><image xlink:href="'+v+'" x="0" y="0" width="'+r+'" height="'+t+'" /></svg></pattern>');J.push('<rect x="'+Q+'" y="'+R+'" width="'+U+'" height="'+V+'" fill="url(#pattern'+G+')" />');G++}var m=d.h,p=d.f,r=k.h,t=k.f,v=a.Dd(b.src,r,t),l=a.T,q=a.Sc;k=a.Qc;var s=Math.ceil,o=f.n("0"),u=b.J||(c?c.J:{t:o,r:o,b:o,l:o});o=u.t.a(i);var x=u.r.a(i),y=u.b.a(i);u=u.l.a(i);var z=b.slice,B=z.t.a(i),E=z.r.a(i),D=z.b.a(i);z=z.l.a(i);var C=m-u-x,F=p-o- |
539 | +y,O=r-z-E,H=t-B-D,M=g===q?C:O*o/B,P=j===q?F:H*x/E,I=g===q?C:O*y/D;q=j===q?F:H*u/z;var K=[],J=[],G=0;if(g===k){M-=(M-(C%M||M))/s(C/M);I-=(I-(C%I||I))/s(C/I)}if(j===k){P-=(P-(F%P||P))/s(F/P);q-=(q-(F%q||q))/s(F/q)}k=['<svg width="'+m+'" height="'+p+'" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'];n(0,0,u,o,0,0,z,B,u,o);n(u,0,C,o,z,0,O,B,M,o);n(m-x,0,x,o,r-E,0,E,B,x,o);n(0,o,u,F,0,B,z,H,u,q);if(b.fill)n(u,o,C,F,z,B,O,H,M||I||O,q||P||H);n(m-x,o,x,F,r-E,B,E,H,x,P);n(0, |
540 | +p-y,u,y,0,t-D,z,D,u,y);n(u,p-y,C,y,z,t-D,O,D,I,y);n(m-x,p-y,x,y,r-E,t-D,E,D,x,y);k.push("<defs>"+K.join("\n")+"</defs>"+J.join("\n")+"</svg>");a.parent.gb(a.ua,"url(data:image/svg+xml,"+escape(k.join(""))+") no-repeat border-box border-box");h&&a.parent.ab()},a);h=1},Dd:function(){var a={};return function(b,c,d){var e=a[b],g;if(!e){e=new Image;g=doc.createElement("canvas");e.src=b;g.width=c;g.height=d;g.getContext("2d").drawImage(e,0,0);e=a[b]=g.toDataURL()}return e}}(),Ea:f.Tb.prototype.Ea,m:function(){var a= |
541 | +this.e.runtimeStyle;this.parent.gb(this.ua);a.borderColor=a.borderStyle=a.borderWidth=""}});f.kb=function(){function a(l,q){l.className+=" "+q}function b(l){var q=v.slice.call(arguments,1),s=q.length;setTimeout(function(){if(l)for(;s--;)a(l,q[s])},0)}function c(l){var q=v.slice.call(arguments,1),s=q.length;setTimeout(function(){if(l)for(;s--;){var o=q[s];o=t[o]||(t[o]=new RegExp("\\b"+o+"\\b","g"));l.className=l.className.replace(o,"")}},0)}function d(l){function q(){if(!U){var w,A,L=f.ja,T=l.currentStyle, |
542 | +N=T.getAttribute(g)==="true",da=T.getAttribute(i)!=="false",ea=T.getAttribute(h)!=="false";S=T.getAttribute(j);S=L>7?S!=="false":S==="true";if(!R){R=1;l.runtimeStyle.zoom=1;T=l;for(var fa=1;T=T.previousSibling;)if(T.nodeType===1){fa=0;break}fa&&a(l,p)}J.cb();if(N&&(A=J.o())&&(w=doc.documentElement||doc.body)&&(A.y>w.clientHeight||A.x>w.clientWidth||A.y+A.f<0||A.x+A.h<0)){if(!Y){Y=1;f.mb.ba(q)}}else{U=1;Y=R=0;f.mb.Ha(q);if(L===9){G={C:new f.Sb(l),q:new f.Ub(l),w:new f.Vb(l)};Q=[G.C,G.q];K=new f.Oc(l, |
543 | +J,G);w=[new f.Mc(l,J,G,K),new f.Nc(l,J,G,K)]}else{G={C:new f.Sb(l),w:new f.Vb(l),q:new f.Ub(l),G:new f.jb(l),ga:new f.Ic(l),Pb:new f.Uc(l)};Q=[G.C,G.w,G.q,G.G,G.ga,G.Pb];K=new f.Rc(l,J,G);w=[new f.Hc(l,J,G,K),new f.Fc(l,J,G,K),new f.Gc(l,J,G,K),new f.Tb(l,J,G,K)];l.tagName==="IMG"&&w.push(new f.Pc(l,J,G,K));K.ed=w}I=[K].concat(w);if(w=l.currentStyle.getAttribute(f.F+"watch-ancestors")){w=parseInt(w,10);A=0;for(N=l.parentNode;N&&(w==="NaN"||A++<w);){H(N,"onpropertychange",C);H(N,"onmouseenter",x); |
544 | +H(N,"onmouseleave",y);H(N,"onmousedown",z);if(N.tagName in f.fc){H(N,"onfocus",E);H(N,"onblur",D)}N=N.parentNode}}if(S){f.Oa.ba(o);f.Oa.Rd()}o(1)}if(!V){V=1;L<9&&H(l,"onmove",s);H(l,"onresize",s);H(l,"onpropertychange",u);ea&&H(l,"onmouseenter",x);if(ea||da)H(l,"onmouseleave",y);da&&H(l,"onmousedown",z);if(l.tagName in f.fc){H(l,"onfocus",E);H(l,"onblur",D)}f.Qa.ba(s);f.L.ba(M)}J.hb()}}function s(){J&&J.Ad()&&o()}function o(w){if(!X)if(U){var A,L=I.length;F();for(A=0;A<L;A++)I[A].Ea();if(w||J.Od())for(A= |
545 | +0;A<L;A++)I[A].ib();if(w||J.Td())for(A=0;A<L;A++)I[A].Mb();K.ab();O()}else R||q()}function u(){var w,A=I.length,L;w=event;if(!X&&!(w&&w.propertyName in r))if(U){F();for(w=0;w<A;w++)I[w].Ea();for(w=0;w<A;w++){L=I[w];L.Cb||L.ib();L.Q()&&L.Lb()}K.ab();O()}else R||q()}function x(){b(l,k)}function y(){c(l,k,n)}function z(){b(l,n);f.lb.ba(B)}function B(){c(l,n);f.lb.Ha(B)}function E(){b(l,m)}function D(){c(l,m)}function C(){var w=event.propertyName;if(w==="className"||w==="id")u()}function F(){J.cb();for(var w= |
546 | +Q.length;w--;)Q[w].cb()}function O(){for(var w=Q.length;w--;)Q[w].hb();J.hb()}function H(w,A,L){w.attachEvent(A,L);W.push([w,A,L])}function M(){if(V){for(var w=W.length,A;w--;){A=W[w];A[0].detachEvent(A[1],A[2])}f.L.Ha(M);V=0;W=[]}}function P(){if(!X){var w,A;M();X=1;if(I){w=0;for(A=I.length;w<A;w++){I[w].ec=1;I[w].m()}}S&&f.Oa.Ha(o);f.Qa.Ha(o);I=J=G=Q=l=null}}var I,K,J=new ha(l),G,Q,R,U,V,W=[],Y,X,S;this.Ed=q;this.update=o;this.m=P;this.qd=l}var e={},g=f.F+"lazy-init",j=f.F+"poll",i=f.F+"track-active", |
547 | +h=f.F+"track-hover",k=f.La+"hover",n=f.La+"active",m=f.La+"focus",p=f.La+"first-child",r={background:1,bgColor:1,display:1},t={},v=[];d.yd=function(l){var q=f.p.Ba(l);return e[q]||(e[q]=new d(l))};d.m=function(l){l=f.p.Ba(l);var q=e[l];if(q){q.m();delete e[l]}};d.md=function(){var l=[],q;if(e){for(var s in e)if(e.hasOwnProperty(s)){q=e[s];l.push(q.qd);q.m()}e={}}return l};return d}();f.supportsVML=f.zc;f.attach=function(a){f.ja<10&&f.zc&&f.kb.yd(a).Ed()};f.detach=function(a){f.kb.m(a)}}; |
548 | +var $=element;function init(){if(doc.media!=="print"){var a=window.PIE;a&&a.attach($)}}function cleanup(){if(doc.media!=="print"){var a=window.PIE;if(a){a.detach($);$=0}}}$.readyState==="complete"&&init(); |
549 | +</script> |
550 | +</PUBLIC:COMPONENT> |
551 | |
552 | === added file 'etc/PIE/PIE.js' |
553 | --- etc/PIE/PIE.js 1970-01-01 00:00:00 +0000 |
554 | +++ etc/PIE/PIE.js 2013-04-04 15:11:27 +0000 |
555 | @@ -0,0 +1,88 @@ |
556 | +/* |
557 | +PIE: CSS3 rendering for IE |
558 | +Version 1.0.0 |
559 | +http://css3pie.com |
560 | +Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2. |
561 | +*/ |
562 | +(function(){ |
563 | +var doc = document;var f=window.PIE; |
564 | +if(!f){f=window.PIE={F:"-pie-",nb:"Pie",La:"pie_",Ac:{TD:1,TH:1},cc:{TABLE:1,THEAD:1,TBODY:1,TFOOT:1,TR:1,INPUT:1,TEXTAREA:1,SELECT:1,OPTION:1,IMG:1,HR:1},fc:{A:1,INPUT:1,TEXTAREA:1,SELECT:1,BUTTON:1},Gd:{submit:1,button:1,reset:1},aa:function(){}};try{doc.execCommand("BackgroundImageCache",false,true)}catch(aa){}for(var ba=4,Z=doc.createElement("div"),ca=Z.getElementsByTagName("i"),ga;Z.innerHTML="<!--[if gt IE "+ ++ba+"]><i></i><![endif]--\>",ca[0];);f.O=ba;if(ba===6)f.F=f.F.replace(/^-/,"");f.ja= |
565 | +doc.documentMode||f.O;Z.innerHTML='<v:shape adj="1"/>';ga=Z.firstChild;ga.style.behavior="url(#default#VML)";f.zc=typeof ga.adj==="object";(function(){var a,b=0,c={};f.p={Za:function(d){if(!a){a=doc.createDocumentFragment();a.namespaces.add("css3vml","urn:schemas-microsoft-com:vml")}return a.createElement("css3vml:"+d)},Ba:function(d){return d&&d._pieId||(d._pieId="_"+ ++b)},Eb:function(d){var e,g,j,i,h=arguments;e=1;for(g=h.length;e<g;e++){i=h[e];for(j in i)if(i.hasOwnProperty(j))d[j]=i[j]}return d}, |
566 | +Rb:function(d,e,g){var j=c[d],i,h;if(j)Object.prototype.toString.call(j)==="[object Array]"?j.push([e,g]):e.call(g,j);else{h=c[d]=[[e,g]];i=new Image;i.onload=function(){j=c[d]={h:i.width,f:i.height};for(var k=0,n=h.length;k<n;k++)h[k][0].call(h[k][1],j);i.onload=null};i.src=d}}}})();f.Na={gc:function(a,b,c,d){function e(){k=j>=90&&j<270?b:0;n=j<180?c:0;m=b-k;p=c-n}function g(){for(;j<0;)j+=360;j%=360}var j=d.sa;d=d.zb;var i,h,k,n,m,p,r,t;if(d){d=d.coords(a,b,c);i=d.x;h=d.y}if(j){j=j.jd();g();e(); |
567 | +if(!d){i=k;h=n}d=f.Na.tc(i,h,j,m,p);a=d[0];d=d[1]}else if(d){a=b-i;d=c-h}else{i=h=a=0;d=c}r=a-i;t=d-h;if(j===void 0){j=!r?t<0?90:270:!t?r<0?180:0:-Math.atan2(t,r)/Math.PI*180;g();e()}return{sa:j,xc:i,yc:h,td:a,ud:d,Wd:k,Xd:n,rd:m,sd:p,kd:r,ld:t,rc:f.Na.dc(i,h,a,d)}},tc:function(a,b,c,d,e){if(c===0||c===180)return[d,b];else if(c===90||c===270)return[a,e];else{c=Math.tan(-c*Math.PI/180);a=c*a-b;b=-1/c;d=b*d-e;e=b-c;return[(d-a)/e,(c*d-b*a)/e]}},dc:function(a,b,c,d){a=c-a;b=d-b;return Math.abs(a===0? |
568 | +b:b===0?a:Math.sqrt(a*a+b*b))}};f.ea=function(){this.Gb=[];this.oc={}};f.ea.prototype={ba:function(a){var b=f.p.Ba(a),c=this.oc,d=this.Gb;if(!(b in c)){c[b]=d.length;d.push(a)}},Ha:function(a){a=f.p.Ba(a);var b=this.oc;if(a&&a in b){delete this.Gb[b[a]];delete b[a]}},xa:function(){for(var a=this.Gb,b=a.length;b--;)a[b]&&a[b]()}};f.Oa=new f.ea;f.Oa.Rd=function(){var a=this,b;if(!a.Sd){b=doc.documentElement.currentStyle.getAttribute(f.F+"poll-interval")||250;(function c(){a.xa();setTimeout(c,b)})(); |
569 | +a.Sd=1}};(function(){function a(){f.L.xa();window.detachEvent("onunload",a);window.PIE=null}f.L=new f.ea;window.attachEvent("onunload",a);f.L.ta=function(b,c,d){b.attachEvent(c,d);this.ba(function(){b.detachEvent(c,d)})}})();f.Qa=new f.ea;f.L.ta(window,"onresize",function(){f.Qa.xa()});(function(){function a(){f.mb.xa()}f.mb=new f.ea;f.L.ta(window,"onscroll",a);f.Qa.ba(a)})();(function(){function a(){c=f.kb.md()}function b(){if(c){for(var d=0,e=c.length;d<e;d++)f.attach(c[d]);c=0}}var c;if(f.ja<9){f.L.ta(window, |
570 | +"onbeforeprint",a);f.L.ta(window,"onafterprint",b)}})();f.lb=new f.ea;f.L.ta(doc,"onmouseup",function(){f.lb.xa()});f.he=function(){function a(h){this.Y=h}var b=doc.createElement("length-calc"),c=doc.body||doc.documentElement,d=b.style,e={},g=["mm","cm","in","pt","pc"],j=g.length,i={};d.position="absolute";d.top=d.left="-9999px";for(c.appendChild(b);j--;){d.width="100"+g[j];e[g[j]]=b.offsetWidth/100}c.removeChild(b);d.width="1em";a.prototype={Kb:/(px|em|ex|mm|cm|in|pt|pc|%)$/,ic:function(){var h= |
571 | +this.Jd;if(h===void 0)h=this.Jd=parseFloat(this.Y);return h},yb:function(){var h=this.ae;if(!h)h=this.ae=(h=this.Y.match(this.Kb))&&h[0]||"px";return h},a:function(h,k){var n=this.ic(),m=this.yb();switch(m){case "px":return n;case "%":return n*(typeof k==="function"?k():k)/100;case "em":return n*this.xb(h);case "ex":return n*this.xb(h)/2;default:return n*e[m]}},xb:function(h){var k=h.currentStyle.fontSize,n,m;if(k.indexOf("px")>0)return parseFloat(k);else if(h.tagName in f.cc){m=this;n=h.parentNode; |
572 | +return f.n(k).a(n,function(){return m.xb(n)})}else{h.appendChild(b);k=b.offsetWidth;b.parentNode===h&&h.removeChild(b);return k}}};f.n=function(h){return i[h]||(i[h]=new a(h))};return a}();f.Ja=function(){function a(e){this.X=e}var b=f.n("50%"),c={top:1,center:1,bottom:1},d={left:1,center:1,right:1};a.prototype={zd:function(){if(!this.ac){var e=this.X,g=e.length,j=f.v,i=j.qa,h=f.n("0");i=i.na;h=["left",h,"top",h];if(g===1){e.push(new j.ob(i,"center"));g++}if(g===2){i&(e[0].k|e[1].k)&&e[0].d in c&& |
573 | +e[1].d in d&&e.push(e.shift());if(e[0].k&i)if(e[0].d==="center")h[1]=b;else h[0]=e[0].d;else if(e[0].W())h[1]=f.n(e[0].d);if(e[1].k&i)if(e[1].d==="center")h[3]=b;else h[2]=e[1].d;else if(e[1].W())h[3]=f.n(e[1].d)}this.ac=h}return this.ac},coords:function(e,g,j){var i=this.zd(),h=i[1].a(e,g);e=i[3].a(e,j);return{x:i[0]==="right"?g-h:h,y:i[2]==="bottom"?j-e:e}}};return a}();f.Ka=function(){function a(b,c){this.h=b;this.f=c}a.prototype={a:function(b,c,d,e,g){var j=this.h,i=this.f,h=c/d;e=e/g;if(j=== |
574 | +"contain"){j=e>h?c:d*e;i=e>h?c/e:d}else if(j==="cover"){j=e<h?c:d*e;i=e<h?c/e:d}else if(j==="auto"){i=i==="auto"?g:i.a(b,d);j=i*e}else{j=j.a(b,c);i=i==="auto"?j/e:i.a(b,d)}return{h:j,f:i}}};a.Kc=new a("auto","auto");return a}();f.Ec=function(){function a(b){this.Y=b}a.prototype={Kb:/[a-z]+$/i,yb:function(){return this.ad||(this.ad=this.Y.match(this.Kb)[0].toLowerCase())},jd:function(){var b=this.Vc,c;if(b===undefined){b=this.yb();c=parseFloat(this.Y,10);b=this.Vc=b==="deg"?c:b==="rad"?c/Math.PI*180: |
575 | +b==="grad"?c/400*360:b==="turn"?c*360:0}return b}};return a}();f.Jc=function(){function a(c){this.Y=c}var b={};a.Qd=/\s*rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d+|\d*\.\d+)\s*\)\s*/;a.Fb={aliceblue:"F0F8FF",antiquewhite:"FAEBD7",aqua:"0FF",aquamarine:"7FFFD4",azure:"F0FFFF",beige:"F5F5DC",bisque:"FFE4C4",black:"000",blanchedalmond:"FFEBCD",blue:"00F",blueviolet:"8A2BE2",brown:"A52A2A",burlywood:"DEB887",cadetblue:"5F9EA0",chartreuse:"7FFF00",chocolate:"D2691E",coral:"FF7F50",cornflowerblue:"6495ED", |
576 | +cornsilk:"FFF8DC",crimson:"DC143C",cyan:"0FF",darkblue:"00008B",darkcyan:"008B8B",darkgoldenrod:"B8860B",darkgray:"A9A9A9",darkgreen:"006400",darkkhaki:"BDB76B",darkmagenta:"8B008B",darkolivegreen:"556B2F",darkorange:"FF8C00",darkorchid:"9932CC",darkred:"8B0000",darksalmon:"E9967A",darkseagreen:"8FBC8F",darkslateblue:"483D8B",darkslategray:"2F4F4F",darkturquoise:"00CED1",darkviolet:"9400D3",deeppink:"FF1493",deepskyblue:"00BFFF",dimgray:"696969",dodgerblue:"1E90FF",firebrick:"B22222",floralwhite:"FFFAF0", |
577 | +forestgreen:"228B22",fuchsia:"F0F",gainsboro:"DCDCDC",ghostwhite:"F8F8FF",gold:"FFD700",goldenrod:"DAA520",gray:"808080",green:"008000",greenyellow:"ADFF2F",honeydew:"F0FFF0",hotpink:"FF69B4",indianred:"CD5C5C",indigo:"4B0082",ivory:"FFFFF0",khaki:"F0E68C",lavender:"E6E6FA",lavenderblush:"FFF0F5",lawngreen:"7CFC00",lemonchiffon:"FFFACD",lightblue:"ADD8E6",lightcoral:"F08080",lightcyan:"E0FFFF",lightgoldenrodyellow:"FAFAD2",lightgreen:"90EE90",lightgrey:"D3D3D3",lightpink:"FFB6C1",lightsalmon:"FFA07A", |
578 | +lightseagreen:"20B2AA",lightskyblue:"87CEFA",lightslategray:"789",lightsteelblue:"B0C4DE",lightyellow:"FFFFE0",lime:"0F0",limegreen:"32CD32",linen:"FAF0E6",magenta:"F0F",maroon:"800000",mediumauqamarine:"66CDAA",mediumblue:"0000CD",mediumorchid:"BA55D3",mediumpurple:"9370D8",mediumseagreen:"3CB371",mediumslateblue:"7B68EE",mediumspringgreen:"00FA9A",mediumturquoise:"48D1CC",mediumvioletred:"C71585",midnightblue:"191970",mintcream:"F5FFFA",mistyrose:"FFE4E1",moccasin:"FFE4B5",navajowhite:"FFDEAD", |
579 | +navy:"000080",oldlace:"FDF5E6",olive:"808000",olivedrab:"688E23",orange:"FFA500",orangered:"FF4500",orchid:"DA70D6",palegoldenrod:"EEE8AA",palegreen:"98FB98",paleturquoise:"AFEEEE",palevioletred:"D87093",papayawhip:"FFEFD5",peachpuff:"FFDAB9",peru:"CD853F",pink:"FFC0CB",plum:"DDA0DD",powderblue:"B0E0E6",purple:"800080",red:"F00",rosybrown:"BC8F8F",royalblue:"4169E1",saddlebrown:"8B4513",salmon:"FA8072",sandybrown:"F4A460",seagreen:"2E8B57",seashell:"FFF5EE",sienna:"A0522D",silver:"C0C0C0",skyblue:"87CEEB", |
580 | +slateblue:"6A5ACD",slategray:"708090",snow:"FFFAFA",springgreen:"00FF7F",steelblue:"4682B4",tan:"D2B48C",teal:"008080",thistle:"D8BFD8",tomato:"FF6347",turquoise:"40E0D0",violet:"EE82EE",wheat:"F5DEB3",white:"FFF",whitesmoke:"F5F5F5",yellow:"FF0",yellowgreen:"9ACD32"};a.prototype={parse:function(){if(!this.Ua){var c=this.Y,d;if(d=c.match(a.Qd)){this.Ua="rgb("+d[1]+","+d[2]+","+d[3]+")";this.Yb=parseFloat(d[4])}else{if((d=c.toLowerCase())in a.Fb)c="#"+a.Fb[d];this.Ua=c;this.Yb=c==="transparent"?0: |
581 | +1}}},U:function(c){this.parse();return this.Ua==="currentColor"?c.currentStyle.color:this.Ua},fa:function(){this.parse();return this.Yb}};f.ha=function(c){return b[c]||(b[c]=new a(c))};return a}();f.v=function(){function a(c){this.$a=c;this.ch=0;this.X=[];this.Ga=0}var b=a.qa={Ia:1,Wb:2,z:4,Lc:8,Xb:16,na:32,K:64,oa:128,pa:256,Ra:512,Tc:1024,URL:2048};a.ob=function(c,d){this.k=c;this.d=d};a.ob.prototype={Ca:function(){return this.k&b.K||this.k&b.oa&&this.d==="0"},W:function(){return this.Ca()||this.k& |
582 | +b.Ra}};a.prototype={de:/\s/,Kd:/^[\+\-]?(\d*\.)?\d+/,url:/^url\(\s*("([^"]*)"|'([^']*)'|([!#$%&*-~]*))\s*\)/i,nc:/^\-?[_a-z][\w-]*/i,Yd:/^("([^"]*)"|'([^']*)')/,Bd:/^#([\da-f]{6}|[\da-f]{3})/i,be:{px:b.K,em:b.K,ex:b.K,mm:b.K,cm:b.K,"in":b.K,pt:b.K,pc:b.K,deg:b.Ia,rad:b.Ia,grad:b.Ia},fd:{rgb:1,rgba:1,hsl:1,hsla:1},next:function(c){function d(p,r){p=new a.ob(p,r);if(!c){k.X.push(p);k.Ga++}return p}function e(){k.Ga++;return null}var g,j,i,h,k=this;if(this.Ga<this.X.length)return this.X[this.Ga++];for(;this.de.test(this.$a.charAt(this.ch));)this.ch++; |
583 | +if(this.ch>=this.$a.length)return e();j=this.ch;g=this.$a.substring(this.ch);i=g.charAt(0);switch(i){case "#":if(h=g.match(this.Bd)){this.ch+=h[0].length;return d(b.z,h[0])}break;case '"':case "'":if(h=g.match(this.Yd)){this.ch+=h[0].length;return d(b.Tc,h[2]||h[3]||"")}break;case "/":case ",":this.ch++;return d(b.pa,i);case "u":if(h=g.match(this.url)){this.ch+=h[0].length;return d(b.URL,h[2]||h[3]||h[4]||"")}}if(h=g.match(this.Kd)){i=h[0];this.ch+=i.length;if(g.charAt(i.length)==="%"){this.ch++; |
584 | +return d(b.Ra,i+"%")}if(h=g.substring(i.length).match(this.nc)){i+=h[0];this.ch+=h[0].length;return d(this.be[h[0].toLowerCase()]||b.Lc,i)}return d(b.oa,i)}if(h=g.match(this.nc)){i=h[0];this.ch+=i.length;if(i.toLowerCase()in f.Jc.Fb||i==="currentColor"||i==="transparent")return d(b.z,i);if(g.charAt(i.length)==="("){this.ch++;if(i.toLowerCase()in this.fd){g=function(p){return p&&p.k&b.oa};h=function(p){return p&&p.k&(b.oa|b.Ra)};var n=function(p,r){return p&&p.d===r},m=function(){return k.next(1)}; |
585 | +if((i.charAt(0)==="r"?h(m()):g(m()))&&n(m(),",")&&h(m())&&n(m(),",")&&h(m())&&(i==="rgb"||i==="hsa"||n(m(),",")&&g(m()))&&n(m(),")"))return d(b.z,this.$a.substring(j,this.ch));return e()}return d(b.Xb,i)}return d(b.na,i)}this.ch++;return d(b.Wb,i)},D:function(){return this.X[this.Ga-- -2]},all:function(){for(;this.next(););return this.X},ma:function(c,d){for(var e=[],g,j;g=this.next();){if(c(g)){j=true;this.D();break}e.push(g)}return d&&!j?null:e}};return a}();var ha=function(a){this.e=a};ha.prototype= |
586 | +{Z:0,Od:function(){var a=this.qb,b;return!a||(b=this.o())&&(a.x!==b.x||a.y!==b.y)},Td:function(){var a=this.qb,b;return!a||(b=this.o())&&(a.h!==b.h||a.f!==b.f)},hc:function(){var a=this.e,b=a.getBoundingClientRect(),c=f.ja===9,d=f.O===7,e=b.right-b.left;return{x:b.left,y:b.top,h:c||d?a.offsetWidth:e,f:c||d?a.offsetHeight:b.bottom-b.top,Hd:d&&e?a.offsetWidth/e:1}},o:function(){return this.Z?this.Va||(this.Va=this.hc()):this.hc()},Ad:function(){return!!this.qb},cb:function(){++this.Z},hb:function(){if(!--this.Z){if(this.Va)this.qb= |
587 | +this.Va;this.Va=null}}};(function(){function a(b){var c=f.p.Ba(b);return function(){if(this.Z){var d=this.$b||(this.$b={});return c in d?d[c]:(d[c]=b.call(this))}else return b.call(this)}}f.B={Z:0,ka:function(b){function c(d){this.e=d;this.Zb=this.ia()}f.p.Eb(c.prototype,f.B,b);c.$c={};return c},j:function(){var b=this.ia(),c=this.constructor.$c;return b?b in c?c[b]:(c[b]=this.la(b)):null},ia:a(function(){var b=this.e,c=this.constructor,d=b.style;b=b.currentStyle;var e=this.wa,g=this.Fa,j=c.Yc||(c.Yc= |
588 | +f.F+e);c=c.Zc||(c.Zc=f.nb+g.charAt(0).toUpperCase()+g.substring(1));return d[c]||b.getAttribute(j)||d[g]||b.getAttribute(e)}),i:a(function(){return!!this.j()}),H:a(function(){var b=this.ia(),c=b!==this.Zb;this.Zb=b;return c}),va:a,cb:function(){++this.Z},hb:function(){--this.Z||delete this.$b}}})();f.Sb=f.B.ka({wa:f.F+"background",Fa:f.nb+"Background",cd:{scroll:1,fixed:1,local:1},fb:{"repeat-x":1,"repeat-y":1,repeat:1,"no-repeat":1},sc:{"padding-box":1,"border-box":1,"content-box":1},Pd:{top:1,right:1, |
589 | +bottom:1,left:1,center:1},Ud:{contain:1,cover:1},eb:{Ma:"backgroundClip",z:"backgroundColor",da:"backgroundImage",Pa:"backgroundOrigin",S:"backgroundPosition",T:"backgroundRepeat",Sa:"backgroundSize"},la:function(a){function b(s){return s&&s.W()||s.k&k&&s.d in t}function c(s){return s&&(s.W()&&f.n(s.d)||s.d==="auto"&&"auto")}var d=this.e.currentStyle,e,g,j,i=f.v.qa,h=i.pa,k=i.na,n=i.z,m,p,r=0,t=this.Pd,v,l,q={M:[]};if(this.wb()){e=new f.v(a);for(j={};g=e.next();){m=g.k;p=g.d;if(!j.P&&m&i.Xb&&p=== |
590 | +"linear-gradient"){v={ca:[],P:p};for(l={};g=e.next();){m=g.k;p=g.d;if(m&i.Wb&&p===")"){l.color&&v.ca.push(l);v.ca.length>1&&f.p.Eb(j,v);break}if(m&n){if(v.sa||v.zb){g=e.D();if(g.k!==h)break;e.next()}l={color:f.ha(p)};g=e.next();if(g.W())l.db=f.n(g.d);else e.D()}else if(m&i.Ia&&!v.sa&&!l.color&&!v.ca.length)v.sa=new f.Ec(g.d);else if(b(g)&&!v.zb&&!l.color&&!v.ca.length){e.D();v.zb=new f.Ja(e.ma(function(s){return!b(s)},false))}else if(m&h&&p===","){if(l.color){v.ca.push(l);l={}}}else break}}else if(!j.P&& |
591 | +m&i.URL){j.Ab=p;j.P="image"}else if(b(g)&&!j.$){e.D();j.$=new f.Ja(e.ma(function(s){return!b(s)},false))}else if(m&k)if(p in this.fb&&!j.bb)j.bb=p;else if(p in this.sc&&!j.Wa){j.Wa=p;if((g=e.next())&&g.k&k&&g.d in this.sc)j.ub=g.d;else{j.ub=p;e.D()}}else if(p in this.cd&&!j.bc)j.bc=p;else return null;else if(m&n&&!q.color)q.color=f.ha(p);else if(m&h&&p==="/"&&!j.Xa&&j.$){g=e.next();if(g.k&k&&g.d in this.Ud)j.Xa=new f.Ka(g.d);else if(g=c(g)){m=c(e.next());if(!m){m=g;e.D()}j.Xa=new f.Ka(g,m)}else return null}else if(m& |
592 | +h&&p===","&&j.P){j.Hb=a.substring(r,e.ch-1);r=e.ch;q.M.push(j);j={}}else return null}if(j.P){j.Hb=a.substring(r);q.M.push(j)}}else this.Bc(f.ja<9?function(){var s=this.eb,o=d[s.S+"X"],u=d[s.S+"Y"],x=d[s.da],y=d[s.z];if(y!=="transparent")q.color=f.ha(y);if(x!=="none")q.M=[{P:"image",Ab:(new f.v(x)).next().d,bb:d[s.T],$:new f.Ja((new f.v(o+" "+u)).all())}]}:function(){var s=this.eb,o=/\s*,\s*/,u=d[s.da].split(o),x=d[s.z],y,z,B,E,D,C;if(x!=="transparent")q.color=f.ha(x);if((E=u.length)&&u[0]!=="none"){x= |
593 | +d[s.T].split(o);y=d[s.S].split(o);z=d[s.Pa].split(o);B=d[s.Ma].split(o);s=d[s.Sa].split(o);q.M=[];for(o=0;o<E;o++)if((D=u[o])&&D!=="none"){C=s[o].split(" ");q.M.push({Hb:D+" "+x[o]+" "+y[o]+" / "+s[o]+" "+z[o]+" "+B[o],P:"image",Ab:(new f.v(D)).next().d,bb:x[o],$:new f.Ja((new f.v(y[o])).all()),Wa:z[o],ub:B[o],Xa:new f.Ka(C[0],C[1])})}}});return q.color||q.M[0]?q:null},Bc:function(a){var b=f.ja>8,c=this.eb,d=this.e.runtimeStyle,e=d[c.da],g=d[c.z],j=d[c.T],i,h,k,n;if(e)d[c.da]="";if(g)d[c.z]="";if(j)d[c.T]= |
594 | +"";if(b){i=d[c.Ma];h=d[c.Pa];n=d[c.S];k=d[c.Sa];if(i)d[c.Ma]="";if(h)d[c.Pa]="";if(n)d[c.S]="";if(k)d[c.Sa]=""}a=a.call(this);if(e)d[c.da]=e;if(g)d[c.z]=g;if(j)d[c.T]=j;if(b){if(i)d[c.Ma]=i;if(h)d[c.Pa]=h;if(n)d[c.S]=n;if(k)d[c.Sa]=k}return a},ia:f.B.va(function(){return this.wb()||this.Bc(function(){var a=this.e.currentStyle,b=this.eb;return a[b.z]+" "+a[b.da]+" "+a[b.T]+" "+a[b.S+"X"]+" "+a[b.S+"Y"]})}),wb:f.B.va(function(){var a=this.e;return a.style[this.Fa]||a.currentStyle.getAttribute(this.wa)}), |
595 | +qc:function(){var a=0;if(f.O<7){a=this.e;a=""+(a.style[f.nb+"PngFix"]||a.currentStyle.getAttribute(f.F+"png-fix"))==="true"}return a},i:f.B.va(function(){return(this.wb()||this.qc())&&!!this.j()})});f.Vb=f.B.ka({wc:["Top","Right","Bottom","Left"],Id:{thin:"1px",medium:"3px",thick:"5px"},la:function(){var a={},b={},c={},d=false,e=true,g=true,j=true;this.Cc(function(){for(var i=this.e.currentStyle,h=0,k,n,m,p,r,t,v;h<4;h++){m=this.wc[h];v=m.charAt(0).toLowerCase();k=b[v]=i["border"+m+"Style"];n=i["border"+ |
596 | +m+"Color"];m=i["border"+m+"Width"];if(h>0){if(k!==p)g=false;if(n!==r)e=false;if(m!==t)j=false}p=k;r=n;t=m;c[v]=f.ha(n);m=a[v]=f.n(b[v]==="none"?"0":this.Id[m]||m);if(m.a(this.e)>0)d=true}});return d?{J:a,Zd:b,gd:c,ee:j,hd:e,$d:g}:null},ia:f.B.va(function(){var a=this.e,b=a.currentStyle,c;a.tagName in f.Ac&&a.offsetParent.currentStyle.borderCollapse==="collapse"||this.Cc(function(){c=b.borderWidth+"|"+b.borderStyle+"|"+b.borderColor});return c}),Cc:function(a){var b=this.e.runtimeStyle,c=b.borderWidth, |
597 | +d=b.borderColor;if(c)b.borderWidth="";if(d)b.borderColor="";a=a.call(this);if(c)b.borderWidth=c;if(d)b.borderColor=d;return a}});(function(){f.jb=f.B.ka({wa:"border-radius",Fa:"borderRadius",la:function(b){var c=null,d,e,g,j,i=false;if(b){e=new f.v(b);var h=function(){for(var k=[],n;(g=e.next())&&g.W();){j=f.n(g.d);n=j.ic();if(n<0)return null;if(n>0)i=true;k.push(j)}return k.length>0&&k.length<5?{tl:k[0],tr:k[1]||k[0],br:k[2]||k[0],bl:k[3]||k[1]||k[0]}:null};if(b=h()){if(g){if(g.k&f.v.qa.pa&&g.d=== |
598 | +"/")d=h()}else d=b;if(i&&b&&d)c={x:b,y:d}}}return c}});var a=f.n("0");a={tl:a,tr:a,br:a,bl:a};f.jb.Dc={x:a,y:a}})();f.Ub=f.B.ka({wa:"border-image",Fa:"borderImage",fb:{stretch:1,round:1,repeat:1,space:1},la:function(a){var b=null,c,d,e,g,j,i,h=0,k=f.v.qa,n=k.na,m=k.oa,p=k.Ra;if(a){c=new f.v(a);b={};for(var r=function(l){return l&&l.k&k.pa&&l.d==="/"},t=function(l){return l&&l.k&n&&l.d==="fill"},v=function(){g=c.ma(function(l){return!(l.k&(m|p))});if(t(c.next())&&!b.fill)b.fill=true;else c.D();if(r(c.next())){h++; |
599 | +j=c.ma(function(l){return!l.W()&&!(l.k&n&&l.d==="auto")});if(r(c.next())){h++;i=c.ma(function(l){return!l.Ca()})}}else c.D()};a=c.next();){d=a.k;e=a.d;if(d&(m|p)&&!g){c.D();v()}else if(t(a)&&!b.fill){b.fill=true;v()}else if(d&n&&this.fb[e]&&!b.repeat){b.repeat={f:e};if(a=c.next())if(a.k&n&&this.fb[a.d])b.repeat.Ob=a.d;else c.D()}else if(d&k.URL&&!b.src)b.src=e;else return null}if(!b.src||!g||g.length<1||g.length>4||j&&j.length>4||h===1&&j.length<1||i&&i.length>4||h===2&&i.length<1)return null;if(!b.repeat)b.repeat= |
600 | +{f:"stretch"};if(!b.repeat.Ob)b.repeat.Ob=b.repeat.f;a=function(l,q){return{t:q(l[0]),r:q(l[1]||l[0]),b:q(l[2]||l[0]),l:q(l[3]||l[1]||l[0])}};b.slice=a(g,function(l){return f.n(l.k&m?l.d+"px":l.d)});if(j&&j[0])b.J=a(j,function(l){return l.W()?f.n(l.d):l.d});if(i&&i[0])b.Da=a(i,function(l){return l.Ca()?f.n(l.d):l.d})}return b}});f.Ic=f.B.ka({wa:"box-shadow",Fa:"boxShadow",la:function(a){var b,c=f.n,d=f.v.qa,e;if(a){e=new f.v(a);b={Da:[],Bb:[]};for(a=function(){for(var g,j,i,h,k,n;g=e.next();){i=g.d; |
601 | +j=g.k;if(j&d.pa&&i===",")break;else if(g.Ca()&&!k){e.D();k=e.ma(function(m){return!m.Ca()})}else if(j&d.z&&!h)h=i;else if(j&d.na&&i==="inset"&&!n)n=true;else return false}g=k&&k.length;if(g>1&&g<5){(n?b.Bb:b.Da).push({fe:c(k[0].d),ge:c(k[1].d),blur:c(k[2]?k[2].d:"0"),Vd:c(k[3]?k[3].d:"0"),color:f.ha(h||"currentColor")});return true}return false};a(););}return b&&(b.Bb.length||b.Da.length)?b:null}});f.Uc=f.B.ka({ia:f.B.va(function(){var a=this.e.currentStyle;return a.visibility+"|"+a.display}),la:function(){var a= |
602 | +this.e,b=a.runtimeStyle;a=a.currentStyle;var c=b.visibility,d;b.visibility="";d=a.visibility;b.visibility=c;return{ce:d!=="hidden",nd:a.display!=="none"}},i:function(){return false}});f.u={R:function(a){function b(c,d,e,g){this.e=c;this.s=d;this.g=e;this.parent=g}f.p.Eb(b.prototype,f.u,a);return b},Cb:false,Q:function(){return false},Ea:f.aa,Lb:function(){this.m();this.i()&&this.V()},ib:function(){this.Cb=true},Mb:function(){this.i()?this.V():this.m()},sb:function(a,b){this.vc(a);for(var c=this.ra|| |
603 | +(this.ra=[]),d=a+1,e=c.length,g;d<e;d++)if(g=c[d])break;c[a]=b;this.I().insertBefore(b,g||null)},za:function(a){var b=this.ra;return b&&b[a]||null},vc:function(a){var b=this.za(a),c=this.Ta;if(b&&c){c.removeChild(b);this.ra[a]=null}},Aa:function(a,b,c,d){var e=this.rb||(this.rb={}),g=e[a];if(!g){g=e[a]=f.p.Za("shape");if(b)g.appendChild(g[b]=f.p.Za(b));if(d){c=this.za(d);if(!c){this.sb(d,doc.createElement("group"+d));c=this.za(d)}}c.appendChild(g);a=g.style;a.position="absolute";a.left=a.top=0;a.behavior= |
604 | +"url(#default#VML)"}return g},vb:function(a){var b=this.rb,c=b&&b[a];if(c){c.parentNode.removeChild(c);delete b[a]}return!!c},kc:function(a){var b=this.e,c=this.s.o(),d=c.h,e=c.f,g,j,i,h,k,n;c=a.x.tl.a(b,d);g=a.y.tl.a(b,e);j=a.x.tr.a(b,d);i=a.y.tr.a(b,e);h=a.x.br.a(b,d);k=a.y.br.a(b,e);n=a.x.bl.a(b,d);a=a.y.bl.a(b,e);d=Math.min(d/(c+j),e/(i+k),d/(n+h),e/(g+a));if(d<1){c*=d;g*=d;j*=d;i*=d;h*=d;k*=d;n*=d;a*=d}return{x:{tl:c,tr:j,br:h,bl:n},y:{tl:g,tr:i,br:k,bl:a}}},ya:function(a,b,c){b=b||1;var d,e, |
605 | +g=this.s.o();e=g.h*b;g=g.f*b;var j=this.g.G,i=Math.floor,h=Math.ceil,k=a?a.Jb*b:0,n=a?a.Ib*b:0,m=a?a.tb*b:0;a=a?a.Db*b:0;var p,r,t,v,l;if(c||j.i()){d=this.kc(c||j.j());c=d.x.tl*b;j=d.y.tl*b;p=d.x.tr*b;r=d.y.tr*b;t=d.x.br*b;v=d.y.br*b;l=d.x.bl*b;b=d.y.bl*b;e="m"+i(a)+","+i(j)+"qy"+i(c)+","+i(k)+"l"+h(e-p)+","+i(k)+"qx"+h(e-n)+","+i(r)+"l"+h(e-n)+","+h(g-v)+"qy"+h(e-t)+","+h(g-m)+"l"+i(l)+","+h(g-m)+"qx"+i(a)+","+h(g-b)+" x e"}else e="m"+i(a)+","+i(k)+"l"+h(e-n)+","+i(k)+"l"+h(e-n)+","+h(g-m)+"l"+i(a)+ |
606 | +","+h(g-m)+"xe";return e},I:function(){var a=this.parent.za(this.N),b;if(!a){a=doc.createElement(this.Ya);b=a.style;b.position="absolute";b.top=b.left=0;this.parent.sb(this.N,a)}return a},mc:function(){var a=this.e,b=a.currentStyle,c=a.runtimeStyle,d=a.tagName,e=f.O===6,g;if(e&&(d in f.cc||d==="FIELDSET")||d==="BUTTON"||d==="INPUT"&&a.type in f.Gd){c.borderWidth="";d=this.g.w.wc;for(g=d.length;g--;){e=d[g];c["padding"+e]="";c["padding"+e]=f.n(b["padding"+e]).a(a)+f.n(b["border"+e+"Width"]).a(a)+(f.O!== |
607 | +8&&g%2?1:0)}c.borderWidth=0}else if(e){if(a.childNodes.length!==1||a.firstChild.tagName!=="ie6-mask"){b=doc.createElement("ie6-mask");d=b.style;d.visibility="visible";for(d.zoom=1;d=a.firstChild;)b.appendChild(d);a.appendChild(b);c.visibility="hidden"}}else c.borderColor="transparent"},ie:function(){},m:function(){this.parent.vc(this.N);delete this.rb;delete this.ra}};f.Rc=f.u.R({i:function(){var a=this.ed;for(var b in a)if(a.hasOwnProperty(b)&&a[b].i())return true;return false},Q:function(){return this.g.Pb.H()}, |
608 | +ib:function(){if(this.i()){var a=this.jc(),b=a,c;a=a.currentStyle;var d=a.position,e=this.I().style,g=0,j=0;j=this.s.o();var i=j.Hd;if(d==="fixed"&&f.O>6){g=j.x*i;j=j.y*i;b=d}else{do b=b.offsetParent;while(b&&b.currentStyle.position==="static");if(b){c=b.getBoundingClientRect();b=b.currentStyle;g=(j.x-c.left)*i-(parseFloat(b.borderLeftWidth)||0);j=(j.y-c.top)*i-(parseFloat(b.borderTopWidth)||0)}else{b=doc.documentElement;g=(j.x+b.scrollLeft-b.clientLeft)*i;j=(j.y+b.scrollTop-b.clientTop)*i}b="absolute"}e.position= |
609 | +b;e.left=g;e.top=j;e.zIndex=d==="static"?-1:a.zIndex;this.Cb=true}},Mb:f.aa,Nb:function(){var a=this.g.Pb.j();this.I().style.display=a.ce&&a.nd?"":"none"},Lb:function(){this.i()?this.Nb():this.m()},jc:function(){var a=this.e;return a.tagName in f.Ac?a.offsetParent:a},I:function(){var a=this.Ta,b;if(!a){b=this.jc();a=this.Ta=doc.createElement("css3-container");a.style.direction="ltr";this.Nb();b.parentNode.insertBefore(a,b)}return a},ab:f.aa,m:function(){var a=this.Ta,b;if(a&&(b=a.parentNode))b.removeChild(a); |
610 | +delete this.Ta;delete this.ra}});f.Fc=f.u.R({N:2,Ya:"background",Q:function(){var a=this.g;return a.C.H()||a.G.H()},i:function(){var a=this.g;return a.q.i()||a.G.i()||a.C.i()||a.ga.i()&&a.ga.j().Bb},V:function(){var a=this.s.o();if(a.h&&a.f){this.od();this.pd()}},od:function(){var a=this.g.C.j(),b=this.s.o(),c=this.e,d=a&&a.color,e,g;if(d&&d.fa()>0){this.lc();a=this.Aa("bgColor","fill",this.I(),1);e=b.h;b=b.f;a.stroked=false;a.coordsize=e*2+","+b*2;a.coordorigin="1,1";a.path=this.ya(null,2);g=a.style; |
611 | +g.width=e;g.height=b;a.fill.color=d.U(c);c=d.fa();if(c<1)a.fill.opacity=c}else this.vb("bgColor")},pd:function(){var a=this.g.C.j(),b=this.s.o();a=a&&a.M;var c,d,e,g,j;if(a){this.lc();d=b.h;e=b.f;for(j=a.length;j--;){b=a[j];c=this.Aa("bgImage"+j,"fill",this.I(),2);c.stroked=false;c.fill.type="tile";c.fillcolor="none";c.coordsize=d*2+","+e*2;c.coordorigin="1,1";c.path=this.ya(0,2);g=c.style;g.width=d;g.height=e;if(b.P==="linear-gradient")this.bd(c,b);else{c.fill.src=b.Ab;this.Nd(c,j)}}}for(j=a?a.length: |
612 | +0;this.vb("bgImage"+j++););},Nd:function(a,b){var c=this;f.p.Rb(a.fill.src,function(d){var e=c.e,g=c.s.o(),j=g.h;g=g.f;if(j&&g){var i=a.fill,h=c.g,k=h.w.j(),n=k&&k.J;k=n?n.t.a(e):0;var m=n?n.r.a(e):0,p=n?n.b.a(e):0;n=n?n.l.a(e):0;h=h.C.j().M[b];e=h.$?h.$.coords(e,j-d.h-n-m,g-d.f-k-p):{x:0,y:0};h=h.bb;p=m=0;var r=j+1,t=g+1,v=f.O===8?0:1;n=Math.round(e.x)+n+0.5;k=Math.round(e.y)+k+0.5;i.position=n/j+","+k/g;i.size.x=1;i.size=d.h+"px,"+d.f+"px";if(h&&h!=="repeat"){if(h==="repeat-x"||h==="no-repeat"){m= |
613 | +k+1;t=k+d.f+v}if(h==="repeat-y"||h==="no-repeat"){p=n+1;r=n+d.h+v}a.style.clip="rect("+m+"px,"+r+"px,"+t+"px,"+p+"px)"}}})},bd:function(a,b){var c=this.e,d=this.s.o(),e=d.h,g=d.f;a=a.fill;d=b.ca;var j=d.length,i=Math.PI,h=f.Na,k=h.tc,n=h.dc;b=h.gc(c,e,g,b);h=b.sa;var m=b.xc,p=b.yc,r=b.Wd,t=b.Xd,v=b.rd,l=b.sd,q=b.kd,s=b.ld;b=b.rc;e=h%90?Math.atan2(q*e/g,s)/i*180:h+90;e+=180;e%=360;v=k(r,t,h,v,l);g=n(r,t,v[0],v[1]);i=[];v=k(m,p,h,r,t);n=n(m,p,v[0],v[1])/g*100;k=[];for(h=0;h<j;h++)k.push(d[h].db?d[h].db.a(c, |
614 | +b):h===0?0:h===j-1?b:null);for(h=1;h<j;h++){if(k[h]===null){m=k[h-1];b=h;do p=k[++b];while(p===null);k[h]=m+(p-m)/(b-h+1)}k[h]=Math.max(k[h],k[h-1])}for(h=0;h<j;h++)i.push(n+k[h]/g*100+"% "+d[h].color.U(c));a.angle=e;a.type="gradient";a.method="sigma";a.color=d[0].color.U(c);a.color2=d[j-1].color.U(c);if(a.colors)a.colors.value=i.join(",");else a.colors=i.join(",")},lc:function(){var a=this.e.runtimeStyle;a.backgroundImage="url(about:blank)";a.backgroundColor="transparent"},m:function(){f.u.m.call(this); |
615 | +var a=this.e.runtimeStyle;a.backgroundImage=a.backgroundColor=""}});f.Gc=f.u.R({N:4,Ya:"border",Q:function(){var a=this.g;return a.w.H()||a.G.H()},i:function(){var a=this.g;return a.G.i()&&!a.q.i()&&a.w.i()},V:function(){var a=this.e,b=this.g.w.j(),c=this.s.o(),d=c.h;c=c.f;var e,g,j,i,h;if(b){this.mc();b=this.wd(2);i=0;for(h=b.length;i<h;i++){j=b[i];e=this.Aa("borderPiece"+i,j.stroke?"stroke":"fill",this.I());e.coordsize=d*2+","+c*2;e.coordorigin="1,1";e.path=j.path;g=e.style;g.width=d;g.height=c; |
616 | +e.filled=!!j.fill;e.stroked=!!j.stroke;if(j.stroke){e=e.stroke;e.weight=j.Qb+"px";e.color=j.color.U(a);e.dashstyle=j.stroke==="dashed"?"2 2":j.stroke==="dotted"?"1 1":"solid";e.linestyle=j.stroke==="double"&&j.Qb>2?"ThinThin":"Single"}else e.fill.color=j.fill.U(a)}for(;this.vb("borderPiece"+i++););}},wd:function(a){var b=this.e,c,d,e,g=this.g.w,j=[],i,h,k,n,m=Math.round,p,r,t;if(g.i()){c=g.j();g=c.J;r=c.Zd;t=c.gd;if(c.ee&&c.$d&&c.hd){if(t.t.fa()>0){c=g.t.a(b);k=c/2;j.push({path:this.ya({Jb:k,Ib:k, |
617 | +tb:k,Db:k},a),stroke:r.t,color:t.t,Qb:c})}}else{a=a||1;c=this.s.o();d=c.h;e=c.f;c=m(g.t.a(b));k=m(g.r.a(b));n=m(g.b.a(b));b=m(g.l.a(b));var v={t:c,r:k,b:n,l:b};b=this.g.G;if(b.i())p=this.kc(b.j());i=Math.floor;h=Math.ceil;var l=function(o,u){return p?p[o][u]:0},q=function(o,u,x,y,z,B){var E=l("x",o),D=l("y",o),C=o.charAt(1)==="r";o=o.charAt(0)==="b";return E>0&&D>0?(B?"al":"ae")+(C?h(d-E):i(E))*a+","+(o?h(e-D):i(D))*a+","+(i(E)-u)*a+","+(i(D)-x)*a+","+y*65535+","+2949075*(z?1:-1):(B?"m":"l")+(C?d- |
618 | +u:u)*a+","+(o?e-x:x)*a},s=function(o,u,x,y){var z=o==="t"?i(l("x","tl"))*a+","+h(u)*a:o==="r"?h(d-u)*a+","+i(l("y","tr"))*a:o==="b"?h(d-l("x","br"))*a+","+i(e-u)*a:i(u)*a+","+h(e-l("y","bl"))*a;o=o==="t"?h(d-l("x","tr"))*a+","+h(u)*a:o==="r"?h(d-u)*a+","+h(e-l("y","br"))*a:o==="b"?i(l("x","bl"))*a+","+i(e-u)*a:i(u)*a+","+i(l("y","tl"))*a;return x?(y?"m"+o:"")+"l"+z:(y?"m"+z:"")+"l"+o};b=function(o,u,x,y,z,B){var E=o==="l"||o==="r",D=v[o],C,F;if(D>0&&r[o]!=="none"&&t[o].fa()>0){C=v[E?o:u];u=v[E?u: |
619 | +o];F=v[E?o:x];x=v[E?x:o];if(r[o]==="dashed"||r[o]==="dotted"){j.push({path:q(y,C,u,B+45,0,1)+q(y,0,0,B,1,0),fill:t[o]});j.push({path:s(o,D/2,0,1),stroke:r[o],Qb:D,color:t[o]});j.push({path:q(z,F,x,B,0,1)+q(z,0,0,B-45,1,0),fill:t[o]})}else j.push({path:q(y,C,u,B+45,0,1)+s(o,D,0,0)+q(z,F,x,B,0,0)+(r[o]==="double"&&D>2?q(z,F-i(F/3),x-i(x/3),B-45,1,0)+s(o,h(D/3*2),1,0)+q(y,C-i(C/3),u-i(u/3),B,1,0)+"x "+q(y,i(C/3),i(u/3),B+45,0,1)+s(o,i(D/3),1,0)+q(z,i(F/3),i(x/3),B,0,0):"")+q(z,0,0,B-45,1,0)+s(o,0,1, |
620 | +0)+q(y,0,0,B,1,0),fill:t[o]})}};b("t","l","r","tl","tr",90);b("r","t","b","tr","br",0);b("b","r","l","br","bl",-90);b("l","b","t","bl","tl",-180)}}return j},m:function(){if(this.ec||!this.g.q.i())this.e.runtimeStyle.borderColor="";f.u.m.call(this)}});f.Tb=f.u.R({N:5,Md:["t","tr","r","br","b","bl","l","tl","c"],Q:function(){return this.g.q.H()},i:function(){return this.g.q.i()},V:function(){this.I();var a=this.g.q.j(),b=this.g.w.j(),c=this.s.o(),d=this.e,e=this.uc;f.p.Rb(a.src,function(g){function j(s, |
621 | +o,u,x,y){s=e[s].style;var z=Math.max;s.width=z(o,0);s.height=z(u,0);s.left=x;s.top=y}function i(s,o,u){for(var x=0,y=s.length;x<y;x++)e[s[x]].imagedata[o]=u}var h=c.h,k=c.f,n=f.n("0"),m=a.J||(b?b.J:{t:n,r:n,b:n,l:n});n=m.t.a(d);var p=m.r.a(d),r=m.b.a(d);m=m.l.a(d);var t=a.slice,v=t.t.a(d),l=t.r.a(d),q=t.b.a(d);t=t.l.a(d);j("tl",m,n,0,0);j("t",h-m-p,n,m,0);j("tr",p,n,h-p,0);j("r",p,k-n-r,h-p,n);j("br",p,r,h-p,k-r);j("b",h-m-p,r,m,k-r);j("bl",m,r,0,k-r);j("l",m,k-n-r,0,n);j("c",h-m-p,k-n-r,m,n);i(["tl", |
622 | +"t","tr"],"cropBottom",(g.f-v)/g.f);i(["tl","l","bl"],"cropRight",(g.h-t)/g.h);i(["bl","b","br"],"cropTop",(g.f-q)/g.f);i(["tr","r","br"],"cropLeft",(g.h-l)/g.h);i(["l","r","c"],"cropTop",v/g.f);i(["l","r","c"],"cropBottom",q/g.f);i(["t","b","c"],"cropLeft",t/g.h);i(["t","b","c"],"cropRight",l/g.h);e.c.style.display=a.fill?"":"none"},this)},I:function(){var a=this.parent.za(this.N),b,c,d,e=this.Md,g=e.length;if(!a){a=doc.createElement("border-image");b=a.style;b.position="absolute";this.uc={};for(d= |
623 | +0;d<g;d++){c=this.uc[e[d]]=f.p.Za("rect");c.appendChild(f.p.Za("imagedata"));b=c.style;b.behavior="url(#default#VML)";b.position="absolute";b.top=b.left=0;c.imagedata.src=this.g.q.j().src;c.stroked=false;c.filled=false;a.appendChild(c)}this.parent.sb(this.N,a)}return a},Ea:function(){if(this.i()){var a=this.e,b=a.runtimeStyle,c=this.g.q.j().J;b.borderStyle="solid";if(c){b.borderTopWidth=c.t.a(a)+"px";b.borderRightWidth=c.r.a(a)+"px";b.borderBottomWidth=c.b.a(a)+"px";b.borderLeftWidth=c.l.a(a)+"px"}this.mc()}}, |
624 | +m:function(){var a=this.e.runtimeStyle;a.borderStyle="";if(this.ec||!this.g.w.i())a.borderColor=a.borderWidth="";f.u.m.call(this)}});f.Hc=f.u.R({N:1,Ya:"outset-box-shadow",Q:function(){var a=this.g;return a.ga.H()||a.G.H()},i:function(){var a=this.g.ga;return a.i()&&a.j().Da[0]},V:function(){function a(C,F,O,H,M,P,I){C=b.Aa("shadow"+C+F,"fill",d,j-C);F=C.fill;C.coordsize=n*2+","+m*2;C.coordorigin="1,1";C.stroked=false;C.filled=true;F.color=M.U(c);if(P){F.type="gradienttitle";F.color2=F.color;F.opacity= |
625 | +0}C.path=I;l=C.style;l.left=O;l.top=H;l.width=n;l.height=m;return C}var b=this,c=this.e,d=this.I(),e=this.g,g=e.ga.j().Da;e=e.G.j();var j=g.length,i=j,h,k=this.s.o(),n=k.h,m=k.f;k=f.O===8?1:0;for(var p=["tl","tr","br","bl"],r,t,v,l,q,s,o,u,x,y,z,B,E,D;i--;){t=g[i];q=t.fe.a(c);s=t.ge.a(c);h=t.Vd.a(c);o=t.blur.a(c);t=t.color;u=-h-o;if(!e&&o)e=f.jb.Dc;u=this.ya({Jb:u,Ib:u,tb:u,Db:u},2,e);if(o){x=(h+o)*2+n;y=(h+o)*2+m;z=x?o*2/x:0;B=y?o*2/y:0;if(o-h>n/2||o-h>m/2)for(h=4;h--;){r=p[h];E=r.charAt(0)==="b"; |
626 | +D=r.charAt(1)==="r";r=a(i,r,q,s,t,o,u);v=r.fill;v.focusposition=(D?1-z:z)+","+(E?1-B:B);v.focussize="0,0";r.style.clip="rect("+((E?y/2:0)+k)+"px,"+(D?x:x/2)+"px,"+(E?y:y/2)+"px,"+((D?x/2:0)+k)+"px)"}else{r=a(i,"",q,s,t,o,u);v=r.fill;v.focusposition=z+","+B;v.focussize=1-z*2+","+(1-B*2)}}else{r=a(i,"",q,s,t,o,u);q=t.fa();if(q<1)r.fill.opacity=q}}}});f.Pc=f.u.R({N:6,Ya:"imgEl",Q:function(){var a=this.g;return this.e.src!==this.Xc||a.G.H()},i:function(){var a=this.g;return a.G.i()||a.C.qc()},V:function(){this.Xc= |
627 | +j;this.Cd();var a=this.Aa("img","fill",this.I()),b=a.fill,c=this.s.o(),d=c.h;c=c.f;var e=this.g.w.j(),g=e&&e.J;e=this.e;var j=e.src,i=Math.round,h=e.currentStyle,k=f.n;if(!g||f.O<7){g=f.n("0");g={t:g,r:g,b:g,l:g}}a.stroked=false;b.type="frame";b.src=j;b.position=(d?0.5/d:0)+","+(c?0.5/c:0);a.coordsize=d*2+","+c*2;a.coordorigin="1,1";a.path=this.ya({Jb:i(g.t.a(e)+k(h.paddingTop).a(e)),Ib:i(g.r.a(e)+k(h.paddingRight).a(e)),tb:i(g.b.a(e)+k(h.paddingBottom).a(e)),Db:i(g.l.a(e)+k(h.paddingLeft).a(e))}, |
628 | +2);a=a.style;a.width=d;a.height=c},Cd:function(){this.e.runtimeStyle.filter="alpha(opacity=0)"},m:function(){f.u.m.call(this);this.e.runtimeStyle.filter=""}});f.Oc=f.u.R({ib:f.aa,Mb:f.aa,Nb:f.aa,Lb:f.aa,Ld:/^,+|,+$/g,Fd:/,+/g,gb:function(a,b){(this.pb||(this.pb=[]))[a]=b||void 0},ab:function(){var a=this.pb,b;if(a&&(b=a.join(",").replace(this.Ld,"").replace(this.Fd,","))!==this.Wc)this.Wc=this.e.runtimeStyle.background=b},m:function(){this.e.runtimeStyle.background="";delete this.pb}});f.Mc=f.u.R({ua:1, |
629 | +Q:function(){return this.g.C.H()},i:function(){var a=this.g;return a.C.i()||a.q.i()},V:function(){var a=this.g.C.j(),b,c,d=0,e,g;if(a){b=[];if(c=a.M)for(;e=c[d++];)if(e.P==="linear-gradient"){g=this.vd(e.Wa);g=(e.Xa||f.Ka.Kc).a(this.e,g.h,g.f,g.h,g.f);b.push("url(data:image/svg+xml,"+escape(this.xd(e,g.h,g.f))+") "+this.dd(e.$)+" / "+g.h+"px "+g.f+"px "+(e.bc||"")+" "+(e.Wa||"")+" "+(e.ub||""))}else b.push(e.Hb);a.color&&b.push(a.color.Y);this.parent.gb(this.ua,b.join(","))}},dd:function(a){return a? |
630 | +a.X.map(function(b){return b.d}).join(" "):"0 0"},vd:function(a){var b=this.e,c=this.s.o(),d=c.h;c=c.f;var e;if(a!=="border-box")if((e=this.g.w.j())&&(e=e.J)){d-=e.l.a(b)+e.l.a(b);c-=e.t.a(b)+e.b.a(b)}if(a==="content-box"){a=f.n;e=b.currentStyle;d-=a(e.paddingLeft).a(b)+a(e.paddingRight).a(b);c-=a(e.paddingTop).a(b)+a(e.paddingBottom).a(b)}return{h:d,f:c}},xd:function(a,b,c){var d=this.e,e=a.ca,g=e.length,j=f.Na.gc(d,b,c,a);a=j.xc;var i=j.yc,h=j.td,k=j.ud;j=j.rc;var n,m,p,r,t;n=[];for(m=0;m<g;m++)n.push(e[m].db? |
631 | +e[m].db.a(d,j):m===0?0:m===g-1?j:null);for(m=1;m<g;m++)if(n[m]===null){r=n[m-1];p=m;do t=n[++p];while(t===null);n[m]=r+(t-r)/(p-m+1)}b=['<svg width="'+b+'" height="'+c+'" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="g" gradientUnits="userSpaceOnUse" x1="'+a/b*100+'%" y1="'+i/c*100+'%" x2="'+h/b*100+'%" y2="'+k/c*100+'%">'];for(m=0;m<g;m++)b.push('<stop offset="'+n[m]/j+'" stop-color="'+e[m].color.U(d)+'" stop-opacity="'+e[m].color.fa()+'"/>');b.push('</linearGradient></defs><rect width="100%" height="100%" fill="url(#g)"/></svg>'); |
632 | +return b.join("")},m:function(){this.parent.gb(this.ua)}});f.Nc=f.u.R({T:"repeat",Sc:"stretch",Qc:"round",ua:0,Q:function(){return this.g.q.H()},i:function(){return this.g.q.i()},V:function(){var a=this,b=a.g.q.j(),c=a.g.w.j(),d=a.s.o(),e=b.repeat,g=e.f,j=e.Ob,i=a.e,h=0;f.p.Rb(b.src,function(k){function n(Q,R,U,V,W,Y,X,S,w,A){K.push('<pattern patternUnits="userSpaceOnUse" id="pattern'+G+'" x="'+(g===l?Q+U/2-w/2:Q)+'" y="'+(j===l?R+V/2-A/2:R)+'" width="'+w+'" height="'+A+'"><svg width="'+w+'" height="'+ |
633 | +A+'" viewBox="'+W+" "+Y+" "+X+" "+S+'" preserveAspectRatio="none"><image xlink:href="'+v+'" x="0" y="0" width="'+r+'" height="'+t+'" /></svg></pattern>');J.push('<rect x="'+Q+'" y="'+R+'" width="'+U+'" height="'+V+'" fill="url(#pattern'+G+')" />');G++}var m=d.h,p=d.f,r=k.h,t=k.f,v=a.Dd(b.src,r,t),l=a.T,q=a.Sc;k=a.Qc;var s=Math.ceil,o=f.n("0"),u=b.J||(c?c.J:{t:o,r:o,b:o,l:o});o=u.t.a(i);var x=u.r.a(i),y=u.b.a(i);u=u.l.a(i);var z=b.slice,B=z.t.a(i),E=z.r.a(i),D=z.b.a(i);z=z.l.a(i);var C=m-u-x,F=p-o- |
634 | +y,O=r-z-E,H=t-B-D,M=g===q?C:O*o/B,P=j===q?F:H*x/E,I=g===q?C:O*y/D;q=j===q?F:H*u/z;var K=[],J=[],G=0;if(g===k){M-=(M-(C%M||M))/s(C/M);I-=(I-(C%I||I))/s(C/I)}if(j===k){P-=(P-(F%P||P))/s(F/P);q-=(q-(F%q||q))/s(F/q)}k=['<svg width="'+m+'" height="'+p+'" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'];n(0,0,u,o,0,0,z,B,u,o);n(u,0,C,o,z,0,O,B,M,o);n(m-x,0,x,o,r-E,0,E,B,x,o);n(0,o,u,F,0,B,z,H,u,q);if(b.fill)n(u,o,C,F,z,B,O,H,M||I||O,q||P||H);n(m-x,o,x,F,r-E,B,E,H,x,P);n(0, |
635 | +p-y,u,y,0,t-D,z,D,u,y);n(u,p-y,C,y,z,t-D,O,D,I,y);n(m-x,p-y,x,y,r-E,t-D,E,D,x,y);k.push("<defs>"+K.join("\n")+"</defs>"+J.join("\n")+"</svg>");a.parent.gb(a.ua,"url(data:image/svg+xml,"+escape(k.join(""))+") no-repeat border-box border-box");h&&a.parent.ab()},a);h=1},Dd:function(){var a={};return function(b,c,d){var e=a[b],g;if(!e){e=new Image;g=doc.createElement("canvas");e.src=b;g.width=c;g.height=d;g.getContext("2d").drawImage(e,0,0);e=a[b]=g.toDataURL()}return e}}(),Ea:f.Tb.prototype.Ea,m:function(){var a= |
636 | +this.e.runtimeStyle;this.parent.gb(this.ua);a.borderColor=a.borderStyle=a.borderWidth=""}});f.kb=function(){function a(l,q){l.className+=" "+q}function b(l){var q=v.slice.call(arguments,1),s=q.length;setTimeout(function(){if(l)for(;s--;)a(l,q[s])},0)}function c(l){var q=v.slice.call(arguments,1),s=q.length;setTimeout(function(){if(l)for(;s--;){var o=q[s];o=t[o]||(t[o]=new RegExp("\\b"+o+"\\b","g"));l.className=l.className.replace(o,"")}},0)}function d(l){function q(){if(!U){var w,A,L=f.ja,T=l.currentStyle, |
637 | +N=T.getAttribute(g)==="true",da=T.getAttribute(i)!=="false",ea=T.getAttribute(h)!=="false";S=T.getAttribute(j);S=L>7?S!=="false":S==="true";if(!R){R=1;l.runtimeStyle.zoom=1;T=l;for(var fa=1;T=T.previousSibling;)if(T.nodeType===1){fa=0;break}fa&&a(l,p)}J.cb();if(N&&(A=J.o())&&(w=doc.documentElement||doc.body)&&(A.y>w.clientHeight||A.x>w.clientWidth||A.y+A.f<0||A.x+A.h<0)){if(!Y){Y=1;f.mb.ba(q)}}else{U=1;Y=R=0;f.mb.Ha(q);if(L===9){G={C:new f.Sb(l),q:new f.Ub(l),w:new f.Vb(l)};Q=[G.C,G.q];K=new f.Oc(l, |
638 | +J,G);w=[new f.Mc(l,J,G,K),new f.Nc(l,J,G,K)]}else{G={C:new f.Sb(l),w:new f.Vb(l),q:new f.Ub(l),G:new f.jb(l),ga:new f.Ic(l),Pb:new f.Uc(l)};Q=[G.C,G.w,G.q,G.G,G.ga,G.Pb];K=new f.Rc(l,J,G);w=[new f.Hc(l,J,G,K),new f.Fc(l,J,G,K),new f.Gc(l,J,G,K),new f.Tb(l,J,G,K)];l.tagName==="IMG"&&w.push(new f.Pc(l,J,G,K));K.ed=w}I=[K].concat(w);if(w=l.currentStyle.getAttribute(f.F+"watch-ancestors")){w=parseInt(w,10);A=0;for(N=l.parentNode;N&&(w==="NaN"||A++<w);){H(N,"onpropertychange",C);H(N,"onmouseenter",x); |
639 | +H(N,"onmouseleave",y);H(N,"onmousedown",z);if(N.tagName in f.fc){H(N,"onfocus",E);H(N,"onblur",D)}N=N.parentNode}}if(S){f.Oa.ba(o);f.Oa.Rd()}o(1)}if(!V){V=1;L<9&&H(l,"onmove",s);H(l,"onresize",s);H(l,"onpropertychange",u);ea&&H(l,"onmouseenter",x);if(ea||da)H(l,"onmouseleave",y);da&&H(l,"onmousedown",z);if(l.tagName in f.fc){H(l,"onfocus",E);H(l,"onblur",D)}f.Qa.ba(s);f.L.ba(M)}J.hb()}}function s(){J&&J.Ad()&&o()}function o(w){if(!X)if(U){var A,L=I.length;F();for(A=0;A<L;A++)I[A].Ea();if(w||J.Od())for(A= |
640 | +0;A<L;A++)I[A].ib();if(w||J.Td())for(A=0;A<L;A++)I[A].Mb();K.ab();O()}else R||q()}function u(){var w,A=I.length,L;w=event;if(!X&&!(w&&w.propertyName in r))if(U){F();for(w=0;w<A;w++)I[w].Ea();for(w=0;w<A;w++){L=I[w];L.Cb||L.ib();L.Q()&&L.Lb()}K.ab();O()}else R||q()}function x(){b(l,k)}function y(){c(l,k,n)}function z(){b(l,n);f.lb.ba(B)}function B(){c(l,n);f.lb.Ha(B)}function E(){b(l,m)}function D(){c(l,m)}function C(){var w=event.propertyName;if(w==="className"||w==="id")u()}function F(){J.cb();for(var w= |
641 | +Q.length;w--;)Q[w].cb()}function O(){for(var w=Q.length;w--;)Q[w].hb();J.hb()}function H(w,A,L){w.attachEvent(A,L);W.push([w,A,L])}function M(){if(V){for(var w=W.length,A;w--;){A=W[w];A[0].detachEvent(A[1],A[2])}f.L.Ha(M);V=0;W=[]}}function P(){if(!X){var w,A;M();X=1;if(I){w=0;for(A=I.length;w<A;w++){I[w].ec=1;I[w].m()}}S&&f.Oa.Ha(o);f.Qa.Ha(o);I=J=G=Q=l=null}}var I,K,J=new ha(l),G,Q,R,U,V,W=[],Y,X,S;this.Ed=q;this.update=o;this.m=P;this.qd=l}var e={},g=f.F+"lazy-init",j=f.F+"poll",i=f.F+"track-active", |
642 | +h=f.F+"track-hover",k=f.La+"hover",n=f.La+"active",m=f.La+"focus",p=f.La+"first-child",r={background:1,bgColor:1,display:1},t={},v=[];d.yd=function(l){var q=f.p.Ba(l);return e[q]||(e[q]=new d(l))};d.m=function(l){l=f.p.Ba(l);var q=e[l];if(q){q.m();delete e[l]}};d.md=function(){var l=[],q;if(e){for(var s in e)if(e.hasOwnProperty(s)){q=e[s];l.push(q.qd);q.m()}e={}}return l};return d}();f.supportsVML=f.zc;f.attach=function(a){f.ja<10&&f.zc&&f.kb.yd(a).Ed()};f.detach=function(a){f.kb.m(a)}}; |
643 | +})(); |
644 | \ No newline at end of file |
645 | |
646 | === added file 'etc/PIE/PIE.php' |
647 | --- etc/PIE/PIE.php 1970-01-01 00:00:00 +0000 |
648 | +++ etc/PIE/PIE.php 2013-04-04 15:11:27 +0000 |
649 | @@ -0,0 +1,19 @@ |
650 | +<?php |
651 | +/* |
652 | +This file is a wrapper, for use in PHP environments, which serves PIE.htc using the |
653 | +correct content-type, so that IE will recognize it as a behavior. Simply specify the |
654 | +behavior property to fetch this .php file instead of the .htc directly: |
655 | + |
656 | +.myElement { |
657 | + [ ...css3 properties... ] |
658 | + behavior: url(PIE.php); |
659 | +} |
660 | + |
661 | +This is only necessary when the web server is not configured to serve .htc files with |
662 | +the text/x-component content-type, and cannot easily be configured to do so (as is the |
663 | +case with some shared hosting providers). |
664 | +*/ |
665 | + |
666 | +header( 'Content-type: text/x-component' ); |
667 | +include( 'PIE.htc' ); |
668 | +?> |
669 | \ No newline at end of file |
670 | |
671 | === added file 'etc/PIE/PIE_uncompressed.htc' |
672 | --- etc/PIE/PIE_uncompressed.htc 1970-01-01 00:00:00 +0000 |
673 | +++ etc/PIE/PIE_uncompressed.htc 2013-04-04 15:11:27 +0000 |
674 | @@ -0,0 +1,4505 @@ |
675 | +<!-- |
676 | +PIE: CSS3 rendering for IE |
677 | +Version 1.0.0 |
678 | +http://css3pie.com |
679 | +Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2. |
680 | +--> |
681 | +<PUBLIC:COMPONENT lightWeight="true"> |
682 | +<!-- saved from url=(0014)about:internet --> |
683 | +<PUBLIC:ATTACH EVENT="oncontentready" FOR="element" ONEVENT="init()" /> |
684 | +<PUBLIC:ATTACH EVENT="ondocumentready" FOR="element" ONEVENT="init()" /> |
685 | +<PUBLIC:ATTACH EVENT="ondetach" FOR="element" ONEVENT="cleanup()" /> |
686 | + |
687 | +<script type="text/javascript"> |
688 | +var doc = element.document;var PIE = window['PIE']; |
689 | + |
690 | +if( !PIE ) { |
691 | + PIE = window['PIE'] = { |
692 | + CSS_PREFIX: '-pie-', |
693 | + STYLE_PREFIX: 'Pie', |
694 | + CLASS_PREFIX: 'pie_', |
695 | + tableCellTags: { |
696 | + 'TD': 1, |
697 | + 'TH': 1 |
698 | + }, |
699 | + |
700 | + /** |
701 | + * Lookup table of elements which cannot take custom children. |
702 | + */ |
703 | + childlessElements: { |
704 | + 'TABLE':1, |
705 | + 'THEAD':1, |
706 | + 'TBODY':1, |
707 | + 'TFOOT':1, |
708 | + 'TR':1, |
709 | + 'INPUT':1, |
710 | + 'TEXTAREA':1, |
711 | + 'SELECT':1, |
712 | + 'OPTION':1, |
713 | + 'IMG':1, |
714 | + 'HR':1 |
715 | + }, |
716 | + |
717 | + /** |
718 | + * Elements that can receive user focus |
719 | + */ |
720 | + focusableElements: { |
721 | + 'A':1, |
722 | + 'INPUT':1, |
723 | + 'TEXTAREA':1, |
724 | + 'SELECT':1, |
725 | + 'BUTTON':1 |
726 | + }, |
727 | + |
728 | + /** |
729 | + * Values of the type attribute for input elements displayed as buttons |
730 | + */ |
731 | + inputButtonTypes: { |
732 | + 'submit':1, |
733 | + 'button':1, |
734 | + 'reset':1 |
735 | + }, |
736 | + |
737 | + emptyFn: function() {} |
738 | + }; |
739 | + |
740 | + // Force the background cache to be used. No reason it shouldn't be. |
741 | + try { |
742 | + doc.execCommand( 'BackgroundImageCache', false, true ); |
743 | + } catch(e) {} |
744 | + |
745 | + (function() { |
746 | + /* |
747 | + * IE version detection approach by James Padolsey, with modifications -- from |
748 | + * http://james.padolsey.com/javascript/detect-ie-in-js-using-conditional-comments/ |
749 | + */ |
750 | + var ieVersion = 4, |
751 | + div = doc.createElement('div'), |
752 | + all = div.getElementsByTagName('i'), |
753 | + shape; |
754 | + while ( |
755 | + div.innerHTML = '<!--[if gt IE ' + (++ieVersion) + ']><i></i><![endif]-->', |
756 | + all[0] |
757 | + ) {} |
758 | + PIE.ieVersion = ieVersion; |
759 | + |
760 | + // Detect IE6 |
761 | + if( ieVersion === 6 ) { |
762 | + // IE6 can't access properties with leading dash, but can without it. |
763 | + PIE.CSS_PREFIX = PIE.CSS_PREFIX.replace( /^-/, '' ); |
764 | + } |
765 | + |
766 | + PIE.ieDocMode = doc.documentMode || PIE.ieVersion; |
767 | + |
768 | + // Detect VML support (a small number of IE installs don't have a working VML engine) |
769 | + div.innerHTML = '<v:shape adj="1"/>'; |
770 | + shape = div.firstChild; |
771 | + shape.style['behavior'] = 'url(#default#VML)'; |
772 | + PIE.supportsVML = (typeof shape['adj'] === "object"); |
773 | + }()); |
774 | +/** |
775 | + * Utility functions |
776 | + */ |
777 | +(function() { |
778 | + var vmlCreatorDoc, |
779 | + idNum = 0, |
780 | + imageSizes = {}; |
781 | + |
782 | + |
783 | + PIE.Util = { |
784 | + |
785 | + /** |
786 | + * To create a VML element, it must be created by a Document which has the VML |
787 | + * namespace set. Unfortunately, if you try to add the namespace programatically |
788 | + * into the main document, you will get an "Unspecified error" when trying to |
789 | + * access document.namespaces before the document is finished loading. To get |
790 | + * around this, we create a DocumentFragment, which in IE land is apparently a |
791 | + * full-fledged Document. It allows adding namespaces immediately, so we add the |
792 | + * namespace there and then have it create the VML element. |
793 | + * @param {string} tag The tag name for the VML element |
794 | + * @return {Element} The new VML element |
795 | + */ |
796 | + createVmlElement: function( tag ) { |
797 | + var vmlPrefix = 'css3vml'; |
798 | + if( !vmlCreatorDoc ) { |
799 | + vmlCreatorDoc = doc.createDocumentFragment(); |
800 | + vmlCreatorDoc.namespaces.add( vmlPrefix, 'urn:schemas-microsoft-com:vml' ); |
801 | + } |
802 | + return vmlCreatorDoc.createElement( vmlPrefix + ':' + tag ); |
803 | + }, |
804 | + |
805 | + |
806 | + /** |
807 | + * Generate and return a unique ID for a given object. The generated ID is stored |
808 | + * as a property of the object for future reuse. |
809 | + * @param {Object} obj |
810 | + */ |
811 | + getUID: function( obj ) { |
812 | + return obj && obj[ '_pieId' ] || ( obj[ '_pieId' ] = '_' + ++idNum ); |
813 | + }, |
814 | + |
815 | + |
816 | + /** |
817 | + * Simple utility for merging objects |
818 | + * @param {Object} obj1 The main object into which all others will be merged |
819 | + * @param {...Object} var_args Other objects which will be merged into the first, in order |
820 | + */ |
821 | + merge: function( obj1 ) { |
822 | + var i, len, p, objN, args = arguments; |
823 | + for( i = 1, len = args.length; i < len; i++ ) { |
824 | + objN = args[i]; |
825 | + for( p in objN ) { |
826 | + if( objN.hasOwnProperty( p ) ) { |
827 | + obj1[ p ] = objN[ p ]; |
828 | + } |
829 | + } |
830 | + } |
831 | + return obj1; |
832 | + }, |
833 | + |
834 | + |
835 | + /** |
836 | + * Execute a callback function, passing it the dimensions of a given image once |
837 | + * they are known. |
838 | + * @param {string} src The source URL of the image |
839 | + * @param {function({w:number, h:number})} func The callback function to be called once the image dimensions are known |
840 | + * @param {Object} ctx A context object which will be used as the 'this' value within the executed callback function |
841 | + */ |
842 | + withImageSize: function( src, func, ctx ) { |
843 | + var size = imageSizes[ src ], img, queue; |
844 | + if( size ) { |
845 | + // If we have a queue, add to it |
846 | + if( Object.prototype.toString.call( size ) === '[object Array]' ) { |
847 | + size.push( [ func, ctx ] ); |
848 | + } |
849 | + // Already have the size cached, call func right away |
850 | + else { |
851 | + func.call( ctx, size ); |
852 | + } |
853 | + } else { |
854 | + queue = imageSizes[ src ] = [ [ func, ctx ] ]; //create queue |
855 | + img = new Image(); |
856 | + img.onload = function() { |
857 | + size = imageSizes[ src ] = { w: img.width, h: img.height }; |
858 | + for( var i = 0, len = queue.length; i < len; i++ ) { |
859 | + queue[ i ][ 0 ].call( queue[ i ][ 1 ], size ); |
860 | + } |
861 | + img.onload = null; |
862 | + }; |
863 | + img.src = src; |
864 | + } |
865 | + } |
866 | + }; |
867 | +})();/** |
868 | + * Utility functions for handling gradients |
869 | + */ |
870 | +PIE.GradientUtil = { |
871 | + |
872 | + getGradientMetrics: function( el, width, height, gradientInfo ) { |
873 | + var angle = gradientInfo.angle, |
874 | + startPos = gradientInfo.gradientStart, |
875 | + startX, startY, |
876 | + endX, endY, |
877 | + startCornerX, startCornerY, |
878 | + endCornerX, endCornerY, |
879 | + deltaX, deltaY, |
880 | + p, UNDEF; |
881 | + |
882 | + // Find the "start" and "end" corners; these are the corners furthest along the gradient line. |
883 | + // This is used below to find the start/end positions of the CSS3 gradient-line, and also in finding |
884 | + // the total length of the VML rendered gradient-line corner to corner. |
885 | + function findCorners() { |
886 | + startCornerX = ( angle >= 90 && angle < 270 ) ? width : 0; |
887 | + startCornerY = angle < 180 ? height : 0; |
888 | + endCornerX = width - startCornerX; |
889 | + endCornerY = height - startCornerY; |
890 | + } |
891 | + |
892 | + // Normalize the angle to a value between [0, 360) |
893 | + function normalizeAngle() { |
894 | + while( angle < 0 ) { |
895 | + angle += 360; |
896 | + } |
897 | + angle = angle % 360; |
898 | + } |
899 | + |
900 | + // Find the start and end points of the gradient |
901 | + if( startPos ) { |
902 | + startPos = startPos.coords( el, width, height ); |
903 | + startX = startPos.x; |
904 | + startY = startPos.y; |
905 | + } |
906 | + if( angle ) { |
907 | + angle = angle.degrees(); |
908 | + |
909 | + normalizeAngle(); |
910 | + findCorners(); |
911 | + |
912 | + // If no start position was specified, then choose a corner as the starting point. |
913 | + if( !startPos ) { |
914 | + startX = startCornerX; |
915 | + startY = startCornerY; |
916 | + } |
917 | + |
918 | + // Find the end position by extending a perpendicular line from the gradient-line which |
919 | + // intersects the corner opposite from the starting corner. |
920 | + p = PIE.GradientUtil.perpendicularIntersect( startX, startY, angle, endCornerX, endCornerY ); |
921 | + endX = p[0]; |
922 | + endY = p[1]; |
923 | + } |
924 | + else if( startPos ) { |
925 | + // Start position but no angle specified: find the end point by rotating 180deg around the center |
926 | + endX = width - startX; |
927 | + endY = height - startY; |
928 | + } |
929 | + else { |
930 | + // Neither position nor angle specified; create vertical gradient from top to bottom |
931 | + startX = startY = endX = 0; |
932 | + endY = height; |
933 | + } |
934 | + deltaX = endX - startX; |
935 | + deltaY = endY - startY; |
936 | + |
937 | + if( angle === UNDEF ) { |
938 | + // Get the angle based on the change in x/y from start to end point. Checks first for horizontal |
939 | + // or vertical angles so they get exact whole numbers rather than what atan2 gives. |
940 | + angle = ( !deltaX ? ( deltaY < 0 ? 90 : 270 ) : |
941 | + ( !deltaY ? ( deltaX < 0 ? 180 : 0 ) : |
942 | + -Math.atan2( deltaY, deltaX ) / Math.PI * 180 |
943 | + ) |
944 | + ); |
945 | + normalizeAngle(); |
946 | + findCorners(); |
947 | + } |
948 | + |
949 | + return { |
950 | + angle: angle, |
951 | + startX: startX, |
952 | + startY: startY, |
953 | + endX: endX, |
954 | + endY: endY, |
955 | + startCornerX: startCornerX, |
956 | + startCornerY: startCornerY, |
957 | + endCornerX: endCornerX, |
958 | + endCornerY: endCornerY, |
959 | + deltaX: deltaX, |
960 | + deltaY: deltaY, |
961 | + lineLength: PIE.GradientUtil.distance( startX, startY, endX, endY ) |
962 | + } |
963 | + }, |
964 | + |
965 | + /** |
966 | + * Find the point along a given line (defined by a starting point and an angle), at which |
967 | + * that line is intersected by a perpendicular line extending through another point. |
968 | + * @param x1 - x coord of the starting point |
969 | + * @param y1 - y coord of the starting point |
970 | + * @param angle - angle of the line extending from the starting point (in degrees) |
971 | + * @param x2 - x coord of point along the perpendicular line |
972 | + * @param y2 - y coord of point along the perpendicular line |
973 | + * @return [ x, y ] |
974 | + */ |
975 | + perpendicularIntersect: function( x1, y1, angle, x2, y2 ) { |
976 | + // Handle straight vertical and horizontal angles, for performance and to avoid |
977 | + // divide-by-zero errors. |
978 | + if( angle === 0 || angle === 180 ) { |
979 | + return [ x2, y1 ]; |
980 | + } |
981 | + else if( angle === 90 || angle === 270 ) { |
982 | + return [ x1, y2 ]; |
983 | + } |
984 | + else { |
985 | + // General approach: determine the Ax+By=C formula for each line (the slope of the second |
986 | + // line is the negative inverse of the first) and then solve for where both formulas have |
987 | + // the same x/y values. |
988 | + var a1 = Math.tan( -angle * Math.PI / 180 ), |
989 | + c1 = a1 * x1 - y1, |
990 | + a2 = -1 / a1, |
991 | + c2 = a2 * x2 - y2, |
992 | + d = a2 - a1, |
993 | + endX = ( c2 - c1 ) / d, |
994 | + endY = ( a1 * c2 - a2 * c1 ) / d; |
995 | + return [ endX, endY ]; |
996 | + } |
997 | + }, |
998 | + |
999 | + /** |
1000 | + * Find the distance between two points |
1001 | + * @param {Number} p1x |
1002 | + * @param {Number} p1y |
1003 | + * @param {Number} p2x |
1004 | + * @param {Number} p2y |
1005 | + * @return {Number} the distance |
1006 | + */ |
1007 | + distance: function( p1x, p1y, p2x, p2y ) { |
1008 | + var dx = p2x - p1x, |
1009 | + dy = p2y - p1y; |
1010 | + return Math.abs( |
1011 | + dx === 0 ? dy : |
1012 | + dy === 0 ? dx : |
1013 | + Math.sqrt( dx * dx + dy * dy ) |
1014 | + ); |
1015 | + } |
1016 | + |
1017 | +};/** |
1018 | + * |
1019 | + */ |
1020 | +PIE.Observable = function() { |
1021 | + /** |
1022 | + * List of registered observer functions |
1023 | + */ |
1024 | + this.observers = []; |
1025 | + |
1026 | + /** |
1027 | + * Hash of function ids to their position in the observers list, for fast lookup |
1028 | + */ |
1029 | + this.indexes = {}; |
1030 | +}; |
1031 | +PIE.Observable.prototype = { |
1032 | + |
1033 | + observe: function( fn ) { |
1034 | + var id = PIE.Util.getUID( fn ), |
1035 | + indexes = this.indexes, |
1036 | + observers = this.observers; |
1037 | + if( !( id in indexes ) ) { |
1038 | + indexes[ id ] = observers.length; |
1039 | + observers.push( fn ); |
1040 | + } |
1041 | + }, |
1042 | + |
1043 | + unobserve: function( fn ) { |
1044 | + var id = PIE.Util.getUID( fn ), |
1045 | + indexes = this.indexes; |
1046 | + if( id && id in indexes ) { |
1047 | + delete this.observers[ indexes[ id ] ]; |
1048 | + delete indexes[ id ]; |
1049 | + } |
1050 | + }, |
1051 | + |
1052 | + fire: function() { |
1053 | + var o = this.observers, |
1054 | + i = o.length; |
1055 | + while( i-- ) { |
1056 | + o[ i ] && o[ i ](); |
1057 | + } |
1058 | + } |
1059 | + |
1060 | +};/* |
1061 | + * Simple heartbeat timer - this is a brute-force workaround for syncing issues caused by IE not |
1062 | + * always firing the onmove and onresize events when elements are moved or resized. We check a few |
1063 | + * times every second to make sure the elements have the correct position and size. See Element.js |
1064 | + * which adds heartbeat listeners based on the custom -pie-poll flag, which defaults to true in IE8-9 |
1065 | + * and false elsewhere. |
1066 | + */ |
1067 | + |
1068 | +PIE.Heartbeat = new PIE.Observable(); |
1069 | +PIE.Heartbeat.run = function() { |
1070 | + var me = this, |
1071 | + interval; |
1072 | + if( !me.running ) { |
1073 | + interval = doc.documentElement.currentStyle.getAttribute( PIE.CSS_PREFIX + 'poll-interval' ) || 250; |
1074 | + (function beat() { |
1075 | + me.fire(); |
1076 | + setTimeout(beat, interval); |
1077 | + })(); |
1078 | + me.running = 1; |
1079 | + } |
1080 | +}; |
1081 | +/** |
1082 | + * Create an observable listener for the onunload event |
1083 | + */ |
1084 | +(function() { |
1085 | + PIE.OnUnload = new PIE.Observable(); |
1086 | + |
1087 | + function handleUnload() { |
1088 | + PIE.OnUnload.fire(); |
1089 | + window.detachEvent( 'onunload', handleUnload ); |
1090 | + window[ 'PIE' ] = null; |
1091 | + } |
1092 | + |
1093 | + window.attachEvent( 'onunload', handleUnload ); |
1094 | + |
1095 | + /** |
1096 | + * Attach an event which automatically gets detached onunload |
1097 | + */ |
1098 | + PIE.OnUnload.attachManagedEvent = function( target, name, handler ) { |
1099 | + target.attachEvent( name, handler ); |
1100 | + this.observe( function() { |
1101 | + target.detachEvent( name, handler ); |
1102 | + } ); |
1103 | + }; |
1104 | +})()/** |
1105 | + * Create a single observable listener for window resize events. |
1106 | + */ |
1107 | +PIE.OnResize = new PIE.Observable(); |
1108 | + |
1109 | +PIE.OnUnload.attachManagedEvent( window, 'onresize', function() { PIE.OnResize.fire(); } ); |
1110 | +/** |
1111 | + * Create a single observable listener for scroll events. Used for lazy loading based |
1112 | + * on the viewport, and for fixed position backgrounds. |
1113 | + */ |
1114 | +(function() { |
1115 | + PIE.OnScroll = new PIE.Observable(); |
1116 | + |
1117 | + function scrolled() { |
1118 | + PIE.OnScroll.fire(); |
1119 | + } |
1120 | + |
1121 | + PIE.OnUnload.attachManagedEvent( window, 'onscroll', scrolled ); |
1122 | + |
1123 | + PIE.OnResize.observe( scrolled ); |
1124 | +})(); |
1125 | +/** |
1126 | + * Listen for printing events, destroy all active PIE instances when printing, and |
1127 | + * restore them afterward. |
1128 | + */ |
1129 | +(function() { |
1130 | + |
1131 | + var elements; |
1132 | + |
1133 | + function beforePrint() { |
1134 | + elements = PIE.Element.destroyAll(); |
1135 | + } |
1136 | + |
1137 | + function afterPrint() { |
1138 | + if( elements ) { |
1139 | + for( var i = 0, len = elements.length; i < len; i++ ) { |
1140 | + PIE[ 'attach' ]( elements[i] ); |
1141 | + } |
1142 | + elements = 0; |
1143 | + } |
1144 | + } |
1145 | + |
1146 | + if( PIE.ieDocMode < 9 ) { |
1147 | + PIE.OnUnload.attachManagedEvent( window, 'onbeforeprint', beforePrint ); |
1148 | + PIE.OnUnload.attachManagedEvent( window, 'onafterprint', afterPrint ); |
1149 | + } |
1150 | + |
1151 | +})();/** |
1152 | + * Create a single observable listener for document mouseup events. |
1153 | + */ |
1154 | +PIE.OnMouseup = new PIE.Observable(); |
1155 | + |
1156 | +PIE.OnUnload.attachManagedEvent( doc, 'onmouseup', function() { PIE.OnMouseup.fire(); } ); |
1157 | +/** |
1158 | + * Wrapper for length and percentage style values. The value is immutable. A singleton instance per unique |
1159 | + * value is returned from PIE.getLength() - always use that instead of instantiating directly. |
1160 | + * @constructor |
1161 | + * @param {string} val The CSS string representing the length. It is assumed that this will already have |
1162 | + * been validated as a valid length or percentage syntax. |
1163 | + */ |
1164 | +PIE.Length = (function() { |
1165 | + var lengthCalcEl = doc.createElement( 'length-calc' ), |
1166 | + parent = doc.body || doc.documentElement, |
1167 | + s = lengthCalcEl.style, |
1168 | + conversions = {}, |
1169 | + units = [ 'mm', 'cm', 'in', 'pt', 'pc' ], |
1170 | + i = units.length, |
1171 | + instances = {}; |
1172 | + |
1173 | + s.position = 'absolute'; |
1174 | + s.top = s.left = '-9999px'; |
1175 | + |
1176 | + parent.appendChild( lengthCalcEl ); |
1177 | + while( i-- ) { |
1178 | + s.width = '100' + units[i]; |
1179 | + conversions[ units[i] ] = lengthCalcEl.offsetWidth / 100; |
1180 | + } |
1181 | + parent.removeChild( lengthCalcEl ); |
1182 | + |
1183 | + // All calcs from here on will use 1em |
1184 | + s.width = '1em'; |
1185 | + |
1186 | + |
1187 | + function Length( val ) { |
1188 | + this.val = val; |
1189 | + } |
1190 | + Length.prototype = { |
1191 | + /** |
1192 | + * Regular expression for matching the length unit |
1193 | + * @private |
1194 | + */ |
1195 | + unitRE: /(px|em|ex|mm|cm|in|pt|pc|%)$/, |
1196 | + |
1197 | + /** |
1198 | + * Get the numeric value of the length |
1199 | + * @return {number} The value |
1200 | + */ |
1201 | + getNumber: function() { |
1202 | + var num = this.num, |
1203 | + UNDEF; |
1204 | + if( num === UNDEF ) { |
1205 | + num = this.num = parseFloat( this.val ); |
1206 | + } |
1207 | + return num; |
1208 | + }, |
1209 | + |
1210 | + /** |
1211 | + * Get the unit of the length |
1212 | + * @return {string} The unit |
1213 | + */ |
1214 | + getUnit: function() { |
1215 | + var unit = this.unit, |
1216 | + m; |
1217 | + if( !unit ) { |
1218 | + m = this.val.match( this.unitRE ); |
1219 | + unit = this.unit = ( m && m[0] ) || 'px'; |
1220 | + } |
1221 | + return unit; |
1222 | + }, |
1223 | + |
1224 | + /** |
1225 | + * Determine whether this is a percentage length value |
1226 | + * @return {boolean} |
1227 | + */ |
1228 | + isPercentage: function() { |
1229 | + return this.getUnit() === '%'; |
1230 | + }, |
1231 | + |
1232 | + /** |
1233 | + * Resolve this length into a number of pixels. |
1234 | + * @param {Element} el - the context element, used to resolve font-relative values |
1235 | + * @param {(function():number|number)=} pct100 - the number of pixels that equal a 100% percentage. This can be either a number or a |
1236 | + * function which will be called to return the number. |
1237 | + */ |
1238 | + pixels: function( el, pct100 ) { |
1239 | + var num = this.getNumber(), |
1240 | + unit = this.getUnit(); |
1241 | + switch( unit ) { |
1242 | + case "px": |
1243 | + return num; |
1244 | + case "%": |
1245 | + return num * ( typeof pct100 === 'function' ? pct100() : pct100 ) / 100; |
1246 | + case "em": |
1247 | + return num * this.getEmPixels( el ); |
1248 | + case "ex": |
1249 | + return num * this.getEmPixels( el ) / 2; |
1250 | + default: |
1251 | + return num * conversions[ unit ]; |
1252 | + } |
1253 | + }, |
1254 | + |
1255 | + /** |
1256 | + * The em and ex units are relative to the font-size of the current element, |
1257 | + * however if the font-size is set using non-pixel units then we get that value |
1258 | + * rather than a pixel conversion. To get around this, we keep a floating element |
1259 | + * with width:1em which we insert into the target element and then read its offsetWidth. |
1260 | + * For elements that won't accept a child we insert into the parent node and perform |
1261 | + * additional calculation. If the font-size *is* specified in pixels, then we use that |
1262 | + * directly to avoid the expensive DOM manipulation. |
1263 | + * @param {Element} el |
1264 | + * @return {number} |
1265 | + */ |
1266 | + getEmPixels: function( el ) { |
1267 | + var fs = el.currentStyle.fontSize, |
1268 | + px, parent, me; |
1269 | + |
1270 | + if( fs.indexOf( 'px' ) > 0 ) { |
1271 | + return parseFloat( fs ); |
1272 | + } |
1273 | + else if( el.tagName in PIE.childlessElements ) { |
1274 | + me = this; |
1275 | + parent = el.parentNode; |
1276 | + return PIE.getLength( fs ).pixels( parent, function() { |
1277 | + return me.getEmPixels( parent ); |
1278 | + } ); |
1279 | + } |
1280 | + else { |
1281 | + el.appendChild( lengthCalcEl ); |
1282 | + px = lengthCalcEl.offsetWidth; |
1283 | + if( lengthCalcEl.parentNode === el ) { //not sure how this could be false but it sometimes is |
1284 | + el.removeChild( lengthCalcEl ); |
1285 | + } |
1286 | + return px; |
1287 | + } |
1288 | + } |
1289 | + }; |
1290 | + |
1291 | + |
1292 | + /** |
1293 | + * Retrieve a PIE.Length instance for the given value. A shared singleton instance is returned for each unique value. |
1294 | + * @param {string} val The CSS string representing the length. It is assumed that this will already have |
1295 | + * been validated as a valid length or percentage syntax. |
1296 | + */ |
1297 | + PIE.getLength = function( val ) { |
1298 | + return instances[ val ] || ( instances[ val ] = new Length( val ) ); |
1299 | + }; |
1300 | + |
1301 | + return Length; |
1302 | +})(); |
1303 | +/** |
1304 | + * Wrapper for a CSS3 bg-position value. Takes up to 2 position keywords and 2 lengths/percentages. |
1305 | + * @constructor |
1306 | + * @param {Array.<PIE.Tokenizer.Token>} tokens The tokens making up the background position value. |
1307 | + */ |
1308 | +PIE.BgPosition = (function() { |
1309 | + |
1310 | + var length_fifty = PIE.getLength( '50%' ), |
1311 | + vert_idents = { 'top': 1, 'center': 1, 'bottom': 1 }, |
1312 | + horiz_idents = { 'left': 1, 'center': 1, 'right': 1 }; |
1313 | + |
1314 | + |
1315 | + function BgPosition( tokens ) { |
1316 | + this.tokens = tokens; |
1317 | + } |
1318 | + BgPosition.prototype = { |
1319 | + /** |
1320 | + * Normalize the values into the form: |
1321 | + * [ xOffsetSide, xOffsetLength, yOffsetSide, yOffsetLength ] |
1322 | + * where: xOffsetSide is either 'left' or 'right', |
1323 | + * yOffsetSide is either 'top' or 'bottom', |
1324 | + * and x/yOffsetLength are both PIE.Length objects. |
1325 | + * @return {Array} |
1326 | + */ |
1327 | + getValues: function() { |
1328 | + if( !this._values ) { |
1329 | + var tokens = this.tokens, |
1330 | + len = tokens.length, |
1331 | + Tokenizer = PIE.Tokenizer, |
1332 | + identType = Tokenizer.Type, |
1333 | + length_zero = PIE.getLength( '0' ), |
1334 | + type_ident = identType.IDENT, |
1335 | + type_length = identType.LENGTH, |
1336 | + type_percent = identType.PERCENT, |
1337 | + type, value, |
1338 | + vals = [ 'left', length_zero, 'top', length_zero ]; |
1339 | + |
1340 | + // If only one value, the second is assumed to be 'center' |
1341 | + if( len === 1 ) { |
1342 | + tokens.push( new Tokenizer.Token( type_ident, 'center' ) ); |
1343 | + len++; |
1344 | + } |
1345 | + |
1346 | + // Two values - CSS2 |
1347 | + if( len === 2 ) { |
1348 | + // If both idents, they can appear in either order, so switch them if needed |
1349 | + if( type_ident & ( tokens[0].tokenType | tokens[1].tokenType ) && |
1350 | + tokens[0].tokenValue in vert_idents && tokens[1].tokenValue in horiz_idents ) { |
1351 | + tokens.push( tokens.shift() ); |
1352 | + } |
1353 | + if( tokens[0].tokenType & type_ident ) { |
1354 | + if( tokens[0].tokenValue === 'center' ) { |
1355 | + vals[1] = length_fifty; |
1356 | + } else { |
1357 | + vals[0] = tokens[0].tokenValue; |
1358 | + } |
1359 | + } |
1360 | + else if( tokens[0].isLengthOrPercent() ) { |
1361 | + vals[1] = PIE.getLength( tokens[0].tokenValue ); |
1362 | + } |
1363 | + if( tokens[1].tokenType & type_ident ) { |
1364 | + if( tokens[1].tokenValue === 'center' ) { |
1365 | + vals[3] = length_fifty; |
1366 | + } else { |
1367 | + vals[2] = tokens[1].tokenValue; |
1368 | + } |
1369 | + } |
1370 | + else if( tokens[1].isLengthOrPercent() ) { |
1371 | + vals[3] = PIE.getLength( tokens[1].tokenValue ); |
1372 | + } |
1373 | + } |
1374 | + |
1375 | + // Three or four values - CSS3 |
1376 | + else { |
1377 | + // TODO |
1378 | + } |
1379 | + |
1380 | + this._values = vals; |
1381 | + } |
1382 | + return this._values; |
1383 | + }, |
1384 | + |
1385 | + /** |
1386 | + * Find the coordinates of the background image from the upper-left corner of the background area. |
1387 | + * Note that these coordinate values are not rounded. |
1388 | + * @param {Element} el |
1389 | + * @param {number} width - the width for percentages (background area width minus image width) |
1390 | + * @param {number} height - the height for percentages (background area height minus image height) |
1391 | + * @return {Object} { x: Number, y: Number } |
1392 | + */ |
1393 | + coords: function( el, width, height ) { |
1394 | + var vals = this.getValues(), |
1395 | + pxX = vals[1].pixels( el, width ), |
1396 | + pxY = vals[3].pixels( el, height ); |
1397 | + |
1398 | + return { |
1399 | + x: vals[0] === 'right' ? width - pxX : pxX, |
1400 | + y: vals[2] === 'bottom' ? height - pxY : pxY |
1401 | + }; |
1402 | + } |
1403 | + }; |
1404 | + |
1405 | + return BgPosition; |
1406 | +})(); |
1407 | +/** |
1408 | + * Wrapper for a CSS3 background-size value. |
1409 | + * @constructor |
1410 | + * @param {String|PIE.Length} w The width parameter |
1411 | + * @param {String|PIE.Length} h The height parameter, if any |
1412 | + */ |
1413 | +PIE.BgSize = (function() { |
1414 | + |
1415 | + var CONTAIN = 'contain', |
1416 | + COVER = 'cover', |
1417 | + AUTO = 'auto'; |
1418 | + |
1419 | + |
1420 | + function BgSize( w, h ) { |
1421 | + this.w = w; |
1422 | + this.h = h; |
1423 | + } |
1424 | + BgSize.prototype = { |
1425 | + |
1426 | + pixels: function( el, areaW, areaH, imgW, imgH ) { |
1427 | + var me = this, |
1428 | + w = me.w, |
1429 | + h = me.h, |
1430 | + areaRatio = areaW / areaH, |
1431 | + imgRatio = imgW / imgH; |
1432 | + |
1433 | + if ( w === CONTAIN ) { |
1434 | + w = imgRatio > areaRatio ? areaW : areaH * imgRatio; |
1435 | + h = imgRatio > areaRatio ? areaW / imgRatio : areaH; |
1436 | + } |
1437 | + else if ( w === COVER ) { |
1438 | + w = imgRatio < areaRatio ? areaW : areaH * imgRatio; |
1439 | + h = imgRatio < areaRatio ? areaW / imgRatio : areaH; |
1440 | + } |
1441 | + else if ( w === AUTO ) { |
1442 | + h = ( h === AUTO ? imgH : h.pixels( el, areaH ) ); |
1443 | + w = h * imgRatio; |
1444 | + } |
1445 | + else { |
1446 | + w = w.pixels( el, areaW ); |
1447 | + h = ( h === AUTO ? w / imgRatio : h.pixels( el, areaH ) ); |
1448 | + } |
1449 | + |
1450 | + return { w: w, h: h }; |
1451 | + } |
1452 | + |
1453 | + }; |
1454 | + |
1455 | + BgSize.DEFAULT = new BgSize( AUTO, AUTO ); |
1456 | + |
1457 | + return BgSize; |
1458 | +})(); |
1459 | +/** |
1460 | + * Wrapper for angle values; handles conversion to degrees from all allowed angle units |
1461 | + * @constructor |
1462 | + * @param {string} val The raw CSS value for the angle. It is assumed it has been pre-validated. |
1463 | + */ |
1464 | +PIE.Angle = (function() { |
1465 | + function Angle( val ) { |
1466 | + this.val = val; |
1467 | + } |
1468 | + Angle.prototype = { |
1469 | + unitRE: /[a-z]+$/i, |
1470 | + |
1471 | + /** |
1472 | + * @return {string} The unit of the angle value |
1473 | + */ |
1474 | + getUnit: function() { |
1475 | + return this._unit || ( this._unit = this.val.match( this.unitRE )[0].toLowerCase() ); |
1476 | + }, |
1477 | + |
1478 | + /** |
1479 | + * Get the numeric value of the angle in degrees. |
1480 | + * @return {number} The degrees value |
1481 | + */ |
1482 | + degrees: function() { |
1483 | + var deg = this._deg, u, n; |
1484 | + if( deg === undefined ) { |
1485 | + u = this.getUnit(); |
1486 | + n = parseFloat( this.val, 10 ); |
1487 | + deg = this._deg = ( u === 'deg' ? n : u === 'rad' ? n / Math.PI * 180 : u === 'grad' ? n / 400 * 360 : u === 'turn' ? n * 360 : 0 ); |
1488 | + } |
1489 | + return deg; |
1490 | + } |
1491 | + }; |
1492 | + |
1493 | + return Angle; |
1494 | +})();/** |
1495 | + * Abstraction for colors values. Allows detection of rgba values. A singleton instance per unique |
1496 | + * value is returned from PIE.getColor() - always use that instead of instantiating directly. |
1497 | + * @constructor |
1498 | + * @param {string} val The raw CSS string value for the color |
1499 | + */ |
1500 | +PIE.Color = (function() { |
1501 | + var instances = {}; |
1502 | + |
1503 | + function Color( val ) { |
1504 | + this.val = val; |
1505 | + } |
1506 | + |
1507 | + /** |
1508 | + * Regular expression for matching rgba colors and extracting their components |
1509 | + * @type {RegExp} |
1510 | + */ |
1511 | + Color.rgbaRE = /\s*rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d+|\d*\.\d+)\s*\)\s*/; |
1512 | + |
1513 | + Color.names = { |
1514 | + "aliceblue":"F0F8FF", "antiquewhite":"FAEBD7", "aqua":"0FF", |
1515 | + "aquamarine":"7FFFD4", "azure":"F0FFFF", "beige":"F5F5DC", |
1516 | + "bisque":"FFE4C4", "black":"000", "blanchedalmond":"FFEBCD", |
1517 | + "blue":"00F", "blueviolet":"8A2BE2", "brown":"A52A2A", |
1518 | + "burlywood":"DEB887", "cadetblue":"5F9EA0", "chartreuse":"7FFF00", |
1519 | + "chocolate":"D2691E", "coral":"FF7F50", "cornflowerblue":"6495ED", |
1520 | + "cornsilk":"FFF8DC", "crimson":"DC143C", "cyan":"0FF", |
1521 | + "darkblue":"00008B", "darkcyan":"008B8B", "darkgoldenrod":"B8860B", |
1522 | + "darkgray":"A9A9A9", "darkgreen":"006400", "darkkhaki":"BDB76B", |
1523 | + "darkmagenta":"8B008B", "darkolivegreen":"556B2F", "darkorange":"FF8C00", |
1524 | + "darkorchid":"9932CC", "darkred":"8B0000", "darksalmon":"E9967A", |
1525 | + "darkseagreen":"8FBC8F", "darkslateblue":"483D8B", "darkslategray":"2F4F4F", |
1526 | + "darkturquoise":"00CED1", "darkviolet":"9400D3", "deeppink":"FF1493", |
1527 | + "deepskyblue":"00BFFF", "dimgray":"696969", "dodgerblue":"1E90FF", |
1528 | + "firebrick":"B22222", "floralwhite":"FFFAF0", "forestgreen":"228B22", |
1529 | + "fuchsia":"F0F", "gainsboro":"DCDCDC", "ghostwhite":"F8F8FF", |
1530 | + "gold":"FFD700", "goldenrod":"DAA520", "gray":"808080", |
1531 | + "green":"008000", "greenyellow":"ADFF2F", "honeydew":"F0FFF0", |
1532 | + "hotpink":"FF69B4", "indianred":"CD5C5C", "indigo":"4B0082", |
1533 | + "ivory":"FFFFF0", "khaki":"F0E68C", "lavender":"E6E6FA", |
1534 | + "lavenderblush":"FFF0F5", "lawngreen":"7CFC00", "lemonchiffon":"FFFACD", |
1535 | + "lightblue":"ADD8E6", "lightcoral":"F08080", "lightcyan":"E0FFFF", |
1536 | + "lightgoldenrodyellow":"FAFAD2", "lightgreen":"90EE90", "lightgrey":"D3D3D3", |
1537 | + "lightpink":"FFB6C1", "lightsalmon":"FFA07A", "lightseagreen":"20B2AA", |
1538 | + "lightskyblue":"87CEFA", "lightslategray":"789", "lightsteelblue":"B0C4DE", |
1539 | + "lightyellow":"FFFFE0", "lime":"0F0", "limegreen":"32CD32", |
1540 | + "linen":"FAF0E6", "magenta":"F0F", "maroon":"800000", |
1541 | + "mediumauqamarine":"66CDAA", "mediumblue":"0000CD", "mediumorchid":"BA55D3", |
1542 | + "mediumpurple":"9370D8", "mediumseagreen":"3CB371", "mediumslateblue":"7B68EE", |
1543 | + "mediumspringgreen":"00FA9A", "mediumturquoise":"48D1CC", "mediumvioletred":"C71585", |
1544 | + "midnightblue":"191970", "mintcream":"F5FFFA", "mistyrose":"FFE4E1", |
1545 | + "moccasin":"FFE4B5", "navajowhite":"FFDEAD", "navy":"000080", |
1546 | + "oldlace":"FDF5E6", "olive":"808000", "olivedrab":"688E23", |
1547 | + "orange":"FFA500", "orangered":"FF4500", "orchid":"DA70D6", |
1548 | + "palegoldenrod":"EEE8AA", "palegreen":"98FB98", "paleturquoise":"AFEEEE", |
1549 | + "palevioletred":"D87093", "papayawhip":"FFEFD5", "peachpuff":"FFDAB9", |
1550 | + "peru":"CD853F", "pink":"FFC0CB", "plum":"DDA0DD", |
1551 | + "powderblue":"B0E0E6", "purple":"800080", "red":"F00", |
1552 | + "rosybrown":"BC8F8F", "royalblue":"4169E1", "saddlebrown":"8B4513", |
1553 | + "salmon":"FA8072", "sandybrown":"F4A460", "seagreen":"2E8B57", |
1554 | + "seashell":"FFF5EE", "sienna":"A0522D", "silver":"C0C0C0", |
1555 | + "skyblue":"87CEEB", "slateblue":"6A5ACD", "slategray":"708090", |
1556 | + "snow":"FFFAFA", "springgreen":"00FF7F", "steelblue":"4682B4", |
1557 | + "tan":"D2B48C", "teal":"008080", "thistle":"D8BFD8", |
1558 | + "tomato":"FF6347", "turquoise":"40E0D0", "violet":"EE82EE", |
1559 | + "wheat":"F5DEB3", "white":"FFF", "whitesmoke":"F5F5F5", |
1560 | + "yellow":"FF0", "yellowgreen":"9ACD32" |
1561 | + }; |
1562 | + |
1563 | + Color.prototype = { |
1564 | + /** |
1565 | + * @private |
1566 | + */ |
1567 | + parse: function() { |
1568 | + if( !this._color ) { |
1569 | + var me = this, |
1570 | + v = me.val, |
1571 | + vLower, |
1572 | + m = v.match( Color.rgbaRE ); |
1573 | + if( m ) { |
1574 | + me._color = 'rgb(' + m[1] + ',' + m[2] + ',' + m[3] + ')'; |
1575 | + me._alpha = parseFloat( m[4] ); |
1576 | + } |
1577 | + else { |
1578 | + if( ( vLower = v.toLowerCase() ) in Color.names ) { |
1579 | + v = '#' + Color.names[vLower]; |
1580 | + } |
1581 | + me._color = v; |
1582 | + me._alpha = ( v === 'transparent' ? 0 : 1 ); |
1583 | + } |
1584 | + } |
1585 | + }, |
1586 | + |
1587 | + /** |
1588 | + * Retrieve the value of the color in a format usable by IE natively. This will be the same as |
1589 | + * the raw input value, except for rgba values which will be converted to an rgb value. |
1590 | + * @param {Element} el The context element, used to get 'currentColor' keyword value. |
1591 | + * @return {string} Color value |
1592 | + */ |
1593 | + colorValue: function( el ) { |
1594 | + this.parse(); |
1595 | + return this._color === 'currentColor' ? el.currentStyle.color : this._color; |
1596 | + }, |
1597 | + |
1598 | + /** |
1599 | + * Retrieve the alpha value of the color. Will be 1 for all values except for rgba values |
1600 | + * with an alpha component. |
1601 | + * @return {number} The alpha value, from 0 to 1. |
1602 | + */ |
1603 | + alpha: function() { |
1604 | + this.parse(); |
1605 | + return this._alpha; |
1606 | + } |
1607 | + }; |
1608 | + |
1609 | + |
1610 | + /** |
1611 | + * Retrieve a PIE.Color instance for the given value. A shared singleton instance is returned for each unique value. |
1612 | + * @param {string} val The CSS string representing the color. It is assumed that this will already have |
1613 | + * been validated as a valid color syntax. |
1614 | + */ |
1615 | + PIE.getColor = function(val) { |
1616 | + return instances[ val ] || ( instances[ val ] = new Color( val ) ); |
1617 | + }; |
1618 | + |
1619 | + return Color; |
1620 | +})();/** |
1621 | + * A tokenizer for CSS value strings. |
1622 | + * @constructor |
1623 | + * @param {string} css The CSS value string |
1624 | + */ |
1625 | +PIE.Tokenizer = (function() { |
1626 | + function Tokenizer( css ) { |
1627 | + this.css = css; |
1628 | + this.ch = 0; |
1629 | + this.tokens = []; |
1630 | + this.tokenIndex = 0; |
1631 | + } |
1632 | + |
1633 | + /** |
1634 | + * Enumeration of token type constants. |
1635 | + * @enum {number} |
1636 | + */ |
1637 | + var Type = Tokenizer.Type = { |
1638 | + ANGLE: 1, |
1639 | + CHARACTER: 2, |
1640 | + COLOR: 4, |
1641 | + DIMEN: 8, |
1642 | + FUNCTION: 16, |
1643 | + IDENT: 32, |
1644 | + LENGTH: 64, |
1645 | + NUMBER: 128, |
1646 | + OPERATOR: 256, |
1647 | + PERCENT: 512, |
1648 | + STRING: 1024, |
1649 | + URL: 2048 |
1650 | + }; |
1651 | + |
1652 | + /** |
1653 | + * A single token |
1654 | + * @constructor |
1655 | + * @param {number} type The type of the token - see PIE.Tokenizer.Type |
1656 | + * @param {string} value The value of the token |
1657 | + */ |
1658 | + Tokenizer.Token = function( type, value ) { |
1659 | + this.tokenType = type; |
1660 | + this.tokenValue = value; |
1661 | + }; |
1662 | + Tokenizer.Token.prototype = { |
1663 | + isLength: function() { |
1664 | + return this.tokenType & Type.LENGTH || ( this.tokenType & Type.NUMBER && this.tokenValue === '0' ); |
1665 | + }, |
1666 | + isLengthOrPercent: function() { |
1667 | + return this.isLength() || this.tokenType & Type.PERCENT; |
1668 | + } |
1669 | + }; |
1670 | + |
1671 | + Tokenizer.prototype = { |
1672 | + whitespace: /\s/, |
1673 | + number: /^[\+\-]?(\d*\.)?\d+/, |
1674 | + url: /^url\(\s*("([^"]*)"|'([^']*)'|([!#$%&*-~]*))\s*\)/i, |
1675 | + ident: /^\-?[_a-z][\w-]*/i, |
1676 | + string: /^("([^"]*)"|'([^']*)')/, |
1677 | + operator: /^[\/,]/, |
1678 | + hash: /^#[\w]+/, |
1679 | + hashColor: /^#([\da-f]{6}|[\da-f]{3})/i, |
1680 | + |
1681 | + unitTypes: { |
1682 | + 'px': Type.LENGTH, 'em': Type.LENGTH, 'ex': Type.LENGTH, |
1683 | + 'mm': Type.LENGTH, 'cm': Type.LENGTH, 'in': Type.LENGTH, |
1684 | + 'pt': Type.LENGTH, 'pc': Type.LENGTH, |
1685 | + 'deg': Type.ANGLE, 'rad': Type.ANGLE, 'grad': Type.ANGLE |
1686 | + }, |
1687 | + |
1688 | + colorFunctions: { |
1689 | + 'rgb': 1, 'rgba': 1, 'hsl': 1, 'hsla': 1 |
1690 | + }, |
1691 | + |
1692 | + |
1693 | + /** |
1694 | + * Advance to and return the next token in the CSS string. If the end of the CSS string has |
1695 | + * been reached, null will be returned. |
1696 | + * @param {boolean} forget - if true, the token will not be stored for the purposes of backtracking with prev(). |
1697 | + * @return {PIE.Tokenizer.Token} |
1698 | + */ |
1699 | + next: function( forget ) { |
1700 | + var css, ch, firstChar, match, val, |
1701 | + me = this; |
1702 | + |
1703 | + function newToken( type, value ) { |
1704 | + var tok = new Tokenizer.Token( type, value ); |
1705 | + if( !forget ) { |
1706 | + me.tokens.push( tok ); |
1707 | + me.tokenIndex++; |
1708 | + } |
1709 | + return tok; |
1710 | + } |
1711 | + function failure() { |
1712 | + me.tokenIndex++; |
1713 | + return null; |
1714 | + } |
1715 | + |
1716 | + // In case we previously backed up, return the stored token in the next slot |
1717 | + if( this.tokenIndex < this.tokens.length ) { |
1718 | + return this.tokens[ this.tokenIndex++ ]; |
1719 | + } |
1720 | + |
1721 | + // Move past leading whitespace characters |
1722 | + while( this.whitespace.test( this.css.charAt( this.ch ) ) ) { |
1723 | + this.ch++; |
1724 | + } |
1725 | + if( this.ch >= this.css.length ) { |
1726 | + return failure(); |
1727 | + } |
1728 | + |
1729 | + ch = this.ch; |
1730 | + css = this.css.substring( this.ch ); |
1731 | + firstChar = css.charAt( 0 ); |
1732 | + switch( firstChar ) { |
1733 | + case '#': |
1734 | + if( match = css.match( this.hashColor ) ) { |
1735 | + this.ch += match[0].length; |
1736 | + return newToken( Type.COLOR, match[0] ); |
1737 | + } |
1738 | + break; |
1739 | + |
1740 | + case '"': |
1741 | + case "'": |
1742 | + if( match = css.match( this.string ) ) { |
1743 | + this.ch += match[0].length; |
1744 | + return newToken( Type.STRING, match[2] || match[3] || '' ); |
1745 | + } |
1746 | + break; |
1747 | + |
1748 | + case "/": |
1749 | + case ",": |
1750 | + this.ch++; |
1751 | + return newToken( Type.OPERATOR, firstChar ); |
1752 | + |
1753 | + case 'u': |
1754 | + if( match = css.match( this.url ) ) { |
1755 | + this.ch += match[0].length; |
1756 | + return newToken( Type.URL, match[2] || match[3] || match[4] || '' ); |
1757 | + } |
1758 | + } |
1759 | + |
1760 | + // Numbers and values starting with numbers |
1761 | + if( match = css.match( this.number ) ) { |
1762 | + val = match[0]; |
1763 | + this.ch += val.length; |
1764 | + |
1765 | + // Check if it is followed by a unit |
1766 | + if( css.charAt( val.length ) === '%' ) { |
1767 | + this.ch++; |
1768 | + return newToken( Type.PERCENT, val + '%' ); |
1769 | + } |
1770 | + if( match = css.substring( val.length ).match( this.ident ) ) { |
1771 | + val += match[0]; |
1772 | + this.ch += match[0].length; |
1773 | + return newToken( this.unitTypes[ match[0].toLowerCase() ] || Type.DIMEN, val ); |
1774 | + } |
1775 | + |
1776 | + // Plain ol' number |
1777 | + return newToken( Type.NUMBER, val ); |
1778 | + } |
1779 | + |
1780 | + // Identifiers |
1781 | + if( match = css.match( this.ident ) ) { |
1782 | + val = match[0]; |
1783 | + this.ch += val.length; |
1784 | + |
1785 | + // Named colors |
1786 | + if( val.toLowerCase() in PIE.Color.names || val === 'currentColor' || val === 'transparent' ) { |
1787 | + return newToken( Type.COLOR, val ); |
1788 | + } |
1789 | + |
1790 | + // Functions |
1791 | + if( css.charAt( val.length ) === '(' ) { |
1792 | + this.ch++; |
1793 | + |
1794 | + // Color values in function format: rgb, rgba, hsl, hsla |
1795 | + if( val.toLowerCase() in this.colorFunctions ) { |
1796 | + function isNum( tok ) { |
1797 | + return tok && tok.tokenType & Type.NUMBER; |
1798 | + } |
1799 | + function isNumOrPct( tok ) { |
1800 | + return tok && ( tok.tokenType & ( Type.NUMBER | Type.PERCENT ) ); |
1801 | + } |
1802 | + function isValue( tok, val ) { |
1803 | + return tok && tok.tokenValue === val; |
1804 | + } |
1805 | + function next() { |
1806 | + return me.next( 1 ); |
1807 | + } |
1808 | + |
1809 | + if( ( val.charAt(0) === 'r' ? isNumOrPct( next() ) : isNum( next() ) ) && |
1810 | + isValue( next(), ',' ) && |
1811 | + isNumOrPct( next() ) && |
1812 | + isValue( next(), ',' ) && |
1813 | + isNumOrPct( next() ) && |
1814 | + ( val === 'rgb' || val === 'hsa' || ( |
1815 | + isValue( next(), ',' ) && |
1816 | + isNum( next() ) |
1817 | + ) ) && |
1818 | + isValue( next(), ')' ) ) { |
1819 | + return newToken( Type.COLOR, this.css.substring( ch, this.ch ) ); |
1820 | + } |
1821 | + return failure(); |
1822 | + } |
1823 | + |
1824 | + return newToken( Type.FUNCTION, val ); |
1825 | + } |
1826 | + |
1827 | + // Other identifier |
1828 | + return newToken( Type.IDENT, val ); |
1829 | + } |
1830 | + |
1831 | + // Standalone character |
1832 | + this.ch++; |
1833 | + return newToken( Type.CHARACTER, firstChar ); |
1834 | + }, |
1835 | + |
1836 | + /** |
1837 | + * Determine whether there is another token |
1838 | + * @return {boolean} |
1839 | + */ |
1840 | + hasNext: function() { |
1841 | + var next = this.next(); |
1842 | + this.prev(); |
1843 | + return !!next; |
1844 | + }, |
1845 | + |
1846 | + /** |
1847 | + * Back up and return the previous token |
1848 | + * @return {PIE.Tokenizer.Token} |
1849 | + */ |
1850 | + prev: function() { |
1851 | + return this.tokens[ this.tokenIndex-- - 2 ]; |
1852 | + }, |
1853 | + |
1854 | + /** |
1855 | + * Retrieve all the tokens in the CSS string |
1856 | + * @return {Array.<PIE.Tokenizer.Token>} |
1857 | + */ |
1858 | + all: function() { |
1859 | + while( this.next() ) {} |
1860 | + return this.tokens; |
1861 | + }, |
1862 | + |
1863 | + /** |
1864 | + * Return a list of tokens from the current position until the given function returns |
1865 | + * true. The final token will not be included in the list. |
1866 | + * @param {function():boolean} func - test function |
1867 | + * @param {boolean} require - if true, then if the end of the CSS string is reached |
1868 | + * before the test function returns true, null will be returned instead of the |
1869 | + * tokens that have been found so far. |
1870 | + * @return {Array.<PIE.Tokenizer.Token>} |
1871 | + */ |
1872 | + until: function( func, require ) { |
1873 | + var list = [], t, hit; |
1874 | + while( t = this.next() ) { |
1875 | + if( func( t ) ) { |
1876 | + hit = true; |
1877 | + this.prev(); |
1878 | + break; |
1879 | + } |
1880 | + list.push( t ); |
1881 | + } |
1882 | + return require && !hit ? null : list; |
1883 | + } |
1884 | + }; |
1885 | + |
1886 | + return Tokenizer; |
1887 | +})();/** |
1888 | + * Handles calculating, caching, and detecting changes to size and position of the element. |
1889 | + * @constructor |
1890 | + * @param {Element} el the target element |
1891 | + */ |
1892 | +PIE.BoundsInfo = function( el ) { |
1893 | + this.targetElement = el; |
1894 | +}; |
1895 | +PIE.BoundsInfo.prototype = { |
1896 | + |
1897 | + _locked: 0, |
1898 | + |
1899 | + positionChanged: function() { |
1900 | + var last = this._lastBounds, |
1901 | + bounds; |
1902 | + return !last || ( ( bounds = this.getBounds() ) && ( last.x !== bounds.x || last.y !== bounds.y ) ); |
1903 | + }, |
1904 | + |
1905 | + sizeChanged: function() { |
1906 | + var last = this._lastBounds, |
1907 | + bounds; |
1908 | + return !last || ( ( bounds = this.getBounds() ) && ( last.w !== bounds.w || last.h !== bounds.h ) ); |
1909 | + }, |
1910 | + |
1911 | + getLiveBounds: function() { |
1912 | + var el = this.targetElement, |
1913 | + rect = el.getBoundingClientRect(), |
1914 | + isIE9 = PIE.ieDocMode === 9, |
1915 | + isIE7 = PIE.ieVersion === 7, |
1916 | + width = rect.right - rect.left; |
1917 | + return { |
1918 | + x: rect.left, |
1919 | + y: rect.top, |
1920 | + // In some cases scrolling the page will cause IE9 to report incorrect dimensions |
1921 | + // in the rect returned by getBoundingClientRect, so we must query offsetWidth/Height |
1922 | + // instead. Also IE7 is inconsistent in using logical vs. device pixels in measurements |
1923 | + // so we must calculate the ratio and use it in certain places as a position adjustment. |
1924 | + w: isIE9 || isIE7 ? el.offsetWidth : width, |
1925 | + h: isIE9 || isIE7 ? el.offsetHeight : rect.bottom - rect.top, |
1926 | + logicalZoomRatio: ( isIE7 && width ) ? el.offsetWidth / width : 1 |
1927 | + }; |
1928 | + }, |
1929 | + |
1930 | + getBounds: function() { |
1931 | + return this._locked ? |
1932 | + ( this._lockedBounds || ( this._lockedBounds = this.getLiveBounds() ) ) : |
1933 | + this.getLiveBounds(); |
1934 | + }, |
1935 | + |
1936 | + hasBeenQueried: function() { |
1937 | + return !!this._lastBounds; |
1938 | + }, |
1939 | + |
1940 | + lock: function() { |
1941 | + ++this._locked; |
1942 | + }, |
1943 | + |
1944 | + unlock: function() { |
1945 | + if( !--this._locked ) { |
1946 | + if( this._lockedBounds ) this._lastBounds = this._lockedBounds; |
1947 | + this._lockedBounds = null; |
1948 | + } |
1949 | + } |
1950 | + |
1951 | +}; |
1952 | +(function() { |
1953 | + |
1954 | +function cacheWhenLocked( fn ) { |
1955 | + var uid = PIE.Util.getUID( fn ); |
1956 | + return function() { |
1957 | + if( this._locked ) { |
1958 | + var cache = this._lockedValues || ( this._lockedValues = {} ); |
1959 | + return ( uid in cache ) ? cache[ uid ] : ( cache[ uid ] = fn.call( this ) ); |
1960 | + } else { |
1961 | + return fn.call( this ); |
1962 | + } |
1963 | + } |
1964 | +} |
1965 | + |
1966 | + |
1967 | +PIE.StyleInfoBase = { |
1968 | + |
1969 | + _locked: 0, |
1970 | + |
1971 | + /** |
1972 | + * Create a new StyleInfo class, with the standard constructor, and augmented by |
1973 | + * the StyleInfoBase's members. |
1974 | + * @param proto |
1975 | + */ |
1976 | + newStyleInfo: function( proto ) { |
1977 | + function StyleInfo( el ) { |
1978 | + this.targetElement = el; |
1979 | + this._lastCss = this.getCss(); |
1980 | + } |
1981 | + PIE.Util.merge( StyleInfo.prototype, PIE.StyleInfoBase, proto ); |
1982 | + StyleInfo._propsCache = {}; |
1983 | + return StyleInfo; |
1984 | + }, |
1985 | + |
1986 | + /** |
1987 | + * Get an object representation of the target CSS style, caching it for each unique |
1988 | + * CSS value string. |
1989 | + * @return {Object} |
1990 | + */ |
1991 | + getProps: function() { |
1992 | + var css = this.getCss(), |
1993 | + cache = this.constructor._propsCache; |
1994 | + return css ? ( css in cache ? cache[ css ] : ( cache[ css ] = this.parseCss( css ) ) ) : null; |
1995 | + }, |
1996 | + |
1997 | + /** |
1998 | + * Get the raw CSS value for the target style |
1999 | + * @return {string} |
2000 | + */ |
2001 | + getCss: cacheWhenLocked( function() { |
2002 | + var el = this.targetElement, |
2003 | + ctor = this.constructor, |
2004 | + s = el.style, |
2005 | + cs = el.currentStyle, |
2006 | + cssProp = this.cssProperty, |
2007 | + styleProp = this.styleProperty, |
2008 | + prefixedCssProp = ctor._prefixedCssProp || ( ctor._prefixedCssProp = PIE.CSS_PREFIX + cssProp ), |
2009 | + prefixedStyleProp = ctor._prefixedStyleProp || ( ctor._prefixedStyleProp = PIE.STYLE_PREFIX + styleProp.charAt(0).toUpperCase() + styleProp.substring(1) ); |
2010 | + return s[ prefixedStyleProp ] || cs.getAttribute( prefixedCssProp ) || s[ styleProp ] || cs.getAttribute( cssProp ); |
2011 | + } ), |
2012 | + |
2013 | + /** |
2014 | + * Determine whether the target CSS style is active. |
2015 | + * @return {boolean} |
2016 | + */ |
2017 | + isActive: cacheWhenLocked( function() { |
2018 | + return !!this.getProps(); |
2019 | + } ), |
2020 | + |
2021 | + /** |
2022 | + * Determine whether the target CSS style has changed since the last time it was used. |
2023 | + * @return {boolean} |
2024 | + */ |
2025 | + changed: cacheWhenLocked( function() { |
2026 | + var currentCss = this.getCss(), |
2027 | + changed = currentCss !== this._lastCss; |
2028 | + this._lastCss = currentCss; |
2029 | + return changed; |
2030 | + } ), |
2031 | + |
2032 | + cacheWhenLocked: cacheWhenLocked, |
2033 | + |
2034 | + lock: function() { |
2035 | + ++this._locked; |
2036 | + }, |
2037 | + |
2038 | + unlock: function() { |
2039 | + if( !--this._locked ) { |
2040 | + delete this._lockedValues; |
2041 | + } |
2042 | + } |
2043 | +}; |
2044 | + |
2045 | +})();/** |
2046 | + * Handles parsing, caching, and detecting changes to background (and -pie-background) CSS |
2047 | + * @constructor |
2048 | + * @param {Element} el the target element |
2049 | + */ |
2050 | +PIE.BackgroundStyleInfo = PIE.StyleInfoBase.newStyleInfo( { |
2051 | + |
2052 | + cssProperty: PIE.CSS_PREFIX + 'background', |
2053 | + styleProperty: PIE.STYLE_PREFIX + 'Background', |
2054 | + |
2055 | + attachIdents: { 'scroll':1, 'fixed':1, 'local':1 }, |
2056 | + repeatIdents: { 'repeat-x':1, 'repeat-y':1, 'repeat':1, 'no-repeat':1 }, |
2057 | + originAndClipIdents: { 'padding-box':1, 'border-box':1, 'content-box':1 }, |
2058 | + positionIdents: { 'top':1, 'right':1, 'bottom':1, 'left':1, 'center':1 }, |
2059 | + sizeIdents: { 'contain':1, 'cover':1 }, |
2060 | + propertyNames: { |
2061 | + CLIP: 'backgroundClip', |
2062 | + COLOR: 'backgroundColor', |
2063 | + IMAGE: 'backgroundImage', |
2064 | + ORIGIN: 'backgroundOrigin', |
2065 | + POSITION: 'backgroundPosition', |
2066 | + REPEAT: 'backgroundRepeat', |
2067 | + SIZE: 'backgroundSize' |
2068 | + }, |
2069 | + |
2070 | + /** |
2071 | + * For background styles, we support the -pie-background property but fall back to the standard |
2072 | + * backround* properties. The reason we have to use the prefixed version is that IE natively |
2073 | + * parses the standard properties and if it sees something it doesn't know how to parse, for example |
2074 | + * multiple values or gradient definitions, it will throw that away and not make it available through |
2075 | + * currentStyle. |
2076 | + * |
2077 | + * Format of return object: |
2078 | + * { |
2079 | + * color: <PIE.Color>, |
2080 | + * bgImages: [ |
2081 | + * { |
2082 | + * imgType: 'image', |
2083 | + * imgUrl: 'image.png', |
2084 | + * imgRepeat: <'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat'>, |
2085 | + * bgPosition: <PIE.BgPosition>, |
2086 | + * bgAttachment: <'scroll' | 'fixed' | 'local'>, |
2087 | + * bgOrigin: <'border-box' | 'padding-box' | 'content-box'>, |
2088 | + * bgClip: <'border-box' | 'padding-box'>, |
2089 | + * bgSize: <PIE.BgSize>, |
2090 | + * origString: 'url(img.png) no-repeat top left' |
2091 | + * }, |
2092 | + * { |
2093 | + * imgType: 'linear-gradient', |
2094 | + * gradientStart: <PIE.BgPosition>, |
2095 | + * angle: <PIE.Angle>, |
2096 | + * stops: [ |
2097 | + * { color: <PIE.Color>, offset: <PIE.Length> }, |
2098 | + * { color: <PIE.Color>, offset: <PIE.Length> }, ... |
2099 | + * ] |
2100 | + * } |
2101 | + * ] |
2102 | + * } |
2103 | + * @param {String} css |
2104 | + * @override |
2105 | + */ |
2106 | + parseCss: function( css ) { |
2107 | + var el = this.targetElement, |
2108 | + cs = el.currentStyle, |
2109 | + tokenizer, token, image, |
2110 | + tok_type = PIE.Tokenizer.Type, |
2111 | + type_operator = tok_type.OPERATOR, |
2112 | + type_ident = tok_type.IDENT, |
2113 | + type_color = tok_type.COLOR, |
2114 | + tokType, tokVal, |
2115 | + beginCharIndex = 0, |
2116 | + positionIdents = this.positionIdents, |
2117 | + gradient, stop, width, height, |
2118 | + props = { bgImages: [] }; |
2119 | + |
2120 | + function isBgPosToken( token ) { |
2121 | + return token && token.isLengthOrPercent() || ( token.tokenType & type_ident && token.tokenValue in positionIdents ); |
2122 | + } |
2123 | + |
2124 | + function sizeToken( token ) { |
2125 | + return token && ( ( token.isLengthOrPercent() && PIE.getLength( token.tokenValue ) ) || ( token.tokenValue === 'auto' && 'auto' ) ); |
2126 | + } |
2127 | + |
2128 | + // If the CSS3-specific -pie-background property is present, parse it |
2129 | + if( this.getCss3() ) { |
2130 | + tokenizer = new PIE.Tokenizer( css ); |
2131 | + image = {}; |
2132 | + |
2133 | + while( token = tokenizer.next() ) { |
2134 | + tokType = token.tokenType; |
2135 | + tokVal = token.tokenValue; |
2136 | + |
2137 | + if( !image.imgType && tokType & tok_type.FUNCTION && tokVal === 'linear-gradient' ) { |
2138 | + gradient = { stops: [], imgType: tokVal }; |
2139 | + stop = {}; |
2140 | + while( token = tokenizer.next() ) { |
2141 | + tokType = token.tokenType; |
2142 | + tokVal = token.tokenValue; |
2143 | + |
2144 | + // If we reached the end of the function and had at least 2 stops, flush the info |
2145 | + if( tokType & tok_type.CHARACTER && tokVal === ')' ) { |
2146 | + if( stop.color ) { |
2147 | + gradient.stops.push( stop ); |
2148 | + } |
2149 | + if( gradient.stops.length > 1 ) { |
2150 | + PIE.Util.merge( image, gradient ); |
2151 | + } |
2152 | + break; |
2153 | + } |
2154 | + |
2155 | + // Color stop - must start with color |
2156 | + if( tokType & type_color ) { |
2157 | + // if we already have an angle/position, make sure that the previous token was a comma |
2158 | + if( gradient.angle || gradient.gradientStart ) { |
2159 | + token = tokenizer.prev(); |
2160 | + if( token.tokenType !== type_operator ) { |
2161 | + break; //fail |
2162 | + } |
2163 | + tokenizer.next(); |
2164 | + } |
2165 | + |
2166 | + stop = { |
2167 | + color: PIE.getColor( tokVal ) |
2168 | + }; |
2169 | + // check for offset following color |
2170 | + token = tokenizer.next(); |
2171 | + if( token.isLengthOrPercent() ) { |
2172 | + stop.offset = PIE.getLength( token.tokenValue ); |
2173 | + } else { |
2174 | + tokenizer.prev(); |
2175 | + } |
2176 | + } |
2177 | + // Angle - can only appear in first spot |
2178 | + else if( tokType & tok_type.ANGLE && !gradient.angle && !stop.color && !gradient.stops.length ) { |
2179 | + gradient.angle = new PIE.Angle( token.tokenValue ); |
2180 | + } |
2181 | + else if( isBgPosToken( token ) && !gradient.gradientStart && !stop.color && !gradient.stops.length ) { |
2182 | + tokenizer.prev(); |
2183 | + gradient.gradientStart = new PIE.BgPosition( |
2184 | + tokenizer.until( function( t ) { |
2185 | + return !isBgPosToken( t ); |
2186 | + }, false ) |
2187 | + ); |
2188 | + } |
2189 | + else if( tokType & type_operator && tokVal === ',' ) { |
2190 | + if( stop.color ) { |
2191 | + gradient.stops.push( stop ); |
2192 | + stop = {}; |
2193 | + } |
2194 | + } |
2195 | + else { |
2196 | + // Found something we didn't recognize; fail without adding image |
2197 | + break; |
2198 | + } |
2199 | + } |
2200 | + } |
2201 | + else if( !image.imgType && tokType & tok_type.URL ) { |
2202 | + image.imgUrl = tokVal; |
2203 | + image.imgType = 'image'; |
2204 | + } |
2205 | + else if( isBgPosToken( token ) && !image.bgPosition ) { |
2206 | + tokenizer.prev(); |
2207 | + image.bgPosition = new PIE.BgPosition( |
2208 | + tokenizer.until( function( t ) { |
2209 | + return !isBgPosToken( t ); |
2210 | + }, false ) |
2211 | + ); |
2212 | + } |
2213 | + else if( tokType & type_ident ) { |
2214 | + if( tokVal in this.repeatIdents && !image.imgRepeat ) { |
2215 | + image.imgRepeat = tokVal; |
2216 | + } |
2217 | + else if( tokVal in this.originAndClipIdents && !image.bgOrigin ) { |
2218 | + image.bgOrigin = tokVal; |
2219 | + if( ( token = tokenizer.next() ) && ( token.tokenType & type_ident ) && |
2220 | + token.tokenValue in this.originAndClipIdents ) { |
2221 | + image.bgClip = token.tokenValue; |
2222 | + } else { |
2223 | + image.bgClip = tokVal; |
2224 | + tokenizer.prev(); |
2225 | + } |
2226 | + } |
2227 | + else if( tokVal in this.attachIdents && !image.bgAttachment ) { |
2228 | + image.bgAttachment = tokVal; |
2229 | + } |
2230 | + else { |
2231 | + return null; |
2232 | + } |
2233 | + } |
2234 | + else if( tokType & type_color && !props.color ) { |
2235 | + props.color = PIE.getColor( tokVal ); |
2236 | + } |
2237 | + else if( tokType & type_operator && tokVal === '/' && !image.bgSize && image.bgPosition ) { |
2238 | + // background size |
2239 | + token = tokenizer.next(); |
2240 | + if( token.tokenType & type_ident && token.tokenValue in this.sizeIdents ) { |
2241 | + image.bgSize = new PIE.BgSize( token.tokenValue ); |
2242 | + } |
2243 | + else if( width = sizeToken( token ) ) { |
2244 | + height = sizeToken( tokenizer.next() ); |
2245 | + if ( !height ) { |
2246 | + height = width; |
2247 | + tokenizer.prev(); |
2248 | + } |
2249 | + image.bgSize = new PIE.BgSize( width, height ); |
2250 | + } |
2251 | + else { |
2252 | + return null; |
2253 | + } |
2254 | + } |
2255 | + // new layer |
2256 | + else if( tokType & type_operator && tokVal === ',' && image.imgType ) { |
2257 | + image.origString = css.substring( beginCharIndex, tokenizer.ch - 1 ); |
2258 | + beginCharIndex = tokenizer.ch; |
2259 | + props.bgImages.push( image ); |
2260 | + image = {}; |
2261 | + } |
2262 | + else { |
2263 | + // Found something unrecognized; chuck everything |
2264 | + return null; |
2265 | + } |
2266 | + } |
2267 | + |
2268 | + // leftovers |
2269 | + if( image.imgType ) { |
2270 | + image.origString = css.substring( beginCharIndex ); |
2271 | + props.bgImages.push( image ); |
2272 | + } |
2273 | + } |
2274 | + |
2275 | + // Otherwise, use the standard background properties; let IE give us the values rather than parsing them |
2276 | + else { |
2277 | + this.withActualBg( PIE.ieDocMode < 9 ? |
2278 | + function() { |
2279 | + var propNames = this.propertyNames, |
2280 | + posX = cs[propNames.POSITION + 'X'], |
2281 | + posY = cs[propNames.POSITION + 'Y'], |
2282 | + img = cs[propNames.IMAGE], |
2283 | + color = cs[propNames.COLOR]; |
2284 | + |
2285 | + if( color !== 'transparent' ) { |
2286 | + props.color = PIE.getColor( color ) |
2287 | + } |
2288 | + if( img !== 'none' ) { |
2289 | + props.bgImages = [ { |
2290 | + imgType: 'image', |
2291 | + imgUrl: new PIE.Tokenizer( img ).next().tokenValue, |
2292 | + imgRepeat: cs[propNames.REPEAT], |
2293 | + bgPosition: new PIE.BgPosition( new PIE.Tokenizer( posX + ' ' + posY ).all() ) |
2294 | + } ]; |
2295 | + } |
2296 | + } : |
2297 | + function() { |
2298 | + var propNames = this.propertyNames, |
2299 | + splitter = /\s*,\s*/, |
2300 | + images = cs[propNames.IMAGE].split( splitter ), |
2301 | + color = cs[propNames.COLOR], |
2302 | + repeats, positions, origins, clips, sizes, i, len, image, sizeParts; |
2303 | + |
2304 | + if( color !== 'transparent' ) { |
2305 | + props.color = PIE.getColor( color ) |
2306 | + } |
2307 | + |
2308 | + len = images.length; |
2309 | + if( len && images[0] !== 'none' ) { |
2310 | + repeats = cs[propNames.REPEAT].split( splitter ); |
2311 | + positions = cs[propNames.POSITION].split( splitter ); |
2312 | + origins = cs[propNames.ORIGIN].split( splitter ); |
2313 | + clips = cs[propNames.CLIP].split( splitter ); |
2314 | + sizes = cs[propNames.SIZE].split( splitter ); |
2315 | + |
2316 | + props.bgImages = []; |
2317 | + for( i = 0; i < len; i++ ) { |
2318 | + image = images[ i ]; |
2319 | + if( image && image !== 'none' ) { |
2320 | + sizeParts = sizes[i].split( ' ' ); |
2321 | + props.bgImages.push( { |
2322 | + origString: image + ' ' + repeats[ i ] + ' ' + positions[ i ] + ' / ' + sizes[ i ] + ' ' + |
2323 | + origins[ i ] + ' ' + clips[ i ], |
2324 | + imgType: 'image', |
2325 | + imgUrl: new PIE.Tokenizer( image ).next().tokenValue, |
2326 | + imgRepeat: repeats[ i ], |
2327 | + bgPosition: new PIE.BgPosition( new PIE.Tokenizer( positions[ i ] ).all() ), |
2328 | + bgOrigin: origins[ i ], |
2329 | + bgClip: clips[ i ], |
2330 | + bgSize: new PIE.BgSize( sizeParts[ 0 ], sizeParts[ 1 ] ) |
2331 | + } ); |
2332 | + } |
2333 | + } |
2334 | + } |
2335 | + } |
2336 | + ); |
2337 | + } |
2338 | + |
2339 | + return ( props.color || props.bgImages[0] ) ? props : null; |
2340 | + }, |
2341 | + |
2342 | + /** |
2343 | + * Execute a function with the actual background styles (not overridden with runtimeStyle |
2344 | + * properties set by the renderers) available via currentStyle. |
2345 | + * @param fn |
2346 | + */ |
2347 | + withActualBg: function( fn ) { |
2348 | + var isIE9 = PIE.ieDocMode > 8, |
2349 | + propNames = this.propertyNames, |
2350 | + rs = this.targetElement.runtimeStyle, |
2351 | + rsImage = rs[propNames.IMAGE], |
2352 | + rsColor = rs[propNames.COLOR], |
2353 | + rsRepeat = rs[propNames.REPEAT], |
2354 | + rsClip, rsOrigin, rsSize, rsPosition, ret; |
2355 | + |
2356 | + if( rsImage ) rs[propNames.IMAGE] = ''; |
2357 | + if( rsColor ) rs[propNames.COLOR] = ''; |
2358 | + if( rsRepeat ) rs[propNames.REPEAT] = ''; |
2359 | + if( isIE9 ) { |
2360 | + rsClip = rs[propNames.CLIP]; |
2361 | + rsOrigin = rs[propNames.ORIGIN]; |
2362 | + rsPosition = rs[propNames.POSITION]; |
2363 | + rsSize = rs[propNames.SIZE]; |
2364 | + if( rsClip ) rs[propNames.CLIP] = ''; |
2365 | + if( rsOrigin ) rs[propNames.ORIGIN] = ''; |
2366 | + if( rsPosition ) rs[propNames.POSITION] = ''; |
2367 | + if( rsSize ) rs[propNames.SIZE] = ''; |
2368 | + } |
2369 | + |
2370 | + ret = fn.call( this ); |
2371 | + |
2372 | + if( rsImage ) rs[propNames.IMAGE] = rsImage; |
2373 | + if( rsColor ) rs[propNames.COLOR] = rsColor; |
2374 | + if( rsRepeat ) rs[propNames.REPEAT] = rsRepeat; |
2375 | + if( isIE9 ) { |
2376 | + if( rsClip ) rs[propNames.CLIP] = rsClip; |
2377 | + if( rsOrigin ) rs[propNames.ORIGIN] = rsOrigin; |
2378 | + if( rsPosition ) rs[propNames.POSITION] = rsPosition; |
2379 | + if( rsSize ) rs[propNames.SIZE] = rsSize; |
2380 | + } |
2381 | + |
2382 | + return ret; |
2383 | + }, |
2384 | + |
2385 | + getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { |
2386 | + return this.getCss3() || |
2387 | + this.withActualBg( function() { |
2388 | + var cs = this.targetElement.currentStyle, |
2389 | + propNames = this.propertyNames; |
2390 | + return cs[propNames.COLOR] + ' ' + cs[propNames.IMAGE] + ' ' + cs[propNames.REPEAT] + ' ' + |
2391 | + cs[propNames.POSITION + 'X'] + ' ' + cs[propNames.POSITION + 'Y']; |
2392 | + } ); |
2393 | + } ), |
2394 | + |
2395 | + getCss3: PIE.StyleInfoBase.cacheWhenLocked( function() { |
2396 | + var el = this.targetElement; |
2397 | + return el.style[ this.styleProperty ] || el.currentStyle.getAttribute( this.cssProperty ); |
2398 | + } ), |
2399 | + |
2400 | + /** |
2401 | + * Tests if style.PiePngFix or the -pie-png-fix property is set to true in IE6. |
2402 | + */ |
2403 | + isPngFix: function() { |
2404 | + var val = 0, el; |
2405 | + if( PIE.ieVersion < 7 ) { |
2406 | + el = this.targetElement; |
2407 | + val = ( '' + ( el.style[ PIE.STYLE_PREFIX + 'PngFix' ] || el.currentStyle.getAttribute( PIE.CSS_PREFIX + 'png-fix' ) ) === 'true' ); |
2408 | + } |
2409 | + return val; |
2410 | + }, |
2411 | + |
2412 | + /** |
2413 | + * The isActive logic is slightly different, because getProps() always returns an object |
2414 | + * even if it is just falling back to the native background properties. But we only want |
2415 | + * to report is as being "active" if either the -pie-background override property is present |
2416 | + * and parses successfully or '-pie-png-fix' is set to true in IE6. |
2417 | + */ |
2418 | + isActive: PIE.StyleInfoBase.cacheWhenLocked( function() { |
2419 | + return (this.getCss3() || this.isPngFix()) && !!this.getProps(); |
2420 | + } ) |
2421 | + |
2422 | +} );/** |
2423 | + * Handles parsing, caching, and detecting changes to border CSS |
2424 | + * @constructor |
2425 | + * @param {Element} el the target element |
2426 | + */ |
2427 | +PIE.BorderStyleInfo = PIE.StyleInfoBase.newStyleInfo( { |
2428 | + |
2429 | + sides: [ 'Top', 'Right', 'Bottom', 'Left' ], |
2430 | + namedWidths: { |
2431 | + 'thin': '1px', |
2432 | + 'medium': '3px', |
2433 | + 'thick': '5px' |
2434 | + }, |
2435 | + |
2436 | + parseCss: function( css ) { |
2437 | + var w = {}, |
2438 | + s = {}, |
2439 | + c = {}, |
2440 | + active = false, |
2441 | + colorsSame = true, |
2442 | + stylesSame = true, |
2443 | + widthsSame = true; |
2444 | + |
2445 | + this.withActualBorder( function() { |
2446 | + var el = this.targetElement, |
2447 | + cs = el.currentStyle, |
2448 | + i = 0, |
2449 | + style, color, width, lastStyle, lastColor, lastWidth, side, ltr; |
2450 | + for( ; i < 4; i++ ) { |
2451 | + side = this.sides[ i ]; |
2452 | + |
2453 | + ltr = side.charAt(0).toLowerCase(); |
2454 | + style = s[ ltr ] = cs[ 'border' + side + 'Style' ]; |
2455 | + color = cs[ 'border' + side + 'Color' ]; |
2456 | + width = cs[ 'border' + side + 'Width' ]; |
2457 | + |
2458 | + if( i > 0 ) { |
2459 | + if( style !== lastStyle ) { stylesSame = false; } |
2460 | + if( color !== lastColor ) { colorsSame = false; } |
2461 | + if( width !== lastWidth ) { widthsSame = false; } |
2462 | + } |
2463 | + lastStyle = style; |
2464 | + lastColor = color; |
2465 | + lastWidth = width; |
2466 | + |
2467 | + c[ ltr ] = PIE.getColor( color ); |
2468 | + |
2469 | + width = w[ ltr ] = PIE.getLength( s[ ltr ] === 'none' ? '0' : ( this.namedWidths[ width ] || width ) ); |
2470 | + if( width.pixels( this.targetElement ) > 0 ) { |
2471 | + active = true; |
2472 | + } |
2473 | + } |
2474 | + } ); |
2475 | + |
2476 | + return active ? { |
2477 | + widths: w, |
2478 | + styles: s, |
2479 | + colors: c, |
2480 | + widthsSame: widthsSame, |
2481 | + colorsSame: colorsSame, |
2482 | + stylesSame: stylesSame |
2483 | + } : null; |
2484 | + }, |
2485 | + |
2486 | + getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { |
2487 | + var el = this.targetElement, |
2488 | + cs = el.currentStyle, |
2489 | + css; |
2490 | + |
2491 | + // Don't redraw or hide borders for cells in border-collapse:collapse tables |
2492 | + if( !( el.tagName in PIE.tableCellTags && el.offsetParent.currentStyle.borderCollapse === 'collapse' ) ) { |
2493 | + this.withActualBorder( function() { |
2494 | + css = cs.borderWidth + '|' + cs.borderStyle + '|' + cs.borderColor; |
2495 | + } ); |
2496 | + } |
2497 | + return css; |
2498 | + } ), |
2499 | + |
2500 | + /** |
2501 | + * Execute a function with the actual border styles (not overridden with runtimeStyle |
2502 | + * properties set by the renderers) available via currentStyle. |
2503 | + * @param fn |
2504 | + */ |
2505 | + withActualBorder: function( fn ) { |
2506 | + var rs = this.targetElement.runtimeStyle, |
2507 | + rsWidth = rs.borderWidth, |
2508 | + rsColor = rs.borderColor, |
2509 | + ret; |
2510 | + |
2511 | + if( rsWidth ) rs.borderWidth = ''; |
2512 | + if( rsColor ) rs.borderColor = ''; |
2513 | + |
2514 | + ret = fn.call( this ); |
2515 | + |
2516 | + if( rsWidth ) rs.borderWidth = rsWidth; |
2517 | + if( rsColor ) rs.borderColor = rsColor; |
2518 | + |
2519 | + return ret; |
2520 | + } |
2521 | + |
2522 | +} ); |
2523 | +/** |
2524 | + * Handles parsing, caching, and detecting changes to border-radius CSS |
2525 | + * @constructor |
2526 | + * @param {Element} el the target element |
2527 | + */ |
2528 | +(function() { |
2529 | + |
2530 | +PIE.BorderRadiusStyleInfo = PIE.StyleInfoBase.newStyleInfo( { |
2531 | + |
2532 | + cssProperty: 'border-radius', |
2533 | + styleProperty: 'borderRadius', |
2534 | + |
2535 | + parseCss: function( css ) { |
2536 | + var p = null, x, y, |
2537 | + tokenizer, token, length, |
2538 | + hasNonZero = false; |
2539 | + |
2540 | + if( css ) { |
2541 | + tokenizer = new PIE.Tokenizer( css ); |
2542 | + |
2543 | + function collectLengths() { |
2544 | + var arr = [], num; |
2545 | + while( ( token = tokenizer.next() ) && token.isLengthOrPercent() ) { |
2546 | + length = PIE.getLength( token.tokenValue ); |
2547 | + num = length.getNumber(); |
2548 | + if( num < 0 ) { |
2549 | + return null; |
2550 | + } |
2551 | + if( num > 0 ) { |
2552 | + hasNonZero = true; |
2553 | + } |
2554 | + arr.push( length ); |
2555 | + } |
2556 | + return arr.length > 0 && arr.length < 5 ? { |
2557 | + 'tl': arr[0], |
2558 | + 'tr': arr[1] || arr[0], |
2559 | + 'br': arr[2] || arr[0], |
2560 | + 'bl': arr[3] || arr[1] || arr[0] |
2561 | + } : null; |
2562 | + } |
2563 | + |
2564 | + // Grab the initial sequence of lengths |
2565 | + if( x = collectLengths() ) { |
2566 | + // See if there is a slash followed by more lengths, for the y-axis radii |
2567 | + if( token ) { |
2568 | + if( token.tokenType & PIE.Tokenizer.Type.OPERATOR && token.tokenValue === '/' ) { |
2569 | + y = collectLengths(); |
2570 | + } |
2571 | + } else { |
2572 | + y = x; |
2573 | + } |
2574 | + |
2575 | + // Treat all-zero values the same as no value |
2576 | + if( hasNonZero && x && y ) { |
2577 | + p = { x: x, y : y }; |
2578 | + } |
2579 | + } |
2580 | + } |
2581 | + |
2582 | + return p; |
2583 | + } |
2584 | +} ); |
2585 | + |
2586 | +var zero = PIE.getLength( '0' ), |
2587 | + zeros = { 'tl': zero, 'tr': zero, 'br': zero, 'bl': zero }; |
2588 | +PIE.BorderRadiusStyleInfo.ALL_ZERO = { x: zeros, y: zeros }; |
2589 | + |
2590 | +})();/** |
2591 | + * Handles parsing, caching, and detecting changes to border-image CSS |
2592 | + * @constructor |
2593 | + * @param {Element} el the target element |
2594 | + */ |
2595 | +PIE.BorderImageStyleInfo = PIE.StyleInfoBase.newStyleInfo( { |
2596 | + |
2597 | + cssProperty: 'border-image', |
2598 | + styleProperty: 'borderImage', |
2599 | + |
2600 | + repeatIdents: { 'stretch':1, 'round':1, 'repeat':1, 'space':1 }, |
2601 | + |
2602 | + parseCss: function( css ) { |
2603 | + var p = null, tokenizer, token, type, value, |
2604 | + slices, widths, outsets, |
2605 | + slashCount = 0, |
2606 | + Type = PIE.Tokenizer.Type, |
2607 | + IDENT = Type.IDENT, |
2608 | + NUMBER = Type.NUMBER, |
2609 | + PERCENT = Type.PERCENT; |
2610 | + |
2611 | + if( css ) { |
2612 | + tokenizer = new PIE.Tokenizer( css ); |
2613 | + p = {}; |
2614 | + |
2615 | + function isSlash( token ) { |
2616 | + return token && ( token.tokenType & Type.OPERATOR ) && ( token.tokenValue === '/' ); |
2617 | + } |
2618 | + |
2619 | + function isFillIdent( token ) { |
2620 | + return token && ( token.tokenType & IDENT ) && ( token.tokenValue === 'fill' ); |
2621 | + } |
2622 | + |
2623 | + function collectSlicesEtc() { |
2624 | + slices = tokenizer.until( function( tok ) { |
2625 | + return !( tok.tokenType & ( NUMBER | PERCENT ) ); |
2626 | + } ); |
2627 | + |
2628 | + if( isFillIdent( tokenizer.next() ) && !p.fill ) { |
2629 | + p.fill = true; |
2630 | + } else { |
2631 | + tokenizer.prev(); |
2632 | + } |
2633 | + |
2634 | + if( isSlash( tokenizer.next() ) ) { |
2635 | + slashCount++; |
2636 | + widths = tokenizer.until( function( token ) { |
2637 | + return !token.isLengthOrPercent() && !( ( token.tokenType & IDENT ) && token.tokenValue === 'auto' ); |
2638 | + } ); |
2639 | + |
2640 | + if( isSlash( tokenizer.next() ) ) { |
2641 | + slashCount++; |
2642 | + outsets = tokenizer.until( function( token ) { |
2643 | + return !token.isLength(); |
2644 | + } ); |
2645 | + } |
2646 | + } else { |
2647 | + tokenizer.prev(); |
2648 | + } |
2649 | + } |
2650 | + |
2651 | + while( token = tokenizer.next() ) { |
2652 | + type = token.tokenType; |
2653 | + value = token.tokenValue; |
2654 | + |
2655 | + // Numbers and/or 'fill' keyword: slice values. May be followed optionally by width values, followed optionally by outset values |
2656 | + if( type & ( NUMBER | PERCENT ) && !slices ) { |
2657 | + tokenizer.prev(); |
2658 | + collectSlicesEtc(); |
2659 | + } |
2660 | + else if( isFillIdent( token ) && !p.fill ) { |
2661 | + p.fill = true; |
2662 | + collectSlicesEtc(); |
2663 | + } |
2664 | + |
2665 | + // Idents: one or values for 'repeat' |
2666 | + else if( ( type & IDENT ) && this.repeatIdents[value] && !p.repeat ) { |
2667 | + p.repeat = { h: value }; |
2668 | + if( token = tokenizer.next() ) { |
2669 | + if( ( token.tokenType & IDENT ) && this.repeatIdents[token.tokenValue] ) { |
2670 | + p.repeat.v = token.tokenValue; |
2671 | + } else { |
2672 | + tokenizer.prev(); |
2673 | + } |
2674 | + } |
2675 | + } |
2676 | + |
2677 | + // URL of the image |
2678 | + else if( ( type & Type.URL ) && !p.src ) { |
2679 | + p.src = value; |
2680 | + } |
2681 | + |
2682 | + // Found something unrecognized; exit. |
2683 | + else { |
2684 | + return null; |
2685 | + } |
2686 | + } |
2687 | + |
2688 | + // Validate what we collected |
2689 | + if( !p.src || !slices || slices.length < 1 || slices.length > 4 || |
2690 | + ( widths && widths.length > 4 ) || ( slashCount === 1 && widths.length < 1 ) || |
2691 | + ( outsets && outsets.length > 4 ) || ( slashCount === 2 && outsets.length < 1 ) ) { |
2692 | + return null; |
2693 | + } |
2694 | + |
2695 | + // Fill in missing values |
2696 | + if( !p.repeat ) { |
2697 | + p.repeat = { h: 'stretch' }; |
2698 | + } |
2699 | + if( !p.repeat.v ) { |
2700 | + p.repeat.v = p.repeat.h; |
2701 | + } |
2702 | + |
2703 | + function distributeSides( tokens, convertFn ) { |
2704 | + return { |
2705 | + 't': convertFn( tokens[0] ), |
2706 | + 'r': convertFn( tokens[1] || tokens[0] ), |
2707 | + 'b': convertFn( tokens[2] || tokens[0] ), |
2708 | + 'l': convertFn( tokens[3] || tokens[1] || tokens[0] ) |
2709 | + }; |
2710 | + } |
2711 | + |
2712 | + p.slice = distributeSides( slices, function( tok ) { |
2713 | + return PIE.getLength( ( tok.tokenType & NUMBER ) ? tok.tokenValue + 'px' : tok.tokenValue ); |
2714 | + } ); |
2715 | + |
2716 | + if( widths && widths[0] ) { |
2717 | + p.widths = distributeSides( widths, function( tok ) { |
2718 | + return tok.isLengthOrPercent() ? PIE.getLength( tok.tokenValue ) : tok.tokenValue; |
2719 | + } ); |
2720 | + } |
2721 | + |
2722 | + if( outsets && outsets[0] ) { |
2723 | + p.outset = distributeSides( outsets, function( tok ) { |
2724 | + return tok.isLength() ? PIE.getLength( tok.tokenValue ) : tok.tokenValue; |
2725 | + } ); |
2726 | + } |
2727 | + } |
2728 | + |
2729 | + return p; |
2730 | + } |
2731 | + |
2732 | +} );/** |
2733 | + * Handles parsing, caching, and detecting changes to box-shadow CSS |
2734 | + * @constructor |
2735 | + * @param {Element} el the target element |
2736 | + */ |
2737 | +PIE.BoxShadowStyleInfo = PIE.StyleInfoBase.newStyleInfo( { |
2738 | + |
2739 | + cssProperty: 'box-shadow', |
2740 | + styleProperty: 'boxShadow', |
2741 | + |
2742 | + parseCss: function( css ) { |
2743 | + var props, |
2744 | + getLength = PIE.getLength, |
2745 | + Type = PIE.Tokenizer.Type, |
2746 | + tokenizer; |
2747 | + |
2748 | + if( css ) { |
2749 | + tokenizer = new PIE.Tokenizer( css ); |
2750 | + props = { outset: [], inset: [] }; |
2751 | + |
2752 | + function parseItem() { |
2753 | + var token, type, value, color, lengths, inset, len; |
2754 | + |
2755 | + while( token = tokenizer.next() ) { |
2756 | + value = token.tokenValue; |
2757 | + type = token.tokenType; |
2758 | + |
2759 | + if( type & Type.OPERATOR && value === ',' ) { |
2760 | + break; |
2761 | + } |
2762 | + else if( token.isLength() && !lengths ) { |
2763 | + tokenizer.prev(); |
2764 | + lengths = tokenizer.until( function( token ) { |
2765 | + return !token.isLength(); |
2766 | + } ); |
2767 | + } |
2768 | + else if( type & Type.COLOR && !color ) { |
2769 | + color = value; |
2770 | + } |
2771 | + else if( type & Type.IDENT && value === 'inset' && !inset ) { |
2772 | + inset = true; |
2773 | + } |
2774 | + else { //encountered an unrecognized token; fail. |
2775 | + return false; |
2776 | + } |
2777 | + } |
2778 | + |
2779 | + len = lengths && lengths.length; |
2780 | + if( len > 1 && len < 5 ) { |
2781 | + ( inset ? props.inset : props.outset ).push( { |
2782 | + xOffset: getLength( lengths[0].tokenValue ), |
2783 | + yOffset: getLength( lengths[1].tokenValue ), |
2784 | + blur: getLength( lengths[2] ? lengths[2].tokenValue : '0' ), |
2785 | + spread: getLength( lengths[3] ? lengths[3].tokenValue : '0' ), |
2786 | + color: PIE.getColor( color || 'currentColor' ) |
2787 | + } ); |
2788 | + return true; |
2789 | + } |
2790 | + return false; |
2791 | + } |
2792 | + |
2793 | + while( parseItem() ) {} |
2794 | + } |
2795 | + |
2796 | + return props && ( props.inset.length || props.outset.length ) ? props : null; |
2797 | + } |
2798 | +} ); |
2799 | +/** |
2800 | + * Retrieves the state of the element's visibility and display |
2801 | + * @constructor |
2802 | + * @param {Element} el the target element |
2803 | + */ |
2804 | +PIE.VisibilityStyleInfo = PIE.StyleInfoBase.newStyleInfo( { |
2805 | + |
2806 | + getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { |
2807 | + var cs = this.targetElement.currentStyle; |
2808 | + return cs.visibility + '|' + cs.display; |
2809 | + } ), |
2810 | + |
2811 | + parseCss: function() { |
2812 | + var el = this.targetElement, |
2813 | + rs = el.runtimeStyle, |
2814 | + cs = el.currentStyle, |
2815 | + rsVis = rs.visibility, |
2816 | + csVis; |
2817 | + |
2818 | + rs.visibility = ''; |
2819 | + csVis = cs.visibility; |
2820 | + rs.visibility = rsVis; |
2821 | + |
2822 | + return { |
2823 | + visible: csVis !== 'hidden', |
2824 | + displayed: cs.display !== 'none' |
2825 | + } |
2826 | + }, |
2827 | + |
2828 | + /** |
2829 | + * Always return false for isActive, since this property alone will not trigger |
2830 | + * a renderer to do anything. |
2831 | + */ |
2832 | + isActive: function() { |
2833 | + return false; |
2834 | + } |
2835 | + |
2836 | +} ); |
2837 | +PIE.RendererBase = { |
2838 | + |
2839 | + /** |
2840 | + * Create a new Renderer class, with the standard constructor, and augmented by |
2841 | + * the RendererBase's members. |
2842 | + * @param proto |
2843 | + */ |
2844 | + newRenderer: function( proto ) { |
2845 | + function Renderer( el, boundsInfo, styleInfos, parent ) { |
2846 | + this.targetElement = el; |
2847 | + this.boundsInfo = boundsInfo; |
2848 | + this.styleInfos = styleInfos; |
2849 | + this.parent = parent; |
2850 | + } |
2851 | + PIE.Util.merge( Renderer.prototype, PIE.RendererBase, proto ); |
2852 | + return Renderer; |
2853 | + }, |
2854 | + |
2855 | + /** |
2856 | + * Flag indicating the element has already been positioned at least once. |
2857 | + * @type {boolean} |
2858 | + */ |
2859 | + isPositioned: false, |
2860 | + |
2861 | + /** |
2862 | + * Determine if the renderer needs to be updated |
2863 | + * @return {boolean} |
2864 | + */ |
2865 | + needsUpdate: function() { |
2866 | + return false; |
2867 | + }, |
2868 | + |
2869 | + /** |
2870 | + * Run any preparation logic that would affect the main update logic of this |
2871 | + * renderer or any of the other renderers, e.g. things that might affect the |
2872 | + * element's size or style properties. |
2873 | + */ |
2874 | + prepareUpdate: PIE.emptyFn, |
2875 | + |
2876 | + /** |
2877 | + * Tell the renderer to update based on modified properties |
2878 | + */ |
2879 | + updateProps: function() { |
2880 | + this.destroy(); |
2881 | + if( this.isActive() ) { |
2882 | + this.draw(); |
2883 | + } |
2884 | + }, |
2885 | + |
2886 | + /** |
2887 | + * Tell the renderer to update based on modified element position |
2888 | + */ |
2889 | + updatePos: function() { |
2890 | + this.isPositioned = true; |
2891 | + }, |
2892 | + |
2893 | + /** |
2894 | + * Tell the renderer to update based on modified element dimensions |
2895 | + */ |
2896 | + updateSize: function() { |
2897 | + if( this.isActive() ) { |
2898 | + this.draw(); |
2899 | + } else { |
2900 | + this.destroy(); |
2901 | + } |
2902 | + }, |
2903 | + |
2904 | + |
2905 | + /** |
2906 | + * Add a layer element, with the given z-order index, to the renderer's main box element. We can't use |
2907 | + * z-index because that breaks when the root rendering box's z-index is 'auto' in IE8+ standards mode. |
2908 | + * So instead we make sure they are inserted into the DOM in the correct order. |
2909 | + * @param {number} index |
2910 | + * @param {Element} el |
2911 | + */ |
2912 | + addLayer: function( index, el ) { |
2913 | + this.removeLayer( index ); |
2914 | + for( var layers = this._layers || ( this._layers = [] ), i = index + 1, len = layers.length, layer; i < len; i++ ) { |
2915 | + layer = layers[i]; |
2916 | + if( layer ) { |
2917 | + break; |
2918 | + } |
2919 | + } |
2920 | + layers[index] = el; |
2921 | + this.getBox().insertBefore( el, layer || null ); |
2922 | + }, |
2923 | + |
2924 | + /** |
2925 | + * Retrieve a layer element by its index, or null if not present |
2926 | + * @param {number} index |
2927 | + * @return {Element} |
2928 | + */ |
2929 | + getLayer: function( index ) { |
2930 | + var layers = this._layers; |
2931 | + return layers && layers[index] || null; |
2932 | + }, |
2933 | + |
2934 | + /** |
2935 | + * Remove a layer element by its index |
2936 | + * @param {number} index |
2937 | + */ |
2938 | + removeLayer: function( index ) { |
2939 | + var layer = this.getLayer( index ), |
2940 | + box = this._box; |
2941 | + if( layer && box ) { |
2942 | + box.removeChild( layer ); |
2943 | + this._layers[index] = null; |
2944 | + } |
2945 | + }, |
2946 | + |
2947 | + |
2948 | + /** |
2949 | + * Get a VML shape by name, creating it if necessary. |
2950 | + * @param {string} name A name identifying the element |
2951 | + * @param {string=} subElName If specified a subelement of the shape will be created with this tag name |
2952 | + * @param {Element} parent The parent element for the shape; will be ignored if 'group' is specified |
2953 | + * @param {number=} group If specified, an ordinal group for the shape. 1 or greater. Groups are rendered |
2954 | + * using container elements in the correct order, to get correct z stacking without z-index. |
2955 | + */ |
2956 | + getShape: function( name, subElName, parent, group ) { |
2957 | + var shapes = this._shapes || ( this._shapes = {} ), |
2958 | + shape = shapes[ name ], |
2959 | + s; |
2960 | + |
2961 | + if( !shape ) { |
2962 | + shape = shapes[ name ] = PIE.Util.createVmlElement( 'shape' ); |
2963 | + if( subElName ) { |
2964 | + shape.appendChild( shape[ subElName ] = PIE.Util.createVmlElement( subElName ) ); |
2965 | + } |
2966 | + |
2967 | + if( group ) { |
2968 | + parent = this.getLayer( group ); |
2969 | + if( !parent ) { |
2970 | + this.addLayer( group, doc.createElement( 'group' + group ) ); |
2971 | + parent = this.getLayer( group ); |
2972 | + } |
2973 | + } |
2974 | + |
2975 | + parent.appendChild( shape ); |
2976 | + |
2977 | + s = shape.style; |
2978 | + s.position = 'absolute'; |
2979 | + s.left = s.top = 0; |
2980 | + s['behavior'] = 'url(#default#VML)'; |
2981 | + } |
2982 | + return shape; |
2983 | + }, |
2984 | + |
2985 | + /** |
2986 | + * Delete a named shape which was created by getShape(). Returns true if a shape with the |
2987 | + * given name was found and deleted, or false if there was no shape of that name. |
2988 | + * @param {string} name |
2989 | + * @return {boolean} |
2990 | + */ |
2991 | + deleteShape: function( name ) { |
2992 | + var shapes = this._shapes, |
2993 | + shape = shapes && shapes[ name ]; |
2994 | + if( shape ) { |
2995 | + shape.parentNode.removeChild( shape ); |
2996 | + delete shapes[ name ]; |
2997 | + } |
2998 | + return !!shape; |
2999 | + }, |
3000 | + |
3001 | + |
3002 | + /** |
3003 | + * For a given set of border radius length/percentage values, convert them to concrete pixel |
3004 | + * values based on the current size of the target element. |
3005 | + * @param {Object} radii |
3006 | + * @return {Object} |
3007 | + */ |
3008 | + getRadiiPixels: function( radii ) { |
3009 | + var el = this.targetElement, |
3010 | + bounds = this.boundsInfo.getBounds(), |
3011 | + w = bounds.w, |
3012 | + h = bounds.h, |
3013 | + tlX, tlY, trX, trY, brX, brY, blX, blY, f; |
3014 | + |
3015 | + tlX = radii.x['tl'].pixels( el, w ); |
3016 | + tlY = radii.y['tl'].pixels( el, h ); |
3017 | + trX = radii.x['tr'].pixels( el, w ); |
3018 | + trY = radii.y['tr'].pixels( el, h ); |
3019 | + brX = radii.x['br'].pixels( el, w ); |
3020 | + brY = radii.y['br'].pixels( el, h ); |
3021 | + blX = radii.x['bl'].pixels( el, w ); |
3022 | + blY = radii.y['bl'].pixels( el, h ); |
3023 | + |
3024 | + // If any corner ellipses overlap, reduce them all by the appropriate factor. This formula |
3025 | + // is taken straight from the CSS3 Backgrounds and Borders spec. |
3026 | + f = Math.min( |
3027 | + w / ( tlX + trX ), |
3028 | + h / ( trY + brY ), |
3029 | + w / ( blX + brX ), |
3030 | + h / ( tlY + blY ) |
3031 | + ); |
3032 | + if( f < 1 ) { |
3033 | + tlX *= f; |
3034 | + tlY *= f; |
3035 | + trX *= f; |
3036 | + trY *= f; |
3037 | + brX *= f; |
3038 | + brY *= f; |
3039 | + blX *= f; |
3040 | + blY *= f; |
3041 | + } |
3042 | + |
3043 | + return { |
3044 | + x: { |
3045 | + 'tl': tlX, |
3046 | + 'tr': trX, |
3047 | + 'br': brX, |
3048 | + 'bl': blX |
3049 | + }, |
3050 | + y: { |
3051 | + 'tl': tlY, |
3052 | + 'tr': trY, |
3053 | + 'br': brY, |
3054 | + 'bl': blY |
3055 | + } |
3056 | + } |
3057 | + }, |
3058 | + |
3059 | + /** |
3060 | + * Return the VML path string for the element's background box, with corners rounded. |
3061 | + * @param {Object.<{t:number, r:number, b:number, l:number}>} shrink - if present, specifies number of |
3062 | + * pixels to shrink the box path inward from the element's four sides. |
3063 | + * @param {number=} mult If specified, all coordinates will be multiplied by this number |
3064 | + * @param {Object=} radii If specified, this will be used for the corner radii instead of the properties |
3065 | + * from this renderer's borderRadiusInfo object. |
3066 | + * @return {string} the VML path |
3067 | + */ |
3068 | + getBoxPath: function( shrink, mult, radii ) { |
3069 | + mult = mult || 1; |
3070 | + |
3071 | + var r, str, |
3072 | + bounds = this.boundsInfo.getBounds(), |
3073 | + w = bounds.w * mult, |
3074 | + h = bounds.h * mult, |
3075 | + radInfo = this.styleInfos.borderRadiusInfo, |
3076 | + floor = Math.floor, ceil = Math.ceil, |
3077 | + shrinkT = shrink ? shrink.t * mult : 0, |
3078 | + shrinkR = shrink ? shrink.r * mult : 0, |
3079 | + shrinkB = shrink ? shrink.b * mult : 0, |
3080 | + shrinkL = shrink ? shrink.l * mult : 0, |
3081 | + tlX, tlY, trX, trY, brX, brY, blX, blY; |
3082 | + |
3083 | + if( radii || radInfo.isActive() ) { |
3084 | + r = this.getRadiiPixels( radii || radInfo.getProps() ); |
3085 | + |
3086 | + tlX = r.x['tl'] * mult; |
3087 | + tlY = r.y['tl'] * mult; |
3088 | + trX = r.x['tr'] * mult; |
3089 | + trY = r.y['tr'] * mult; |
3090 | + brX = r.x['br'] * mult; |
3091 | + brY = r.y['br'] * mult; |
3092 | + blX = r.x['bl'] * mult; |
3093 | + blY = r.y['bl'] * mult; |
3094 | + |
3095 | + str = 'm' + floor( shrinkL ) + ',' + floor( tlY ) + |
3096 | + 'qy' + floor( tlX ) + ',' + floor( shrinkT ) + |
3097 | + 'l' + ceil( w - trX ) + ',' + floor( shrinkT ) + |
3098 | + 'qx' + ceil( w - shrinkR ) + ',' + floor( trY ) + |
3099 | + 'l' + ceil( w - shrinkR ) + ',' + ceil( h - brY ) + |
3100 | + 'qy' + ceil( w - brX ) + ',' + ceil( h - shrinkB ) + |
3101 | + 'l' + floor( blX ) + ',' + ceil( h - shrinkB ) + |
3102 | + 'qx' + floor( shrinkL ) + ',' + ceil( h - blY ) + ' x e'; |
3103 | + } else { |
3104 | + // simplified path for non-rounded box |
3105 | + str = 'm' + floor( shrinkL ) + ',' + floor( shrinkT ) + |
3106 | + 'l' + ceil( w - shrinkR ) + ',' + floor( shrinkT ) + |
3107 | + 'l' + ceil( w - shrinkR ) + ',' + ceil( h - shrinkB ) + |
3108 | + 'l' + floor( shrinkL ) + ',' + ceil( h - shrinkB ) + |
3109 | + 'xe'; |
3110 | + } |
3111 | + return str; |
3112 | + }, |
3113 | + |
3114 | + |
3115 | + /** |
3116 | + * Get the container element for the shapes, creating it if necessary. |
3117 | + */ |
3118 | + getBox: function() { |
3119 | + var box = this.parent.getLayer( this.boxZIndex ), s; |
3120 | + |
3121 | + if( !box ) { |
3122 | + box = doc.createElement( this.boxName ); |
3123 | + s = box.style; |
3124 | + s.position = 'absolute'; |
3125 | + s.top = s.left = 0; |
3126 | + this.parent.addLayer( this.boxZIndex, box ); |
3127 | + } |
3128 | + |
3129 | + return box; |
3130 | + }, |
3131 | + |
3132 | + |
3133 | + /** |
3134 | + * Hide the actual border of the element. In IE7 and up we can just set its color to transparent; |
3135 | + * however IE6 does not support transparent borders so we have to get tricky with it. Also, some elements |
3136 | + * like form buttons require removing the border width altogether, so for those we increase the padding |
3137 | + * by the border size. |
3138 | + */ |
3139 | + hideBorder: function() { |
3140 | + var el = this.targetElement, |
3141 | + cs = el.currentStyle, |
3142 | + rs = el.runtimeStyle, |
3143 | + tag = el.tagName, |
3144 | + isIE6 = PIE.ieVersion === 6, |
3145 | + sides, side, i; |
3146 | + |
3147 | + if( ( isIE6 && ( tag in PIE.childlessElements || tag === 'FIELDSET' ) ) || |
3148 | + tag === 'BUTTON' || ( tag === 'INPUT' && el.type in PIE.inputButtonTypes ) ) { |
3149 | + rs.borderWidth = ''; |
3150 | + sides = this.styleInfos.borderInfo.sides; |
3151 | + for( i = sides.length; i--; ) { |
3152 | + side = sides[ i ]; |
3153 | + rs[ 'padding' + side ] = ''; |
3154 | + rs[ 'padding' + side ] = ( PIE.getLength( cs[ 'padding' + side ] ) ).pixels( el ) + |
3155 | + ( PIE.getLength( cs[ 'border' + side + 'Width' ] ) ).pixels( el ) + |
3156 | + ( PIE.ieVersion !== 8 && i % 2 ? 1 : 0 ); //needs an extra horizontal pixel to counteract the extra "inner border" going away |
3157 | + } |
3158 | + rs.borderWidth = 0; |
3159 | + } |
3160 | + else if( isIE6 ) { |
3161 | + // Wrap all the element's children in a custom element, set the element to visiblity:hidden, |
3162 | + // and set the wrapper element to visiblity:visible. This hides the outer element's decorations |
3163 | + // (background and border) but displays all the contents. |
3164 | + // TODO find a better way to do this that doesn't mess up the DOM parent-child relationship, |
3165 | + // as this can interfere with other author scripts which add/modify/delete children. Also, this |
3166 | + // won't work for elements which cannot take children, e.g. input/button/textarea/img/etc. Look into |
3167 | + // using a compositor filter or some other filter which masks the border. |
3168 | + if( el.childNodes.length !== 1 || el.firstChild.tagName !== 'ie6-mask' ) { |
3169 | + var cont = doc.createElement( 'ie6-mask' ), |
3170 | + s = cont.style, child; |
3171 | + s.visibility = 'visible'; |
3172 | + s.zoom = 1; |
3173 | + while( child = el.firstChild ) { |
3174 | + cont.appendChild( child ); |
3175 | + } |
3176 | + el.appendChild( cont ); |
3177 | + rs.visibility = 'hidden'; |
3178 | + } |
3179 | + } |
3180 | + else { |
3181 | + rs.borderColor = 'transparent'; |
3182 | + } |
3183 | + }, |
3184 | + |
3185 | + unhideBorder: function() { |
3186 | + |
3187 | + }, |
3188 | + |
3189 | + |
3190 | + /** |
3191 | + * Destroy the rendered objects. This is a base implementation which handles common renderer |
3192 | + * structures, but individual renderers may override as necessary. |
3193 | + */ |
3194 | + destroy: function() { |
3195 | + this.parent.removeLayer( this.boxZIndex ); |
3196 | + delete this._shapes; |
3197 | + delete this._layers; |
3198 | + } |
3199 | +}; |
3200 | +/** |
3201 | + * Root renderer; creates the outermost container element and handles keeping it aligned |
3202 | + * with the target element's size and position. |
3203 | + * @param {Element} el The target element |
3204 | + * @param {Object} styleInfos The StyleInfo objects |
3205 | + */ |
3206 | +PIE.RootRenderer = PIE.RendererBase.newRenderer( { |
3207 | + |
3208 | + isActive: function() { |
3209 | + var children = this.childRenderers; |
3210 | + for( var i in children ) { |
3211 | + if( children.hasOwnProperty( i ) && children[ i ].isActive() ) { |
3212 | + return true; |
3213 | + } |
3214 | + } |
3215 | + return false; |
3216 | + }, |
3217 | + |
3218 | + needsUpdate: function() { |
3219 | + return this.styleInfos.visibilityInfo.changed(); |
3220 | + }, |
3221 | + |
3222 | + updatePos: function() { |
3223 | + if( this.isActive() ) { |
3224 | + var el = this.getPositioningElement(), |
3225 | + par = el, |
3226 | + docEl, |
3227 | + parRect, |
3228 | + tgtCS = el.currentStyle, |
3229 | + tgtPos = tgtCS.position, |
3230 | + boxPos, |
3231 | + s = this.getBox().style, cs, |
3232 | + x = 0, y = 0, |
3233 | + elBounds = this.boundsInfo.getBounds(), |
3234 | + logicalZoomRatio = elBounds.logicalZoomRatio; |
3235 | + |
3236 | + if( tgtPos === 'fixed' && PIE.ieVersion > 6 ) { |
3237 | + x = elBounds.x * logicalZoomRatio; |
3238 | + y = elBounds.y * logicalZoomRatio; |
3239 | + boxPos = tgtPos; |
3240 | + } else { |
3241 | + // Get the element's offsets from its nearest positioned ancestor. Uses |
3242 | + // getBoundingClientRect for accuracy and speed. |
3243 | + do { |
3244 | + par = par.offsetParent; |
3245 | + } while( par && ( par.currentStyle.position === 'static' ) ); |
3246 | + if( par ) { |
3247 | + parRect = par.getBoundingClientRect(); |
3248 | + cs = par.currentStyle; |
3249 | + x = ( elBounds.x - parRect.left ) * logicalZoomRatio - ( parseFloat(cs.borderLeftWidth) || 0 ); |
3250 | + y = ( elBounds.y - parRect.top ) * logicalZoomRatio - ( parseFloat(cs.borderTopWidth) || 0 ); |
3251 | + } else { |
3252 | + docEl = doc.documentElement; |
3253 | + x = ( elBounds.x + docEl.scrollLeft - docEl.clientLeft ) * logicalZoomRatio; |
3254 | + y = ( elBounds.y + docEl.scrollTop - docEl.clientTop ) * logicalZoomRatio; |
3255 | + } |
3256 | + boxPos = 'absolute'; |
3257 | + } |
3258 | + |
3259 | + s.position = boxPos; |
3260 | + s.left = x; |
3261 | + s.top = y; |
3262 | + s.zIndex = tgtPos === 'static' ? -1 : tgtCS.zIndex; |
3263 | + this.isPositioned = true; |
3264 | + } |
3265 | + }, |
3266 | + |
3267 | + updateSize: PIE.emptyFn, |
3268 | + |
3269 | + updateVisibility: function() { |
3270 | + var vis = this.styleInfos.visibilityInfo.getProps(); |
3271 | + this.getBox().style.display = ( vis.visible && vis.displayed ) ? '' : 'none'; |
3272 | + }, |
3273 | + |
3274 | + updateProps: function() { |
3275 | + if( this.isActive() ) { |
3276 | + this.updateVisibility(); |
3277 | + } else { |
3278 | + this.destroy(); |
3279 | + } |
3280 | + }, |
3281 | + |
3282 | + getPositioningElement: function() { |
3283 | + var el = this.targetElement; |
3284 | + return el.tagName in PIE.tableCellTags ? el.offsetParent : el; |
3285 | + }, |
3286 | + |
3287 | + getBox: function() { |
3288 | + var box = this._box, el; |
3289 | + if( !box ) { |
3290 | + el = this.getPositioningElement(); |
3291 | + box = this._box = doc.createElement( 'css3-container' ); |
3292 | + box.style['direction'] = 'ltr'; //fix positioning bug in rtl environments |
3293 | + |
3294 | + this.updateVisibility(); |
3295 | + |
3296 | + el.parentNode.insertBefore( box, el ); |
3297 | + } |
3298 | + return box; |
3299 | + }, |
3300 | + |
3301 | + finishUpdate: PIE.emptyFn, |
3302 | + |
3303 | + destroy: function() { |
3304 | + var box = this._box, par; |
3305 | + if( box && ( par = box.parentNode ) ) { |
3306 | + par.removeChild( box ); |
3307 | + } |
3308 | + delete this._box; |
3309 | + delete this._layers; |
3310 | + } |
3311 | + |
3312 | +} ); |
3313 | +/** |
3314 | + * Renderer for element backgrounds. |
3315 | + * @constructor |
3316 | + * @param {Element} el The target element |
3317 | + * @param {Object} styleInfos The StyleInfo objects |
3318 | + * @param {PIE.RootRenderer} parent |
3319 | + */ |
3320 | +PIE.BackgroundRenderer = PIE.RendererBase.newRenderer( { |
3321 | + |
3322 | + boxZIndex: 2, |
3323 | + boxName: 'background', |
3324 | + |
3325 | + needsUpdate: function() { |
3326 | + var si = this.styleInfos; |
3327 | + return si.backgroundInfo.changed() || si.borderRadiusInfo.changed(); |
3328 | + }, |
3329 | + |
3330 | + isActive: function() { |
3331 | + var si = this.styleInfos; |
3332 | + return si.borderImageInfo.isActive() || |
3333 | + si.borderRadiusInfo.isActive() || |
3334 | + si.backgroundInfo.isActive() || |
3335 | + ( si.boxShadowInfo.isActive() && si.boxShadowInfo.getProps().inset ); |
3336 | + }, |
3337 | + |
3338 | + /** |
3339 | + * Draw the shapes |
3340 | + */ |
3341 | + draw: function() { |
3342 | + var bounds = this.boundsInfo.getBounds(); |
3343 | + if( bounds.w && bounds.h ) { |
3344 | + this.drawBgColor(); |
3345 | + this.drawBgImages(); |
3346 | + } |
3347 | + }, |
3348 | + |
3349 | + /** |
3350 | + * Draw the background color shape |
3351 | + */ |
3352 | + drawBgColor: function() { |
3353 | + var props = this.styleInfos.backgroundInfo.getProps(), |
3354 | + bounds = this.boundsInfo.getBounds(), |
3355 | + el = this.targetElement, |
3356 | + color = props && props.color, |
3357 | + shape, w, h, s, alpha; |
3358 | + |
3359 | + if( color && color.alpha() > 0 ) { |
3360 | + this.hideBackground(); |
3361 | + |
3362 | + shape = this.getShape( 'bgColor', 'fill', this.getBox(), 1 ); |
3363 | + w = bounds.w; |
3364 | + h = bounds.h; |
3365 | + shape.stroked = false; |
3366 | + shape.coordsize = w * 2 + ',' + h * 2; |
3367 | + shape.coordorigin = '1,1'; |
3368 | + shape.path = this.getBoxPath( null, 2 ); |
3369 | + s = shape.style; |
3370 | + s.width = w; |
3371 | + s.height = h; |
3372 | + shape.fill.color = color.colorValue( el ); |
3373 | + |
3374 | + alpha = color.alpha(); |
3375 | + if( alpha < 1 ) { |
3376 | + shape.fill.opacity = alpha; |
3377 | + } |
3378 | + } else { |
3379 | + this.deleteShape( 'bgColor' ); |
3380 | + } |
3381 | + }, |
3382 | + |
3383 | + /** |
3384 | + * Draw all the background image layers |
3385 | + */ |
3386 | + drawBgImages: function() { |
3387 | + var props = this.styleInfos.backgroundInfo.getProps(), |
3388 | + bounds = this.boundsInfo.getBounds(), |
3389 | + images = props && props.bgImages, |
3390 | + img, shape, w, h, s, i; |
3391 | + |
3392 | + if( images ) { |
3393 | + this.hideBackground(); |
3394 | + |
3395 | + w = bounds.w; |
3396 | + h = bounds.h; |
3397 | + |
3398 | + i = images.length; |
3399 | + while( i-- ) { |
3400 | + img = images[i]; |
3401 | + shape = this.getShape( 'bgImage' + i, 'fill', this.getBox(), 2 ); |
3402 | + |
3403 | + shape.stroked = false; |
3404 | + shape.fill.type = 'tile'; |
3405 | + shape.fillcolor = 'none'; |
3406 | + shape.coordsize = w * 2 + ',' + h * 2; |
3407 | + shape.coordorigin = '1,1'; |
3408 | + shape.path = this.getBoxPath( 0, 2 ); |
3409 | + s = shape.style; |
3410 | + s.width = w; |
3411 | + s.height = h; |
3412 | + |
3413 | + if( img.imgType === 'linear-gradient' ) { |
3414 | + this.addLinearGradient( shape, img ); |
3415 | + } |
3416 | + else { |
3417 | + shape.fill.src = img.imgUrl; |
3418 | + this.positionBgImage( shape, i ); |
3419 | + } |
3420 | + } |
3421 | + } |
3422 | + |
3423 | + // Delete any bgImage shapes previously created which weren't used above |
3424 | + i = images ? images.length : 0; |
3425 | + while( this.deleteShape( 'bgImage' + i++ ) ) {} |
3426 | + }, |
3427 | + |
3428 | + |
3429 | + /** |
3430 | + * Set the position and clipping of the background image for a layer |
3431 | + * @param {Element} shape |
3432 | + * @param {number} index |
3433 | + */ |
3434 | + positionBgImage: function( shape, index ) { |
3435 | + var me = this; |
3436 | + PIE.Util.withImageSize( shape.fill.src, function( size ) { |
3437 | + var el = me.targetElement, |
3438 | + bounds = me.boundsInfo.getBounds(), |
3439 | + elW = bounds.w, |
3440 | + elH = bounds.h; |
3441 | + |
3442 | + // It's possible that the element dimensions are zero now but weren't when the original |
3443 | + // update executed, make sure that's not the case to avoid divide-by-zero error |
3444 | + if( elW && elH ) { |
3445 | + var fill = shape.fill, |
3446 | + si = me.styleInfos, |
3447 | + border = si.borderInfo.getProps(), |
3448 | + bw = border && border.widths, |
3449 | + bwT = bw ? bw['t'].pixels( el ) : 0, |
3450 | + bwR = bw ? bw['r'].pixels( el ) : 0, |
3451 | + bwB = bw ? bw['b'].pixels( el ) : 0, |
3452 | + bwL = bw ? bw['l'].pixels( el ) : 0, |
3453 | + bg = si.backgroundInfo.getProps().bgImages[ index ], |
3454 | + bgPos = bg.bgPosition ? bg.bgPosition.coords( el, elW - size.w - bwL - bwR, elH - size.h - bwT - bwB ) : { x:0, y:0 }, |
3455 | + repeat = bg.imgRepeat, |
3456 | + pxX, pxY, |
3457 | + clipT = 0, clipL = 0, |
3458 | + clipR = elW + 1, clipB = elH + 1, //make sure the default clip region is not inside the box (by a subpixel) |
3459 | + clipAdjust = PIE.ieVersion === 8 ? 0 : 1; //prior to IE8 requires 1 extra pixel in the image clip region |
3460 | + |
3461 | + // Positioning - find the pixel offset from the top/left and convert to a ratio |
3462 | + // The position is shifted by half a pixel, to adjust for the half-pixel coordorigin shift which is |
3463 | + // needed to fix antialiasing but makes the bg image fuzzy. |
3464 | + pxX = Math.round( bgPos.x ) + bwL + 0.5; |
3465 | + pxY = Math.round( bgPos.y ) + bwT + 0.5; |
3466 | + fill.position = ( pxX / elW ) + ',' + ( pxY / elH ); |
3467 | + |
3468 | + // Set the size of the image. We have to actually set it to px values otherwise it will not honor |
3469 | + // the user's browser zoom level and always display at its natural screen size. |
3470 | + fill['size']['x'] = 1; //Can be any value, just has to be set to "prime" it so the next line works. Weird! |
3471 | + fill['size'] = size.w + 'px,' + size.h + 'px'; |
3472 | + |
3473 | + // Repeating - clip the image shape |
3474 | + if( repeat && repeat !== 'repeat' ) { |
3475 | + if( repeat === 'repeat-x' || repeat === 'no-repeat' ) { |
3476 | + clipT = pxY + 1; |
3477 | + clipB = pxY + size.h + clipAdjust; |
3478 | + } |
3479 | + if( repeat === 'repeat-y' || repeat === 'no-repeat' ) { |
3480 | + clipL = pxX + 1; |
3481 | + clipR = pxX + size.w + clipAdjust; |
3482 | + } |
3483 | + shape.style.clip = 'rect(' + clipT + 'px,' + clipR + 'px,' + clipB + 'px,' + clipL + 'px)'; |
3484 | + } |
3485 | + } |
3486 | + } ); |
3487 | + }, |
3488 | + |
3489 | + |
3490 | + /** |
3491 | + * Draw the linear gradient for a gradient layer |
3492 | + * @param {Element} shape |
3493 | + * @param {Object} info The object holding the information about the gradient |
3494 | + */ |
3495 | + addLinearGradient: function( shape, info ) { |
3496 | + var el = this.targetElement, |
3497 | + bounds = this.boundsInfo.getBounds(), |
3498 | + w = bounds.w, |
3499 | + h = bounds.h, |
3500 | + fill = shape.fill, |
3501 | + stops = info.stops, |
3502 | + stopCount = stops.length, |
3503 | + PI = Math.PI, |
3504 | + GradientUtil = PIE.GradientUtil, |
3505 | + perpendicularIntersect = GradientUtil.perpendicularIntersect, |
3506 | + distance = GradientUtil.distance, |
3507 | + metrics = GradientUtil.getGradientMetrics( el, w, h, info ), |
3508 | + angle = metrics.angle, |
3509 | + startX = metrics.startX, |
3510 | + startY = metrics.startY, |
3511 | + startCornerX = metrics.startCornerX, |
3512 | + startCornerY = metrics.startCornerY, |
3513 | + endCornerX = metrics.endCornerX, |
3514 | + endCornerY = metrics.endCornerY, |
3515 | + deltaX = metrics.deltaX, |
3516 | + deltaY = metrics.deltaY, |
3517 | + lineLength = metrics.lineLength, |
3518 | + vmlAngle, vmlGradientLength, vmlColors, |
3519 | + stopPx, vmlOffsetPct, |
3520 | + p, i, j, before, after; |
3521 | + |
3522 | + // In VML land, the angle of the rendered gradient depends on the aspect ratio of the shape's |
3523 | + // bounding box; for example specifying a 45 deg angle actually results in a gradient |
3524 | + // drawn diagonally from one corner to its opposite corner, which will only appear to the |
3525 | + // viewer as 45 degrees if the shape is equilateral. We adjust for this by taking the x/y deltas |
3526 | + // between the start and end points, multiply one of them by the shape's aspect ratio, |
3527 | + // and get their arctangent, resulting in an appropriate VML angle. If the angle is perfectly |
3528 | + // horizontal or vertical then we don't need to do this conversion. |
3529 | + vmlAngle = ( angle % 90 ) ? Math.atan2( deltaX * w / h, deltaY ) / PI * 180 : ( angle + 90 ); |
3530 | + |
3531 | + // VML angles are 180 degrees offset from CSS angles |
3532 | + vmlAngle += 180; |
3533 | + vmlAngle = vmlAngle % 360; |
3534 | + |
3535 | + // Add all the stops to the VML 'colors' list, including the first and last stops. |
3536 | + // For each, we find its pixel offset along the gradient-line; if the offset of a stop is less |
3537 | + // than that of its predecessor we increase it to be equal. We then map that pixel offset to a |
3538 | + // percentage along the VML gradient-line, which runs from shape corner to corner. |
3539 | + p = perpendicularIntersect( startCornerX, startCornerY, angle, endCornerX, endCornerY ); |
3540 | + vmlGradientLength = distance( startCornerX, startCornerY, p[0], p[1] ); |
3541 | + vmlColors = []; |
3542 | + p = perpendicularIntersect( startX, startY, angle, startCornerX, startCornerY ); |
3543 | + vmlOffsetPct = distance( startX, startY, p[0], p[1] ) / vmlGradientLength * 100; |
3544 | + |
3545 | + // Find the pixel offsets along the CSS3 gradient-line for each stop. |
3546 | + stopPx = []; |
3547 | + for( i = 0; i < stopCount; i++ ) { |
3548 | + stopPx.push( stops[i].offset ? stops[i].offset.pixels( el, lineLength ) : |
3549 | + i === 0 ? 0 : i === stopCount - 1 ? lineLength : null ); |
3550 | + } |
3551 | + // Fill in gaps with evenly-spaced offsets |
3552 | + for( i = 1; i < stopCount; i++ ) { |
3553 | + if( stopPx[ i ] === null ) { |
3554 | + before = stopPx[ i - 1 ]; |
3555 | + j = i; |
3556 | + do { |
3557 | + after = stopPx[ ++j ]; |
3558 | + } while( after === null ); |
3559 | + stopPx[ i ] = before + ( after - before ) / ( j - i + 1 ); |
3560 | + } |
3561 | + // Make sure each stop's offset is no less than the one before it |
3562 | + stopPx[ i ] = Math.max( stopPx[ i ], stopPx[ i - 1 ] ); |
3563 | + } |
3564 | + |
3565 | + // Convert to percentage along the VML gradient line and add to the VML 'colors' value |
3566 | + for( i = 0; i < stopCount; i++ ) { |
3567 | + vmlColors.push( |
3568 | + ( vmlOffsetPct + ( stopPx[ i ] / vmlGradientLength * 100 ) ) + '% ' + stops[i].color.colorValue( el ) |
3569 | + ); |
3570 | + } |
3571 | + |
3572 | + // Now, finally, we're ready to render the gradient fill. Set the start and end colors to |
3573 | + // the first and last stop colors; this just sets outer bounds for the gradient. |
3574 | + fill['angle'] = vmlAngle; |
3575 | + fill['type'] = 'gradient'; |
3576 | + fill['method'] = 'sigma'; |
3577 | + fill['color'] = stops[0].color.colorValue( el ); |
3578 | + fill['color2'] = stops[stopCount - 1].color.colorValue( el ); |
3579 | + if( fill['colors'] ) { //sometimes the colors object isn't initialized so we have to assign it directly (?) |
3580 | + fill['colors'].value = vmlColors.join( ',' ); |
3581 | + } else { |
3582 | + fill['colors'] = vmlColors.join( ',' ); |
3583 | + } |
3584 | + }, |
3585 | + |
3586 | + |
3587 | + /** |
3588 | + * Hide the actual background image and color of the element. |
3589 | + */ |
3590 | + hideBackground: function() { |
3591 | + var rs = this.targetElement.runtimeStyle; |
3592 | + rs.backgroundImage = 'url(about:blank)'; //ensures the background area reacts to mouse events |
3593 | + rs.backgroundColor = 'transparent'; |
3594 | + }, |
3595 | + |
3596 | + destroy: function() { |
3597 | + PIE.RendererBase.destroy.call( this ); |
3598 | + var rs = this.targetElement.runtimeStyle; |
3599 | + rs.backgroundImage = rs.backgroundColor = ''; |
3600 | + } |
3601 | + |
3602 | +} ); |
3603 | +/** |
3604 | + * Renderer for element borders. |
3605 | + * @constructor |
3606 | + * @param {Element} el The target element |
3607 | + * @param {Object} styleInfos The StyleInfo objects |
3608 | + * @param {PIE.RootRenderer} parent |
3609 | + */ |
3610 | +PIE.BorderRenderer = PIE.RendererBase.newRenderer( { |
3611 | + |
3612 | + boxZIndex: 4, |
3613 | + boxName: 'border', |
3614 | + |
3615 | + needsUpdate: function() { |
3616 | + var si = this.styleInfos; |
3617 | + return si.borderInfo.changed() || si.borderRadiusInfo.changed(); |
3618 | + }, |
3619 | + |
3620 | + isActive: function() { |
3621 | + var si = this.styleInfos; |
3622 | + return si.borderRadiusInfo.isActive() && |
3623 | + !si.borderImageInfo.isActive() && |
3624 | + si.borderInfo.isActive(); //check BorderStyleInfo last because it's the most expensive |
3625 | + }, |
3626 | + |
3627 | + /** |
3628 | + * Draw the border shape(s) |
3629 | + */ |
3630 | + draw: function() { |
3631 | + var el = this.targetElement, |
3632 | + props = this.styleInfos.borderInfo.getProps(), |
3633 | + bounds = this.boundsInfo.getBounds(), |
3634 | + w = bounds.w, |
3635 | + h = bounds.h, |
3636 | + shape, stroke, s, |
3637 | + segments, seg, i, len; |
3638 | + |
3639 | + if( props ) { |
3640 | + this.hideBorder(); |
3641 | + |
3642 | + segments = this.getBorderSegments( 2 ); |
3643 | + for( i = 0, len = segments.length; i < len; i++) { |
3644 | + seg = segments[i]; |
3645 | + shape = this.getShape( 'borderPiece' + i, seg.stroke ? 'stroke' : 'fill', this.getBox() ); |
3646 | + shape.coordsize = w * 2 + ',' + h * 2; |
3647 | + shape.coordorigin = '1,1'; |
3648 | + shape.path = seg.path; |
3649 | + s = shape.style; |
3650 | + s.width = w; |
3651 | + s.height = h; |
3652 | + |
3653 | + shape.filled = !!seg.fill; |
3654 | + shape.stroked = !!seg.stroke; |
3655 | + if( seg.stroke ) { |
3656 | + stroke = shape.stroke; |
3657 | + stroke['weight'] = seg.weight + 'px'; |
3658 | + stroke.color = seg.color.colorValue( el ); |
3659 | + stroke['dashstyle'] = seg.stroke === 'dashed' ? '2 2' : seg.stroke === 'dotted' ? '1 1' : 'solid'; |
3660 | + stroke['linestyle'] = seg.stroke === 'double' && seg.weight > 2 ? 'ThinThin' : 'Single'; |
3661 | + } else { |
3662 | + shape.fill.color = seg.fill.colorValue( el ); |
3663 | + } |
3664 | + } |
3665 | + |
3666 | + // remove any previously-created border shapes which didn't get used above |
3667 | + while( this.deleteShape( 'borderPiece' + i++ ) ) {} |
3668 | + } |
3669 | + }, |
3670 | + |
3671 | + |
3672 | + /** |
3673 | + * Get the VML path definitions for the border segment(s). |
3674 | + * @param {number=} mult If specified, all coordinates will be multiplied by this number |
3675 | + * @return {Array.<string>} |
3676 | + */ |
3677 | + getBorderSegments: function( mult ) { |
3678 | + var el = this.targetElement, |
3679 | + bounds, elW, elH, |
3680 | + borderInfo = this.styleInfos.borderInfo, |
3681 | + segments = [], |
3682 | + floor, ceil, wT, wR, wB, wL, |
3683 | + round = Math.round, |
3684 | + borderProps, radiusInfo, radii, widths, styles, colors; |
3685 | + |
3686 | + if( borderInfo.isActive() ) { |
3687 | + borderProps = borderInfo.getProps(); |
3688 | + |
3689 | + widths = borderProps.widths; |
3690 | + styles = borderProps.styles; |
3691 | + colors = borderProps.colors; |
3692 | + |
3693 | + if( borderProps.widthsSame && borderProps.stylesSame && borderProps.colorsSame ) { |
3694 | + if( colors['t'].alpha() > 0 ) { |
3695 | + // shortcut for identical border on all sides - only need 1 stroked shape |
3696 | + wT = widths['t'].pixels( el ); //thickness |
3697 | + wR = wT / 2; //shrink |
3698 | + segments.push( { |
3699 | + path: this.getBoxPath( { t: wR, r: wR, b: wR, l: wR }, mult ), |
3700 | + stroke: styles['t'], |
3701 | + color: colors['t'], |
3702 | + weight: wT |
3703 | + } ); |
3704 | + } |
3705 | + } |
3706 | + else { |
3707 | + mult = mult || 1; |
3708 | + bounds = this.boundsInfo.getBounds(); |
3709 | + elW = bounds.w; |
3710 | + elH = bounds.h; |
3711 | + |
3712 | + wT = round( widths['t'].pixels( el ) ); |
3713 | + wR = round( widths['r'].pixels( el ) ); |
3714 | + wB = round( widths['b'].pixels( el ) ); |
3715 | + wL = round( widths['l'].pixels( el ) ); |
3716 | + var pxWidths = { |
3717 | + 't': wT, |
3718 | + 'r': wR, |
3719 | + 'b': wB, |
3720 | + 'l': wL |
3721 | + }; |
3722 | + |
3723 | + radiusInfo = this.styleInfos.borderRadiusInfo; |
3724 | + if( radiusInfo.isActive() ) { |
3725 | + radii = this.getRadiiPixels( radiusInfo.getProps() ); |
3726 | + } |
3727 | + |
3728 | + floor = Math.floor; |
3729 | + ceil = Math.ceil; |
3730 | + |
3731 | + function radius( xy, corner ) { |
3732 | + return radii ? radii[ xy ][ corner ] : 0; |
3733 | + } |
3734 | + |
3735 | + function curve( corner, shrinkX, shrinkY, startAngle, ccw, doMove ) { |
3736 | + var rx = radius( 'x', corner), |
3737 | + ry = radius( 'y', corner), |
3738 | + deg = 65535, |
3739 | + isRight = corner.charAt( 1 ) === 'r', |
3740 | + isBottom = corner.charAt( 0 ) === 'b'; |
3741 | + return ( rx > 0 && ry > 0 ) ? |
3742 | + ( doMove ? 'al' : 'ae' ) + |
3743 | + ( isRight ? ceil( elW - rx ) : floor( rx ) ) * mult + ',' + // center x |
3744 | + ( isBottom ? ceil( elH - ry ) : floor( ry ) ) * mult + ',' + // center y |
3745 | + ( floor( rx ) - shrinkX ) * mult + ',' + // width |
3746 | + ( floor( ry ) - shrinkY ) * mult + ',' + // height |
3747 | + ( startAngle * deg ) + ',' + // start angle |
3748 | + ( 45 * deg * ( ccw ? 1 : -1 ) // angle change |
3749 | + ) : ( |
3750 | + ( doMove ? 'm' : 'l' ) + |
3751 | + ( isRight ? elW - shrinkX : shrinkX ) * mult + ',' + |
3752 | + ( isBottom ? elH - shrinkY : shrinkY ) * mult |
3753 | + ); |
3754 | + } |
3755 | + |
3756 | + function line( side, shrink, ccw, doMove ) { |
3757 | + var |
3758 | + start = ( |
3759 | + side === 't' ? |
3760 | + floor( radius( 'x', 'tl') ) * mult + ',' + ceil( shrink ) * mult : |
3761 | + side === 'r' ? |
3762 | + ceil( elW - shrink ) * mult + ',' + floor( radius( 'y', 'tr') ) * mult : |
3763 | + side === 'b' ? |
3764 | + ceil( elW - radius( 'x', 'br') ) * mult + ',' + floor( elH - shrink ) * mult : |
3765 | + // side === 'l' ? |
3766 | + floor( shrink ) * mult + ',' + ceil( elH - radius( 'y', 'bl') ) * mult |
3767 | + ), |
3768 | + end = ( |
3769 | + side === 't' ? |
3770 | + ceil( elW - radius( 'x', 'tr') ) * mult + ',' + ceil( shrink ) * mult : |
3771 | + side === 'r' ? |
3772 | + ceil( elW - shrink ) * mult + ',' + ceil( elH - radius( 'y', 'br') ) * mult : |
3773 | + side === 'b' ? |
3774 | + floor( radius( 'x', 'bl') ) * mult + ',' + floor( elH - shrink ) * mult : |
3775 | + // side === 'l' ? |
3776 | + floor( shrink ) * mult + ',' + floor( radius( 'y', 'tl') ) * mult |
3777 | + ); |
3778 | + return ccw ? ( doMove ? 'm' + end : '' ) + 'l' + start : |
3779 | + ( doMove ? 'm' + start : '' ) + 'l' + end; |
3780 | + } |
3781 | + |
3782 | + |
3783 | + function addSide( side, sideBefore, sideAfter, cornerBefore, cornerAfter, baseAngle ) { |
3784 | + var vert = side === 'l' || side === 'r', |
3785 | + sideW = pxWidths[ side ], |
3786 | + beforeX, beforeY, afterX, afterY; |
3787 | + |
3788 | + if( sideW > 0 && styles[ side ] !== 'none' && colors[ side ].alpha() > 0 ) { |
3789 | + beforeX = pxWidths[ vert ? side : sideBefore ]; |
3790 | + beforeY = pxWidths[ vert ? sideBefore : side ]; |
3791 | + afterX = pxWidths[ vert ? side : sideAfter ]; |
3792 | + afterY = pxWidths[ vert ? sideAfter : side ]; |
3793 | + |
3794 | + if( styles[ side ] === 'dashed' || styles[ side ] === 'dotted' ) { |
3795 | + segments.push( { |
3796 | + path: curve( cornerBefore, beforeX, beforeY, baseAngle + 45, 0, 1 ) + |
3797 | + curve( cornerBefore, 0, 0, baseAngle, 1, 0 ), |
3798 | + fill: colors[ side ] |
3799 | + } ); |
3800 | + segments.push( { |
3801 | + path: line( side, sideW / 2, 0, 1 ), |
3802 | + stroke: styles[ side ], |
3803 | + weight: sideW, |
3804 | + color: colors[ side ] |
3805 | + } ); |
3806 | + segments.push( { |
3807 | + path: curve( cornerAfter, afterX, afterY, baseAngle, 0, 1 ) + |
3808 | + curve( cornerAfter, 0, 0, baseAngle - 45, 1, 0 ), |
3809 | + fill: colors[ side ] |
3810 | + } ); |
3811 | + } |
3812 | + else { |
3813 | + segments.push( { |
3814 | + path: curve( cornerBefore, beforeX, beforeY, baseAngle + 45, 0, 1 ) + |
3815 | + line( side, sideW, 0, 0 ) + |
3816 | + curve( cornerAfter, afterX, afterY, baseAngle, 0, 0 ) + |
3817 | + |
3818 | + ( styles[ side ] === 'double' && sideW > 2 ? |
3819 | + curve( cornerAfter, afterX - floor( afterX / 3 ), afterY - floor( afterY / 3 ), baseAngle - 45, 1, 0 ) + |
3820 | + line( side, ceil( sideW / 3 * 2 ), 1, 0 ) + |
3821 | + curve( cornerBefore, beforeX - floor( beforeX / 3 ), beforeY - floor( beforeY / 3 ), baseAngle, 1, 0 ) + |
3822 | + 'x ' + |
3823 | + curve( cornerBefore, floor( beforeX / 3 ), floor( beforeY / 3 ), baseAngle + 45, 0, 1 ) + |
3824 | + line( side, floor( sideW / 3 ), 1, 0 ) + |
3825 | + curve( cornerAfter, floor( afterX / 3 ), floor( afterY / 3 ), baseAngle, 0, 0 ) |
3826 | + : '' ) + |
3827 | + |
3828 | + curve( cornerAfter, 0, 0, baseAngle - 45, 1, 0 ) + |
3829 | + line( side, 0, 1, 0 ) + |
3830 | + curve( cornerBefore, 0, 0, baseAngle, 1, 0 ), |
3831 | + fill: colors[ side ] |
3832 | + } ); |
3833 | + } |
3834 | + } |
3835 | + } |
3836 | + |
3837 | + addSide( 't', 'l', 'r', 'tl', 'tr', 90 ); |
3838 | + addSide( 'r', 't', 'b', 'tr', 'br', 0 ); |
3839 | + addSide( 'b', 'r', 'l', 'br', 'bl', -90 ); |
3840 | + addSide( 'l', 'b', 't', 'bl', 'tl', -180 ); |
3841 | + } |
3842 | + } |
3843 | + |
3844 | + return segments; |
3845 | + }, |
3846 | + |
3847 | + destroy: function() { |
3848 | + var me = this; |
3849 | + if (me.finalized || !me.styleInfos.borderImageInfo.isActive()) { |
3850 | + me.targetElement.runtimeStyle.borderColor = ''; |
3851 | + } |
3852 | + PIE.RendererBase.destroy.call( me ); |
3853 | + } |
3854 | + |
3855 | + |
3856 | +} ); |
3857 | +/** |
3858 | + * Renderer for border-image |
3859 | + * @constructor |
3860 | + * @param {Element} el The target element |
3861 | + * @param {Object} styleInfos The StyleInfo objects |
3862 | + * @param {PIE.RootRenderer} parent |
3863 | + */ |
3864 | +PIE.BorderImageRenderer = PIE.RendererBase.newRenderer( { |
3865 | + |
3866 | + boxZIndex: 5, |
3867 | + pieceNames: [ 't', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl', 'c' ], |
3868 | + |
3869 | + needsUpdate: function() { |
3870 | + return this.styleInfos.borderImageInfo.changed(); |
3871 | + }, |
3872 | + |
3873 | + isActive: function() { |
3874 | + return this.styleInfos.borderImageInfo.isActive(); |
3875 | + }, |
3876 | + |
3877 | + draw: function() { |
3878 | + this.getBox(); //make sure pieces are created |
3879 | + |
3880 | + var props = this.styleInfos.borderImageInfo.getProps(), |
3881 | + borderProps = this.styleInfos.borderInfo.getProps(), |
3882 | + bounds = this.boundsInfo.getBounds(), |
3883 | + el = this.targetElement, |
3884 | + pieces = this.pieces; |
3885 | + |
3886 | + PIE.Util.withImageSize( props.src, function( imgSize ) { |
3887 | + var elW = bounds.w, |
3888 | + elH = bounds.h, |
3889 | + zero = PIE.getLength( '0' ), |
3890 | + widths = props.widths || ( borderProps ? borderProps.widths : { 't': zero, 'r': zero, 'b': zero, 'l': zero } ), |
3891 | + widthT = widths['t'].pixels( el ), |
3892 | + widthR = widths['r'].pixels( el ), |
3893 | + widthB = widths['b'].pixels( el ), |
3894 | + widthL = widths['l'].pixels( el ), |
3895 | + slices = props.slice, |
3896 | + sliceT = slices['t'].pixels( el ), |
3897 | + sliceR = slices['r'].pixels( el ), |
3898 | + sliceB = slices['b'].pixels( el ), |
3899 | + sliceL = slices['l'].pixels( el ); |
3900 | + |
3901 | + // Piece positions and sizes |
3902 | + function setSizeAndPos( piece, w, h, x, y ) { |
3903 | + var s = pieces[piece].style, |
3904 | + max = Math.max; |
3905 | + s.width = max(w, 0); |
3906 | + s.height = max(h, 0); |
3907 | + s.left = x; |
3908 | + s.top = y; |
3909 | + } |
3910 | + setSizeAndPos( 'tl', widthL, widthT, 0, 0 ); |
3911 | + setSizeAndPos( 't', elW - widthL - widthR, widthT, widthL, 0 ); |
3912 | + setSizeAndPos( 'tr', widthR, widthT, elW - widthR, 0 ); |
3913 | + setSizeAndPos( 'r', widthR, elH - widthT - widthB, elW - widthR, widthT ); |
3914 | + setSizeAndPos( 'br', widthR, widthB, elW - widthR, elH - widthB ); |
3915 | + setSizeAndPos( 'b', elW - widthL - widthR, widthB, widthL, elH - widthB ); |
3916 | + setSizeAndPos( 'bl', widthL, widthB, 0, elH - widthB ); |
3917 | + setSizeAndPos( 'l', widthL, elH - widthT - widthB, 0, widthT ); |
3918 | + setSizeAndPos( 'c', elW - widthL - widthR, elH - widthT - widthB, widthL, widthT ); |
3919 | + |
3920 | + |
3921 | + // image croppings |
3922 | + function setCrops( sides, crop, val ) { |
3923 | + for( var i=0, len=sides.length; i < len; i++ ) { |
3924 | + pieces[ sides[i] ]['imagedata'][ crop ] = val; |
3925 | + } |
3926 | + } |
3927 | + |
3928 | + // corners |
3929 | + setCrops( [ 'tl', 't', 'tr' ], 'cropBottom', ( imgSize.h - sliceT ) / imgSize.h ); |
3930 | + setCrops( [ 'tl', 'l', 'bl' ], 'cropRight', ( imgSize.w - sliceL ) / imgSize.w ); |
3931 | + setCrops( [ 'bl', 'b', 'br' ], 'cropTop', ( imgSize.h - sliceB ) / imgSize.h ); |
3932 | + setCrops( [ 'tr', 'r', 'br' ], 'cropLeft', ( imgSize.w - sliceR ) / imgSize.w ); |
3933 | + |
3934 | + // edges and center |
3935 | + // TODO right now this treats everything like 'stretch', need to support other schemes |
3936 | + //if( props.repeat.v === 'stretch' ) { |
3937 | + setCrops( [ 'l', 'r', 'c' ], 'cropTop', sliceT / imgSize.h ); |
3938 | + setCrops( [ 'l', 'r', 'c' ], 'cropBottom', sliceB / imgSize.h ); |
3939 | + //} |
3940 | + //if( props.repeat.h === 'stretch' ) { |
3941 | + setCrops( [ 't', 'b', 'c' ], 'cropLeft', sliceL / imgSize.w ); |
3942 | + setCrops( [ 't', 'b', 'c' ], 'cropRight', sliceR / imgSize.w ); |
3943 | + //} |
3944 | + |
3945 | + // center fill |
3946 | + pieces['c'].style.display = props.fill ? '' : 'none'; |
3947 | + }, this ); |
3948 | + }, |
3949 | + |
3950 | + getBox: function() { |
3951 | + var box = this.parent.getLayer( this.boxZIndex ), |
3952 | + s, piece, i, |
3953 | + pieceNames = this.pieceNames, |
3954 | + len = pieceNames.length; |
3955 | + |
3956 | + if( !box ) { |
3957 | + box = doc.createElement( 'border-image' ); |
3958 | + s = box.style; |
3959 | + s.position = 'absolute'; |
3960 | + |
3961 | + this.pieces = {}; |
3962 | + |
3963 | + for( i = 0; i < len; i++ ) { |
3964 | + piece = this.pieces[ pieceNames[i] ] = PIE.Util.createVmlElement( 'rect' ); |
3965 | + piece.appendChild( PIE.Util.createVmlElement( 'imagedata' ) ); |
3966 | + s = piece.style; |
3967 | + s['behavior'] = 'url(#default#VML)'; |
3968 | + s.position = "absolute"; |
3969 | + s.top = s.left = 0; |
3970 | + piece['imagedata'].src = this.styleInfos.borderImageInfo.getProps().src; |
3971 | + piece.stroked = false; |
3972 | + piece.filled = false; |
3973 | + box.appendChild( piece ); |
3974 | + } |
3975 | + |
3976 | + this.parent.addLayer( this.boxZIndex, box ); |
3977 | + } |
3978 | + |
3979 | + return box; |
3980 | + }, |
3981 | + |
3982 | + prepareUpdate: function() { |
3983 | + if (this.isActive()) { |
3984 | + var me = this, |
3985 | + el = me.targetElement, |
3986 | + rs = el.runtimeStyle, |
3987 | + widths = me.styleInfos.borderImageInfo.getProps().widths; |
3988 | + |
3989 | + // Force border-style to solid so it doesn't collapse |
3990 | + rs.borderStyle = 'solid'; |
3991 | + |
3992 | + // If widths specified in border-image shorthand, override border-width |
3993 | + // NOTE px units needed here as this gets used by the IE9 renderer too |
3994 | + if ( widths ) { |
3995 | + rs.borderTopWidth = widths['t'].pixels( el ) + 'px'; |
3996 | + rs.borderRightWidth = widths['r'].pixels( el ) + 'px'; |
3997 | + rs.borderBottomWidth = widths['b'].pixels( el ) + 'px'; |
3998 | + rs.borderLeftWidth = widths['l'].pixels( el ) + 'px'; |
3999 | + } |
4000 | + |
4001 | + // Make the border transparent |
4002 | + me.hideBorder(); |
4003 | + } |
4004 | + }, |
4005 | + |
4006 | + destroy: function() { |
4007 | + var me = this, |
4008 | + rs = me.targetElement.runtimeStyle; |
4009 | + rs.borderStyle = ''; |
4010 | + if (me.finalized || !me.styleInfos.borderInfo.isActive()) { |
4011 | + rs.borderColor = rs.borderWidth = ''; |
4012 | + } |
4013 | + PIE.RendererBase.destroy.call( this ); |
4014 | + } |
4015 | + |
4016 | +} ); |
4017 | +/** |
4018 | + * Renderer for outset box-shadows |
4019 | + * @constructor |
4020 | + * @param {Element} el The target element |
4021 | + * @param {Object} styleInfos The StyleInfo objects |
4022 | + * @param {PIE.RootRenderer} parent |
4023 | + */ |
4024 | +PIE.BoxShadowOutsetRenderer = PIE.RendererBase.newRenderer( { |
4025 | + |
4026 | + boxZIndex: 1, |
4027 | + boxName: 'outset-box-shadow', |
4028 | + |
4029 | + needsUpdate: function() { |
4030 | + var si = this.styleInfos; |
4031 | + return si.boxShadowInfo.changed() || si.borderRadiusInfo.changed(); |
4032 | + }, |
4033 | + |
4034 | + isActive: function() { |
4035 | + var boxShadowInfo = this.styleInfos.boxShadowInfo; |
4036 | + return boxShadowInfo.isActive() && boxShadowInfo.getProps().outset[0]; |
4037 | + }, |
4038 | + |
4039 | + draw: function() { |
4040 | + var me = this, |
4041 | + el = this.targetElement, |
4042 | + box = this.getBox(), |
4043 | + styleInfos = this.styleInfos, |
4044 | + shadowInfos = styleInfos.boxShadowInfo.getProps().outset, |
4045 | + radii = styleInfos.borderRadiusInfo.getProps(), |
4046 | + len = shadowInfos.length, |
4047 | + i = len, j, |
4048 | + bounds = this.boundsInfo.getBounds(), |
4049 | + w = bounds.w, |
4050 | + h = bounds.h, |
4051 | + clipAdjust = PIE.ieVersion === 8 ? 1 : 0, //workaround for IE8 bug where VML leaks out top/left of clip region by 1px |
4052 | + corners = [ 'tl', 'tr', 'br', 'bl' ], corner, |
4053 | + shadowInfo, shape, fill, ss, xOff, yOff, spread, blur, shrink, color, alpha, path, |
4054 | + totalW, totalH, focusX, focusY, isBottom, isRight; |
4055 | + |
4056 | + |
4057 | + function getShadowShape( index, corner, xOff, yOff, color, blur, path ) { |
4058 | + var shape = me.getShape( 'shadow' + index + corner, 'fill', box, len - index ), |
4059 | + fill = shape.fill; |
4060 | + |
4061 | + // Position and size |
4062 | + shape['coordsize'] = w * 2 + ',' + h * 2; |
4063 | + shape['coordorigin'] = '1,1'; |
4064 | + |
4065 | + // Color and opacity |
4066 | + shape['stroked'] = false; |
4067 | + shape['filled'] = true; |
4068 | + fill.color = color.colorValue( el ); |
4069 | + if( blur ) { |
4070 | + fill['type'] = 'gradienttitle'; //makes the VML gradient follow the shape's outline - hooray for undocumented features?!?! |
4071 | + fill['color2'] = fill.color; |
4072 | + fill['opacity'] = 0; |
4073 | + } |
4074 | + |
4075 | + // Path |
4076 | + shape.path = path; |
4077 | + |
4078 | + // This needs to go last for some reason, to prevent rendering at incorrect size |
4079 | + ss = shape.style; |
4080 | + ss.left = xOff; |
4081 | + ss.top = yOff; |
4082 | + ss.width = w; |
4083 | + ss.height = h; |
4084 | + |
4085 | + return shape; |
4086 | + } |
4087 | + |
4088 | + |
4089 | + while( i-- ) { |
4090 | + shadowInfo = shadowInfos[ i ]; |
4091 | + xOff = shadowInfo.xOffset.pixels( el ); |
4092 | + yOff = shadowInfo.yOffset.pixels( el ); |
4093 | + spread = shadowInfo.spread.pixels( el ); |
4094 | + blur = shadowInfo.blur.pixels( el ); |
4095 | + color = shadowInfo.color; |
4096 | + // Shape path |
4097 | + shrink = -spread - blur; |
4098 | + if( !radii && blur ) { |
4099 | + // If blurring, use a non-null border radius info object so that getBoxPath will |
4100 | + // round the corners of the expanded shadow shape rather than squaring them off. |
4101 | + radii = PIE.BorderRadiusStyleInfo.ALL_ZERO; |
4102 | + } |
4103 | + path = this.getBoxPath( { t: shrink, r: shrink, b: shrink, l: shrink }, 2, radii ); |
4104 | + |
4105 | + if( blur ) { |
4106 | + totalW = ( spread + blur ) * 2 + w; |
4107 | + totalH = ( spread + blur ) * 2 + h; |
4108 | + focusX = totalW ? blur * 2 / totalW : 0; |
4109 | + focusY = totalH ? blur * 2 / totalH : 0; |
4110 | + if( blur - spread > w / 2 || blur - spread > h / 2 ) { |
4111 | + // If the blur is larger than half the element's narrowest dimension, we cannot do |
4112 | + // this with a single shape gradient, because its focussize would have to be less than |
4113 | + // zero which results in ugly artifacts. Instead we create four shapes, each with its |
4114 | + // gradient focus past center, and then clip them so each only shows the quadrant |
4115 | + // opposite the focus. |
4116 | + for( j = 4; j--; ) { |
4117 | + corner = corners[j]; |
4118 | + isBottom = corner.charAt( 0 ) === 'b'; |
4119 | + isRight = corner.charAt( 1 ) === 'r'; |
4120 | + shape = getShadowShape( i, corner, xOff, yOff, color, blur, path ); |
4121 | + fill = shape.fill; |
4122 | + fill['focusposition'] = ( isRight ? 1 - focusX : focusX ) + ',' + |
4123 | + ( isBottom ? 1 - focusY : focusY ); |
4124 | + fill['focussize'] = '0,0'; |
4125 | + |
4126 | + // Clip to show only the appropriate quadrant. Add 1px to the top/left clip values |
4127 | + // in IE8 to prevent a bug where IE8 displays one pixel outside the clip region. |
4128 | + shape.style.clip = 'rect(' + ( ( isBottom ? totalH / 2 : 0 ) + clipAdjust ) + 'px,' + |
4129 | + ( isRight ? totalW : totalW / 2 ) + 'px,' + |
4130 | + ( isBottom ? totalH : totalH / 2 ) + 'px,' + |
4131 | + ( ( isRight ? totalW / 2 : 0 ) + clipAdjust ) + 'px)'; |
4132 | + } |
4133 | + } else { |
4134 | + // TODO delete old quadrant shapes if resizing expands past the barrier |
4135 | + shape = getShadowShape( i, '', xOff, yOff, color, blur, path ); |
4136 | + fill = shape.fill; |
4137 | + fill['focusposition'] = focusX + ',' + focusY; |
4138 | + fill['focussize'] = ( 1 - focusX * 2 ) + ',' + ( 1 - focusY * 2 ); |
4139 | + } |
4140 | + } else { |
4141 | + shape = getShadowShape( i, '', xOff, yOff, color, blur, path ); |
4142 | + alpha = color.alpha(); |
4143 | + if( alpha < 1 ) { |
4144 | + // shape.style.filter = 'alpha(opacity=' + ( alpha * 100 ) + ')'; |
4145 | + // ss.filter = 'progid:DXImageTransform.Microsoft.BasicImage(opacity=' + ( alpha ) + ')'; |
4146 | + shape.fill.opacity = alpha; |
4147 | + } |
4148 | + } |
4149 | + } |
4150 | + } |
4151 | + |
4152 | +} ); |
4153 | +/** |
4154 | + * Renderer for re-rendering img elements using VML. Kicks in if the img has |
4155 | + * a border-radius applied, or if the -pie-png-fix flag is set. |
4156 | + * @constructor |
4157 | + * @param {Element} el The target element |
4158 | + * @param {Object} styleInfos The StyleInfo objects |
4159 | + * @param {PIE.RootRenderer} parent |
4160 | + */ |
4161 | +PIE.ImgRenderer = PIE.RendererBase.newRenderer( { |
4162 | + |
4163 | + boxZIndex: 6, |
4164 | + boxName: 'imgEl', |
4165 | + |
4166 | + needsUpdate: function() { |
4167 | + var si = this.styleInfos; |
4168 | + return this.targetElement.src !== this._lastSrc || si.borderRadiusInfo.changed(); |
4169 | + }, |
4170 | + |
4171 | + isActive: function() { |
4172 | + var si = this.styleInfos; |
4173 | + return si.borderRadiusInfo.isActive() || si.backgroundInfo.isPngFix(); |
4174 | + }, |
4175 | + |
4176 | + draw: function() { |
4177 | + this._lastSrc = src; |
4178 | + this.hideActualImg(); |
4179 | + |
4180 | + var shape = this.getShape( 'img', 'fill', this.getBox() ), |
4181 | + fill = shape.fill, |
4182 | + bounds = this.boundsInfo.getBounds(), |
4183 | + w = bounds.w, |
4184 | + h = bounds.h, |
4185 | + borderProps = this.styleInfos.borderInfo.getProps(), |
4186 | + borderWidths = borderProps && borderProps.widths, |
4187 | + el = this.targetElement, |
4188 | + src = el.src, |
4189 | + round = Math.round, |
4190 | + cs = el.currentStyle, |
4191 | + getLength = PIE.getLength, |
4192 | + s, zero; |
4193 | + |
4194 | + // In IE6, the BorderRenderer will have hidden the border by moving the border-width to |
4195 | + // the padding; therefore we want to pretend the borders have no width so they aren't doubled |
4196 | + // when adding in the current padding value below. |
4197 | + if( !borderWidths || PIE.ieVersion < 7 ) { |
4198 | + zero = PIE.getLength( '0' ); |
4199 | + borderWidths = { 't': zero, 'r': zero, 'b': zero, 'l': zero }; |
4200 | + } |
4201 | + |
4202 | + shape.stroked = false; |
4203 | + fill.type = 'frame'; |
4204 | + fill.src = src; |
4205 | + fill.position = (w ? 0.5 / w : 0) + ',' + (h ? 0.5 / h : 0); |
4206 | + shape.coordsize = w * 2 + ',' + h * 2; |
4207 | + shape.coordorigin = '1,1'; |
4208 | + shape.path = this.getBoxPath( { |
4209 | + t: round( borderWidths['t'].pixels( el ) + getLength( cs.paddingTop ).pixels( el ) ), |
4210 | + r: round( borderWidths['r'].pixels( el ) + getLength( cs.paddingRight ).pixels( el ) ), |
4211 | + b: round( borderWidths['b'].pixels( el ) + getLength( cs.paddingBottom ).pixels( el ) ), |
4212 | + l: round( borderWidths['l'].pixels( el ) + getLength( cs.paddingLeft ).pixels( el ) ) |
4213 | + }, 2 ); |
4214 | + s = shape.style; |
4215 | + s.width = w; |
4216 | + s.height = h; |
4217 | + }, |
4218 | + |
4219 | + hideActualImg: function() { |
4220 | + this.targetElement.runtimeStyle.filter = 'alpha(opacity=0)'; |
4221 | + }, |
4222 | + |
4223 | + destroy: function() { |
4224 | + PIE.RendererBase.destroy.call( this ); |
4225 | + this.targetElement.runtimeStyle.filter = ''; |
4226 | + } |
4227 | + |
4228 | +} ); |
4229 | +/** |
4230 | + * Root renderer for IE9; manages the rendering layers in the element's background |
4231 | + * @param {Element} el The target element |
4232 | + * @param {Object} styleInfos The StyleInfo objects |
4233 | + */ |
4234 | +PIE.IE9RootRenderer = PIE.RendererBase.newRenderer( { |
4235 | + |
4236 | + updatePos: PIE.emptyFn, |
4237 | + updateSize: PIE.emptyFn, |
4238 | + updateVisibility: PIE.emptyFn, |
4239 | + updateProps: PIE.emptyFn, |
4240 | + |
4241 | + outerCommasRE: /^,+|,+$/g, |
4242 | + innerCommasRE: /,+/g, |
4243 | + |
4244 | + setBackgroundLayer: function(zIndex, bg) { |
4245 | + var me = this, |
4246 | + bgLayers = me._bgLayers || ( me._bgLayers = [] ), |
4247 | + undef; |
4248 | + bgLayers[zIndex] = bg || undef; |
4249 | + }, |
4250 | + |
4251 | + finishUpdate: function() { |
4252 | + var me = this, |
4253 | + bgLayers = me._bgLayers, |
4254 | + bg; |
4255 | + if( bgLayers && ( bg = bgLayers.join( ',' ).replace( me.outerCommasRE, '' ).replace( me.innerCommasRE, ',' ) ) !== me._lastBg ) { |
4256 | + me._lastBg = me.targetElement.runtimeStyle.background = bg; |
4257 | + } |
4258 | + }, |
4259 | + |
4260 | + destroy: function() { |
4261 | + this.targetElement.runtimeStyle.background = ''; |
4262 | + delete this._bgLayers; |
4263 | + } |
4264 | + |
4265 | +} ); |
4266 | +/** |
4267 | + * Renderer for element backgrounds, specific for IE9. Only handles translating CSS3 gradients |
4268 | + * to an equivalent SVG data URI. |
4269 | + * @constructor |
4270 | + * @param {Element} el The target element |
4271 | + * @param {Object} styleInfos The StyleInfo objects |
4272 | + */ |
4273 | +PIE.IE9BackgroundRenderer = PIE.RendererBase.newRenderer( { |
4274 | + |
4275 | + bgLayerZIndex: 1, |
4276 | + |
4277 | + needsUpdate: function() { |
4278 | + var si = this.styleInfos; |
4279 | + return si.backgroundInfo.changed(); |
4280 | + }, |
4281 | + |
4282 | + isActive: function() { |
4283 | + var si = this.styleInfos; |
4284 | + return si.backgroundInfo.isActive() || si.borderImageInfo.isActive(); |
4285 | + }, |
4286 | + |
4287 | + draw: function() { |
4288 | + var me = this, |
4289 | + props = me.styleInfos.backgroundInfo.getProps(), |
4290 | + bg, images, i = 0, img, bgAreaSize, bgSize; |
4291 | + |
4292 | + if ( props ) { |
4293 | + bg = []; |
4294 | + |
4295 | + images = props.bgImages; |
4296 | + if ( images ) { |
4297 | + while( img = images[ i++ ] ) { |
4298 | + if (img.imgType === 'linear-gradient' ) { |
4299 | + bgAreaSize = me.getBgAreaSize( img.bgOrigin ); |
4300 | + bgSize = ( img.bgSize || PIE.BgSize.DEFAULT ).pixels( |
4301 | + me.targetElement, bgAreaSize.w, bgAreaSize.h, bgAreaSize.w, bgAreaSize.h |
4302 | + ), |
4303 | + bg.push( |
4304 | + 'url(data:image/svg+xml,' + escape( me.getGradientSvg( img, bgSize.w, bgSize.h ) ) + ') ' + |
4305 | + me.bgPositionToString( img.bgPosition ) + ' / ' + bgSize.w + 'px ' + bgSize.h + 'px ' + |
4306 | + ( img.bgAttachment || '' ) + ' ' + ( img.bgOrigin || '' ) + ' ' + ( img.bgClip || '' ) |
4307 | + ); |
4308 | + } else { |
4309 | + bg.push( img.origString ); |
4310 | + } |
4311 | + } |
4312 | + } |
4313 | + |
4314 | + if ( props.color ) { |
4315 | + bg.push( props.color.val ); |
4316 | + } |
4317 | + |
4318 | + me.parent.setBackgroundLayer(me.bgLayerZIndex, bg.join(',')); |
4319 | + } |
4320 | + }, |
4321 | + |
4322 | + bgPositionToString: function( bgPosition ) { |
4323 | + return bgPosition ? bgPosition.tokens.map(function(token) { |
4324 | + return token.tokenValue; |
4325 | + }).join(' ') : '0 0'; |
4326 | + }, |
4327 | + |
4328 | + getBgAreaSize: function( bgOrigin ) { |
4329 | + var me = this, |
4330 | + el = me.targetElement, |
4331 | + bounds = me.boundsInfo.getBounds(), |
4332 | + elW = bounds.w, |
4333 | + elH = bounds.h, |
4334 | + w = elW, |
4335 | + h = elH, |
4336 | + borders, getLength, cs; |
4337 | + |
4338 | + if( bgOrigin !== 'border-box' ) { |
4339 | + borders = me.styleInfos.borderInfo.getProps(); |
4340 | + if( borders && ( borders = borders.widths ) ) { |
4341 | + w -= borders[ 'l' ].pixels( el ) + borders[ 'l' ].pixels( el ); |
4342 | + h -= borders[ 't' ].pixels( el ) + borders[ 'b' ].pixels( el ); |
4343 | + } |
4344 | + } |
4345 | + |
4346 | + if ( bgOrigin === 'content-box' ) { |
4347 | + getLength = PIE.getLength; |
4348 | + cs = el.currentStyle; |
4349 | + w -= getLength( cs.paddingLeft ).pixels( el ) + getLength( cs.paddingRight ).pixels( el ); |
4350 | + h -= getLength( cs.paddingTop ).pixels( el ) + getLength( cs.paddingBottom ).pixels( el ); |
4351 | + } |
4352 | + |
4353 | + return { w: w, h: h }; |
4354 | + }, |
4355 | + |
4356 | + getGradientSvg: function( info, bgWidth, bgHeight ) { |
4357 | + var el = this.targetElement, |
4358 | + stopsInfo = info.stops, |
4359 | + stopCount = stopsInfo.length, |
4360 | + metrics = PIE.GradientUtil.getGradientMetrics( el, bgWidth, bgHeight, info ), |
4361 | + startX = metrics.startX, |
4362 | + startY = metrics.startY, |
4363 | + endX = metrics.endX, |
4364 | + endY = metrics.endY, |
4365 | + lineLength = metrics.lineLength, |
4366 | + stopPx, |
4367 | + i, j, before, after, |
4368 | + svg; |
4369 | + |
4370 | + // Find the pixel offsets along the CSS3 gradient-line for each stop. |
4371 | + stopPx = []; |
4372 | + for( i = 0; i < stopCount; i++ ) { |
4373 | + stopPx.push( stopsInfo[i].offset ? stopsInfo[i].offset.pixels( el, lineLength ) : |
4374 | + i === 0 ? 0 : i === stopCount - 1 ? lineLength : null ); |
4375 | + } |
4376 | + // Fill in gaps with evenly-spaced offsets |
4377 | + for( i = 1; i < stopCount; i++ ) { |
4378 | + if( stopPx[ i ] === null ) { |
4379 | + before = stopPx[ i - 1 ]; |
4380 | + j = i; |
4381 | + do { |
4382 | + after = stopPx[ ++j ]; |
4383 | + } while( after === null ); |
4384 | + stopPx[ i ] = before + ( after - before ) / ( j - i + 1 ); |
4385 | + } |
4386 | + } |
4387 | + |
4388 | + svg = [ |
4389 | + '<svg width="' + bgWidth + '" height="' + bgHeight + '" xmlns="http://www.w3.org/2000/svg">' + |
4390 | + '<defs>' + |
4391 | + '<linearGradient id="g" gradientUnits="userSpaceOnUse"' + |
4392 | + ' x1="' + ( startX / bgWidth * 100 ) + '%" y1="' + ( startY / bgHeight * 100 ) + '%" x2="' + ( endX / bgWidth * 100 ) + '%" y2="' + ( endY / bgHeight * 100 ) + '%">' |
4393 | + ]; |
4394 | + |
4395 | + // Convert to percentage along the SVG gradient line and add to the stops list |
4396 | + for( i = 0; i < stopCount; i++ ) { |
4397 | + svg.push( |
4398 | + '<stop offset="' + ( stopPx[ i ] / lineLength ) + |
4399 | + '" stop-color="' + stopsInfo[i].color.colorValue( el ) + |
4400 | + '" stop-opacity="' + stopsInfo[i].color.alpha() + '"/>' |
4401 | + ); |
4402 | + } |
4403 | + |
4404 | + svg.push( |
4405 | + '</linearGradient>' + |
4406 | + '</defs>' + |
4407 | + '<rect width="100%" height="100%" fill="url(#g)"/>' + |
4408 | + '</svg>' |
4409 | + ); |
4410 | + |
4411 | + return svg.join( '' ); |
4412 | + }, |
4413 | + |
4414 | + destroy: function() { |
4415 | + this.parent.setBackgroundLayer( this.bgLayerZIndex ); |
4416 | + } |
4417 | + |
4418 | +} ); |
4419 | +/** |
4420 | + * Renderer for border-image |
4421 | + * @constructor |
4422 | + * @param {Element} el The target element |
4423 | + * @param {Object} styleInfos The StyleInfo objects |
4424 | + * @param {PIE.RootRenderer} parent |
4425 | + */ |
4426 | +PIE.IE9BorderImageRenderer = PIE.RendererBase.newRenderer( { |
4427 | + |
4428 | + REPEAT: 'repeat', |
4429 | + STRETCH: 'stretch', |
4430 | + ROUND: 'round', |
4431 | + |
4432 | + bgLayerZIndex: 0, |
4433 | + |
4434 | + needsUpdate: function() { |
4435 | + return this.styleInfos.borderImageInfo.changed(); |
4436 | + }, |
4437 | + |
4438 | + isActive: function() { |
4439 | + return this.styleInfos.borderImageInfo.isActive(); |
4440 | + }, |
4441 | + |
4442 | + draw: function() { |
4443 | + var me = this, |
4444 | + props = me.styleInfos.borderImageInfo.getProps(), |
4445 | + borderProps = me.styleInfos.borderInfo.getProps(), |
4446 | + bounds = me.boundsInfo.getBounds(), |
4447 | + repeat = props.repeat, |
4448 | + repeatH = repeat.h, |
4449 | + repeatV = repeat.v, |
4450 | + el = me.targetElement, |
4451 | + isAsync = 0; |
4452 | + |
4453 | + PIE.Util.withImageSize( props.src, function( imgSize ) { |
4454 | + var elW = bounds.w, |
4455 | + elH = bounds.h, |
4456 | + imgW = imgSize.w, |
4457 | + imgH = imgSize.h, |
4458 | + |
4459 | + // The image cannot be referenced as a URL directly in the SVG because IE9 throws a strange |
4460 | + // security exception (perhaps due to cross-origin policy within data URIs?) Therefore we |
4461 | + // work around this by converting the image data into a data URI itself using a transient |
4462 | + // canvas. This unfortunately requires the border-image src to be within the same domain, |
4463 | + // which isn't a limitation in true border-image, so we need to try and find a better fix. |
4464 | + imgSrc = me.imageToDataURI( props.src, imgW, imgH ), |
4465 | + |
4466 | + REPEAT = me.REPEAT, |
4467 | + STRETCH = me.STRETCH, |
4468 | + ROUND = me.ROUND, |
4469 | + ceil = Math.ceil, |
4470 | + |
4471 | + zero = PIE.getLength( '0' ), |
4472 | + widths = props.widths || ( borderProps ? borderProps.widths : { 't': zero, 'r': zero, 'b': zero, 'l': zero } ), |
4473 | + widthT = widths['t'].pixels( el ), |
4474 | + widthR = widths['r'].pixels( el ), |
4475 | + widthB = widths['b'].pixels( el ), |
4476 | + widthL = widths['l'].pixels( el ), |
4477 | + slices = props.slice, |
4478 | + sliceT = slices['t'].pixels( el ), |
4479 | + sliceR = slices['r'].pixels( el ), |
4480 | + sliceB = slices['b'].pixels( el ), |
4481 | + sliceL = slices['l'].pixels( el ), |
4482 | + centerW = elW - widthL - widthR, |
4483 | + middleH = elH - widthT - widthB, |
4484 | + imgCenterW = imgW - sliceL - sliceR, |
4485 | + imgMiddleH = imgH - sliceT - sliceB, |
4486 | + |
4487 | + // Determine the size of each tile - 'round' is handled below |
4488 | + tileSizeT = repeatH === STRETCH ? centerW : imgCenterW * widthT / sliceT, |
4489 | + tileSizeR = repeatV === STRETCH ? middleH : imgMiddleH * widthR / sliceR, |
4490 | + tileSizeB = repeatH === STRETCH ? centerW : imgCenterW * widthB / sliceB, |
4491 | + tileSizeL = repeatV === STRETCH ? middleH : imgMiddleH * widthL / sliceL, |
4492 | + |
4493 | + svg, |
4494 | + patterns = [], |
4495 | + rects = [], |
4496 | + i = 0; |
4497 | + |
4498 | + // For 'round', subtract from each tile's size enough so that they fill the space a whole number of times |
4499 | + if (repeatH === ROUND) { |
4500 | + tileSizeT -= (tileSizeT - (centerW % tileSizeT || tileSizeT)) / ceil(centerW / tileSizeT); |
4501 | + tileSizeB -= (tileSizeB - (centerW % tileSizeB || tileSizeB)) / ceil(centerW / tileSizeB); |
4502 | + } |
4503 | + if (repeatV === ROUND) { |
4504 | + tileSizeR -= (tileSizeR - (middleH % tileSizeR || tileSizeR)) / ceil(middleH / tileSizeR); |
4505 | + tileSizeL -= (tileSizeL - (middleH % tileSizeL || tileSizeL)) / ceil(middleH / tileSizeL); |
4506 | + } |
4507 | + |
4508 | + |
4509 | + // Build the SVG for the border-image rendering. Add each piece as a pattern, which is then stretched |
4510 | + // or repeated as the fill of a rect of appropriate size. |
4511 | + svg = [ |
4512 | + '<svg width="' + elW + '" height="' + elH + '" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' |
4513 | + ]; |
4514 | + |
4515 | + function addImage( x, y, w, h, cropX, cropY, cropW, cropH, tileW, tileH ) { |
4516 | + patterns.push( |
4517 | + '<pattern patternUnits="userSpaceOnUse" id="pattern' + i + '" ' + |
4518 | + 'x="' + (repeatH === REPEAT ? x + w / 2 - tileW / 2 : x) + '" ' + |
4519 | + 'y="' + (repeatV === REPEAT ? y + h / 2 - tileH / 2 : y) + '" ' + |
4520 | + 'width="' + tileW + '" height="' + tileH + '">' + |
4521 | + '<svg width="' + tileW + '" height="' + tileH + '" viewBox="' + cropX + ' ' + cropY + ' ' + cropW + ' ' + cropH + '" preserveAspectRatio="none">' + |
4522 | + '<image xlink:href="' + imgSrc + '" x="0" y="0" width="' + imgW + '" height="' + imgH + '" />' + |
4523 | + '</svg>' + |
4524 | + '</pattern>' |
4525 | + ); |
4526 | + rects.push( |
4527 | + '<rect x="' + x + '" y="' + y + '" width="' + w + '" height="' + h + '" fill="url(#pattern' + i + ')" />' |
4528 | + ); |
4529 | + i++; |
4530 | + } |
4531 | + addImage( 0, 0, widthL, widthT, 0, 0, sliceL, sliceT, widthL, widthT ); // top left |
4532 | + addImage( widthL, 0, centerW, widthT, sliceL, 0, imgCenterW, sliceT, tileSizeT, widthT ); // top center |
4533 | + addImage( elW - widthR, 0, widthR, widthT, imgW - sliceR, 0, sliceR, sliceT, widthR, widthT ); // top right |
4534 | + addImage( 0, widthT, widthL, middleH, 0, sliceT, sliceL, imgMiddleH, widthL, tileSizeL ); // middle left |
4535 | + if ( props.fill ) { // center fill |
4536 | + addImage( widthL, widthT, centerW, middleH, sliceL, sliceT, imgCenterW, imgMiddleH, |
4537 | + tileSizeT || tileSizeB || imgCenterW, tileSizeL || tileSizeR || imgMiddleH ); |
4538 | + } |
4539 | + addImage( elW - widthR, widthT, widthR, middleH, imgW - sliceR, sliceT, sliceR, imgMiddleH, widthR, tileSizeR ); // middle right |
4540 | + addImage( 0, elH - widthB, widthL, widthB, 0, imgH - sliceB, sliceL, sliceB, widthL, widthB ); // bottom left |
4541 | + addImage( widthL, elH - widthB, centerW, widthB, sliceL, imgH - sliceB, imgCenterW, sliceB, tileSizeB, widthB ); // bottom center |
4542 | + addImage( elW - widthR, elH - widthB, widthR, widthB, imgW - sliceR, imgH - sliceB, sliceR, sliceB, widthR, widthB ); // bottom right |
4543 | + |
4544 | + svg.push( |
4545 | + '<defs>' + |
4546 | + patterns.join('\n') + |
4547 | + '</defs>' + |
4548 | + rects.join('\n') + |
4549 | + '</svg>' |
4550 | + ); |
4551 | + |
4552 | + me.parent.setBackgroundLayer( me.bgLayerZIndex, 'url(data:image/svg+xml,' + escape( svg.join( '' ) ) + ') no-repeat border-box border-box' ); |
4553 | + |
4554 | + // If the border-image's src wasn't immediately available, the SVG for its background layer |
4555 | + // will have been created asynchronously after the main element's update has finished; we'll |
4556 | + // therefore need to force the root renderer to sync to the final background once finished. |
4557 | + if( isAsync ) { |
4558 | + me.parent.finishUpdate(); |
4559 | + } |
4560 | + }, me ); |
4561 | + |
4562 | + isAsync = 1; |
4563 | + }, |
4564 | + |
4565 | + /** |
4566 | + * Convert a given image to a data URI |
4567 | + */ |
4568 | + imageToDataURI: (function() { |
4569 | + var uris = {}; |
4570 | + return function( src, width, height ) { |
4571 | + var uri = uris[ src ], |
4572 | + image, canvas; |
4573 | + if ( !uri ) { |
4574 | + image = new Image(); |
4575 | + canvas = doc.createElement( 'canvas' ); |
4576 | + image.src = src; |
4577 | + canvas.width = width; |
4578 | + canvas.height = height; |
4579 | + canvas.getContext( '2d' ).drawImage( image, 0, 0 ); |
4580 | + uri = uris[ src ] = canvas.toDataURL(); |
4581 | + } |
4582 | + return uri; |
4583 | + } |
4584 | + })(), |
4585 | + |
4586 | + prepareUpdate: PIE.BorderImageRenderer.prototype.prepareUpdate, |
4587 | + |
4588 | + destroy: function() { |
4589 | + var me = this, |
4590 | + rs = me.targetElement.runtimeStyle; |
4591 | + me.parent.setBackgroundLayer( me.bgLayerZIndex ); |
4592 | + rs.borderColor = rs.borderStyle = rs.borderWidth = ''; |
4593 | + } |
4594 | + |
4595 | +} ); |
4596 | + |
4597 | +PIE.Element = (function() { |
4598 | + |
4599 | + var wrappers = {}, |
4600 | + lazyInitCssProp = PIE.CSS_PREFIX + 'lazy-init', |
4601 | + pollCssProp = PIE.CSS_PREFIX + 'poll', |
4602 | + trackActiveCssProp = PIE.CSS_PREFIX + 'track-active', |
4603 | + trackHoverCssProp = PIE.CSS_PREFIX + 'track-hover', |
4604 | + hoverClass = PIE.CLASS_PREFIX + 'hover', |
4605 | + activeClass = PIE.CLASS_PREFIX + 'active', |
4606 | + focusClass = PIE.CLASS_PREFIX + 'focus', |
4607 | + firstChildClass = PIE.CLASS_PREFIX + 'first-child', |
4608 | + ignorePropertyNames = { 'background':1, 'bgColor':1, 'display': 1 }, |
4609 | + classNameRegExes = {}, |
4610 | + dummyArray = []; |
4611 | + |
4612 | + |
4613 | + function addClass( el, className ) { |
4614 | + el.className += ' ' + className; |
4615 | + } |
4616 | + |
4617 | + function removeClass( el, className ) { |
4618 | + var re = classNameRegExes[ className ] || |
4619 | + ( classNameRegExes[ className ] = new RegExp( '\\b' + className + '\\b', 'g' ) ); |
4620 | + el.className = el.className.replace( re, '' ); |
4621 | + } |
4622 | + |
4623 | + function delayAddClass( el, className /*, className2*/ ) { |
4624 | + var classes = dummyArray.slice.call( arguments, 1 ), |
4625 | + i = classes.length; |
4626 | + setTimeout( function() { |
4627 | + if( el ) { |
4628 | + while( i-- ) { |
4629 | + addClass( el, classes[ i ] ); |
4630 | + } |
4631 | + } |
4632 | + }, 0 ); |
4633 | + } |
4634 | + |
4635 | + function delayRemoveClass( el, className /*, className2*/ ) { |
4636 | + var classes = dummyArray.slice.call( arguments, 1 ), |
4637 | + i = classes.length; |
4638 | + setTimeout( function() { |
4639 | + if( el ) { |
4640 | + while( i-- ) { |
4641 | + removeClass( el, classes[ i ] ); |
4642 | + } |
4643 | + } |
4644 | + }, 0 ); |
4645 | + } |
4646 | + |
4647 | + |
4648 | + |
4649 | + function Element( el ) { |
4650 | + var renderers, |
4651 | + rootRenderer, |
4652 | + boundsInfo = new PIE.BoundsInfo( el ), |
4653 | + styleInfos, |
4654 | + styleInfosArr, |
4655 | + initializing, |
4656 | + initialized, |
4657 | + eventsAttached, |
4658 | + eventListeners = [], |
4659 | + delayed, |
4660 | + destroyed, |
4661 | + poll; |
4662 | + |
4663 | + /** |
4664 | + * Initialize PIE for this element. |
4665 | + */ |
4666 | + function init() { |
4667 | + if( !initialized ) { |
4668 | + var docEl, |
4669 | + bounds, |
4670 | + ieDocMode = PIE.ieDocMode, |
4671 | + cs = el.currentStyle, |
4672 | + lazy = cs.getAttribute( lazyInitCssProp ) === 'true', |
4673 | + trackActive = cs.getAttribute( trackActiveCssProp ) !== 'false', |
4674 | + trackHover = cs.getAttribute( trackHoverCssProp ) !== 'false', |
4675 | + childRenderers; |
4676 | + |
4677 | + // Polling for size/position changes: default to on in IE8, off otherwise, overridable by -pie-poll |
4678 | + poll = cs.getAttribute( pollCssProp ); |
4679 | + poll = ieDocMode > 7 ? poll !== 'false' : poll === 'true'; |
4680 | + |
4681 | + // Force layout so move/resize events will fire. Set this as soon as possible to avoid layout changes |
4682 | + // after load, but make sure it only gets called the first time through to avoid recursive calls to init(). |
4683 | + if( !initializing ) { |
4684 | + initializing = 1; |
4685 | + el.runtimeStyle.zoom = 1; |
4686 | + initFirstChildPseudoClass(); |
4687 | + } |
4688 | + |
4689 | + boundsInfo.lock(); |
4690 | + |
4691 | + // If the -pie-lazy-init:true flag is set, check if the element is outside the viewport and if so, delay initialization |
4692 | + if( lazy && ( bounds = boundsInfo.getBounds() ) && ( docEl = doc.documentElement || doc.body ) && |
4693 | + ( bounds.y > docEl.clientHeight || bounds.x > docEl.clientWidth || bounds.y + bounds.h < 0 || bounds.x + bounds.w < 0 ) ) { |
4694 | + if( !delayed ) { |
4695 | + delayed = 1; |
4696 | + PIE.OnScroll.observe( init ); |
4697 | + } |
4698 | + } else { |
4699 | + initialized = 1; |
4700 | + delayed = initializing = 0; |
4701 | + PIE.OnScroll.unobserve( init ); |
4702 | + |
4703 | + // Create the style infos and renderers |
4704 | + if ( ieDocMode === 9 ) { |
4705 | + styleInfos = { |
4706 | + backgroundInfo: new PIE.BackgroundStyleInfo( el ), |
4707 | + borderImageInfo: new PIE.BorderImageStyleInfo( el ), |
4708 | + borderInfo: new PIE.BorderStyleInfo( el ) |
4709 | + }; |
4710 | + styleInfosArr = [ |
4711 | + styleInfos.backgroundInfo, |
4712 | + styleInfos.borderImageInfo |
4713 | + ]; |
4714 | + rootRenderer = new PIE.IE9RootRenderer( el, boundsInfo, styleInfos ); |
4715 | + childRenderers = [ |
4716 | + new PIE.IE9BackgroundRenderer( el, boundsInfo, styleInfos, rootRenderer ), |
4717 | + new PIE.IE9BorderImageRenderer( el, boundsInfo, styleInfos, rootRenderer ) |
4718 | + ]; |
4719 | + } else { |
4720 | + |
4721 | + styleInfos = { |
4722 | + backgroundInfo: new PIE.BackgroundStyleInfo( el ), |
4723 | + borderInfo: new PIE.BorderStyleInfo( el ), |
4724 | + borderImageInfo: new PIE.BorderImageStyleInfo( el ), |
4725 | + borderRadiusInfo: new PIE.BorderRadiusStyleInfo( el ), |
4726 | + boxShadowInfo: new PIE.BoxShadowStyleInfo( el ), |
4727 | + visibilityInfo: new PIE.VisibilityStyleInfo( el ) |
4728 | + }; |
4729 | + styleInfosArr = [ |
4730 | + styleInfos.backgroundInfo, |
4731 | + styleInfos.borderInfo, |
4732 | + styleInfos.borderImageInfo, |
4733 | + styleInfos.borderRadiusInfo, |
4734 | + styleInfos.boxShadowInfo, |
4735 | + styleInfos.visibilityInfo |
4736 | + ]; |
4737 | + rootRenderer = new PIE.RootRenderer( el, boundsInfo, styleInfos ); |
4738 | + childRenderers = [ |
4739 | + new PIE.BoxShadowOutsetRenderer( el, boundsInfo, styleInfos, rootRenderer ), |
4740 | + new PIE.BackgroundRenderer( el, boundsInfo, styleInfos, rootRenderer ), |
4741 | + //new PIE.BoxShadowInsetRenderer( el, boundsInfo, styleInfos, rootRenderer ), |
4742 | + new PIE.BorderRenderer( el, boundsInfo, styleInfos, rootRenderer ), |
4743 | + new PIE.BorderImageRenderer( el, boundsInfo, styleInfos, rootRenderer ) |
4744 | + ]; |
4745 | + if( el.tagName === 'IMG' ) { |
4746 | + childRenderers.push( new PIE.ImgRenderer( el, boundsInfo, styleInfos, rootRenderer ) ); |
4747 | + } |
4748 | + rootRenderer.childRenderers = childRenderers; // circular reference, can't pass in constructor; TODO is there a cleaner way? |
4749 | + } |
4750 | + renderers = [ rootRenderer ].concat( childRenderers ); |
4751 | + |
4752 | + // Add property change listeners to ancestors if requested |
4753 | + initAncestorEventListeners(); |
4754 | + |
4755 | + // Add to list of polled elements in IE8 |
4756 | + if( poll ) { |
4757 | + PIE.Heartbeat.observe( update ); |
4758 | + PIE.Heartbeat.run(); |
4759 | + } |
4760 | + |
4761 | + // Trigger rendering |
4762 | + update( 1 ); |
4763 | + } |
4764 | + |
4765 | + if( !eventsAttached ) { |
4766 | + eventsAttached = 1; |
4767 | + if( ieDocMode < 9 ) { |
4768 | + addListener( el, 'onmove', handleMoveOrResize ); |
4769 | + } |
4770 | + addListener( el, 'onresize', handleMoveOrResize ); |
4771 | + addListener( el, 'onpropertychange', propChanged ); |
4772 | + if( trackHover ) { |
4773 | + addListener( el, 'onmouseenter', mouseEntered ); |
4774 | + } |
4775 | + if( trackHover || trackActive ) { |
4776 | + addListener( el, 'onmouseleave', mouseLeft ); |
4777 | + } |
4778 | + if( trackActive ) { |
4779 | + addListener( el, 'onmousedown', mousePressed ); |
4780 | + } |
4781 | + if( el.tagName in PIE.focusableElements ) { |
4782 | + addListener( el, 'onfocus', focused ); |
4783 | + addListener( el, 'onblur', blurred ); |
4784 | + } |
4785 | + PIE.OnResize.observe( handleMoveOrResize ); |
4786 | + |
4787 | + PIE.OnUnload.observe( removeEventListeners ); |
4788 | + } |
4789 | + |
4790 | + boundsInfo.unlock(); |
4791 | + } |
4792 | + } |
4793 | + |
4794 | + |
4795 | + |
4796 | + |
4797 | + /** |
4798 | + * Event handler for onmove and onresize events. Invokes update() only if the element's |
4799 | + * bounds have previously been calculated, to prevent multiple runs during page load when |
4800 | + * the element has no initial CSS3 properties. |
4801 | + */ |
4802 | + function handleMoveOrResize() { |
4803 | + if( boundsInfo && boundsInfo.hasBeenQueried() ) { |
4804 | + update(); |
4805 | + } |
4806 | + } |
4807 | + |
4808 | + |
4809 | + /** |
4810 | + * Update position and/or size as necessary. Both move and resize events call |
4811 | + * this rather than the updatePos/Size functions because sometimes, particularly |
4812 | + * during page load, one will fire but the other won't. |
4813 | + */ |
4814 | + function update( force ) { |
4815 | + if( !destroyed ) { |
4816 | + if( initialized ) { |
4817 | + var i, len = renderers.length; |
4818 | + |
4819 | + lockAll(); |
4820 | + for( i = 0; i < len; i++ ) { |
4821 | + renderers[i].prepareUpdate(); |
4822 | + } |
4823 | + if( force || boundsInfo.positionChanged() ) { |
4824 | + /* TODO just using getBoundingClientRect (used internally by BoundsInfo) for detecting |
4825 | + position changes may not always be accurate; it's possible that |
4826 | + an element will actually move relative to its positioning parent, but its position |
4827 | + relative to the viewport will stay the same. Need to come up with a better way to |
4828 | + track movement. The most accurate would be the same logic used in RootRenderer.updatePos() |
4829 | + but that is a more expensive operation since it does some DOM walking, and we want this |
4830 | + check to be as fast as possible. */ |
4831 | + for( i = 0; i < len; i++ ) { |
4832 | + renderers[i].updatePos(); |
4833 | + } |
4834 | + } |
4835 | + if( force || boundsInfo.sizeChanged() ) { |
4836 | + for( i = 0; i < len; i++ ) { |
4837 | + renderers[i].updateSize(); |
4838 | + } |
4839 | + } |
4840 | + rootRenderer.finishUpdate(); |
4841 | + unlockAll(); |
4842 | + } |
4843 | + else if( !initializing ) { |
4844 | + init(); |
4845 | + } |
4846 | + } |
4847 | + } |
4848 | + |
4849 | + /** |
4850 | + * Handle property changes to trigger update when appropriate. |
4851 | + */ |
4852 | + function propChanged() { |
4853 | + var i, len = renderers.length, |
4854 | + renderer, |
4855 | + e = event; |
4856 | + |
4857 | + // Some elements like <table> fire onpropertychange events for old-school background properties |
4858 | + // ('background', 'bgColor') when runtimeStyle background properties are changed, which |
4859 | + // results in an infinite loop; therefore we filter out those property names. Also, 'display' |
4860 | + // is ignored because size calculations don't work correctly immediately when its onpropertychange |
4861 | + // event fires, and because it will trigger an onresize event anyway. |
4862 | + if( !destroyed && !( e && e.propertyName in ignorePropertyNames ) ) { |
4863 | + if( initialized ) { |
4864 | + lockAll(); |
4865 | + for( i = 0; i < len; i++ ) { |
4866 | + renderers[i].prepareUpdate(); |
4867 | + } |
4868 | + for( i = 0; i < len; i++ ) { |
4869 | + renderer = renderers[i]; |
4870 | + // Make sure position is synced if the element hasn't already been rendered. |
4871 | + // TODO this feels sloppy - look into merging propChanged and update functions |
4872 | + if( !renderer.isPositioned ) { |
4873 | + renderer.updatePos(); |
4874 | + } |
4875 | + if( renderer.needsUpdate() ) { |
4876 | + renderer.updateProps(); |
4877 | + } |
4878 | + } |
4879 | + rootRenderer.finishUpdate(); |
4880 | + unlockAll(); |
4881 | + } |
4882 | + else if( !initializing ) { |
4883 | + init(); |
4884 | + } |
4885 | + } |
4886 | + } |
4887 | + |
4888 | + |
4889 | + /** |
4890 | + * Handle mouseenter events. Adds a custom class to the element to allow IE6 to add |
4891 | + * hover styles to non-link elements, and to trigger a propertychange update. |
4892 | + */ |
4893 | + function mouseEntered() { |
4894 | + //must delay this because the mouseenter event fires before the :hover styles are added. |
4895 | + delayAddClass( el, hoverClass ); |
4896 | + } |
4897 | + |
4898 | + /** |
4899 | + * Handle mouseleave events |
4900 | + */ |
4901 | + function mouseLeft() { |
4902 | + //must delay this because the mouseleave event fires before the :hover styles are removed. |
4903 | + delayRemoveClass( el, hoverClass, activeClass ); |
4904 | + } |
4905 | + |
4906 | + /** |
4907 | + * Handle mousedown events. Adds a custom class to the element to allow IE6 to add |
4908 | + * active styles to non-link elements, and to trigger a propertychange update. |
4909 | + */ |
4910 | + function mousePressed() { |
4911 | + //must delay this because the mousedown event fires before the :active styles are added. |
4912 | + delayAddClass( el, activeClass ); |
4913 | + |
4914 | + // listen for mouseups on the document; can't just be on the element because the user might |
4915 | + // have dragged out of the element while the mouse button was held down |
4916 | + PIE.OnMouseup.observe( mouseReleased ); |
4917 | + } |
4918 | + |
4919 | + /** |
4920 | + * Handle mouseup events |
4921 | + */ |
4922 | + function mouseReleased() { |
4923 | + //must delay this because the mouseup event fires before the :active styles are removed. |
4924 | + delayRemoveClass( el, activeClass ); |
4925 | + |
4926 | + PIE.OnMouseup.unobserve( mouseReleased ); |
4927 | + } |
4928 | + |
4929 | + /** |
4930 | + * Handle focus events. Adds a custom class to the element to trigger a propertychange update. |
4931 | + */ |
4932 | + function focused() { |
4933 | + //must delay this because the focus event fires before the :focus styles are added. |
4934 | + delayAddClass( el, focusClass ); |
4935 | + } |
4936 | + |
4937 | + /** |
4938 | + * Handle blur events |
4939 | + */ |
4940 | + function blurred() { |
4941 | + //must delay this because the blur event fires before the :focus styles are removed. |
4942 | + delayRemoveClass( el, focusClass ); |
4943 | + } |
4944 | + |
4945 | + |
4946 | + /** |
4947 | + * Handle property changes on ancestors of the element; see initAncestorEventListeners() |
4948 | + * which adds these listeners as requested with the -pie-watch-ancestors CSS property. |
4949 | + */ |
4950 | + function ancestorPropChanged() { |
4951 | + var name = event.propertyName; |
4952 | + if( name === 'className' || name === 'id' ) { |
4953 | + propChanged(); |
4954 | + } |
4955 | + } |
4956 | + |
4957 | + function lockAll() { |
4958 | + boundsInfo.lock(); |
4959 | + for( var i = styleInfosArr.length; i--; ) { |
4960 | + styleInfosArr[i].lock(); |
4961 | + } |
4962 | + } |
4963 | + |
4964 | + function unlockAll() { |
4965 | + for( var i = styleInfosArr.length; i--; ) { |
4966 | + styleInfosArr[i].unlock(); |
4967 | + } |
4968 | + boundsInfo.unlock(); |
4969 | + } |
4970 | + |
4971 | + |
4972 | + function addListener( targetEl, type, handler ) { |
4973 | + targetEl.attachEvent( type, handler ); |
4974 | + eventListeners.push( [ targetEl, type, handler ] ); |
4975 | + } |
4976 | + |
4977 | + /** |
4978 | + * Remove all event listeners from the element and any monitored ancestors. |
4979 | + */ |
4980 | + function removeEventListeners() { |
4981 | + if (eventsAttached) { |
4982 | + var i = eventListeners.length, |
4983 | + listener; |
4984 | + |
4985 | + while( i-- ) { |
4986 | + listener = eventListeners[ i ]; |
4987 | + listener[ 0 ].detachEvent( listener[ 1 ], listener[ 2 ] ); |
4988 | + } |
4989 | + |
4990 | + PIE.OnUnload.unobserve( removeEventListeners ); |
4991 | + eventsAttached = 0; |
4992 | + eventListeners = []; |
4993 | + } |
4994 | + } |
4995 | + |
4996 | + |
4997 | + /** |
4998 | + * Clean everything up when the behavior is removed from the element, or the element |
4999 | + * is manually destroyed. |
5000 | + */ |
The diff has been truncated for viewing.