Merge lp:~edwin-grubbs/lazr-js/activator-ie-fixes into lp:lazr-js
- activator-ie-fixes
- Merge into toolchain
Status: | Merged |
---|---|
Approved by: | Gavin Panella |
Approved revision: | not available |
Merged at revision: | not available |
Proposed branch: | lp:~edwin-grubbs/lazr-js/activator-ie-fixes |
Merge into: | lp:lazr-js |
Diff against target: |
1014 lines (+244/-197) 35 files modified
examples/actions/index.html (+6/-6) examples/activator/index.html (+1/-1) examples/combo.html (+1/-1) examples/formoverlay/index.html (+1/-1) examples/lazr/index.html (+13/-8) examples/picker/index.html (+1/-1) src-js/lazrjs/actions/tests/actions.html (+4/-4) src-js/lazrjs/actions/tests/actions.js (+1/-1) src-js/lazrjs/activator/activator.js (+6/-2) src-js/lazrjs/activator/assets/skins/sam/activator-skin.css (+7/-2) src-js/lazrjs/activator/tests/activator.html (+4/-4) src-js/lazrjs/activator/tests/activator.js (+29/-13) src-js/lazrjs/anim/tests/anim.html (+4/-4) src-js/lazrjs/anim/tests/anim.js (+1/-1) src-js/lazrjs/autocomplete/tests/autocomplete.js (+1/-1) src-js/lazrjs/autocomplete/tests/index.html (+4/-4) src-js/lazrjs/choiceedit/tests/choiceedit.html (+4/-4) src-js/lazrjs/choiceedit/tests/choiceedit.js (+1/-1) src-js/lazrjs/error/tests/error.js (+1/-1) src-js/lazrjs/error/tests/index.html (+4/-4) src-js/lazrjs/formoverlay/tests/formoverlay.html (+4/-4) src-js/lazrjs/formoverlay/tests/formoverlay.js (+1/-1) src-js/lazrjs/inlineedit/editor.js (+4/-6) src-js/lazrjs/inlineedit/tests/index.html (+4/-4) src-js/lazrjs/inlineedit/tests/inline_edit.js (+26/-11) src-js/lazrjs/lazr/lazr.js (+16/-16) src-js/lazrjs/overlay/tests/overlay.html (+4/-4) src-js/lazrjs/overlay/tests/overlay.js (+1/-1) src-js/lazrjs/picker/tests/picker.html (+4/-4) src-js/lazrjs/picker/tests/picker.js (+1/-1) src-js/lazrjs/testing/testing.js (+26/-22) src-py/lazr/js/skel/template.example (+2/-2) src-py/lazr/js/skel/template.test-html (+4/-4) src-py/lazr/js/skel/template.test-js (+1/-1) widgets.conf (+52/-52) |
To merge this branch: | bzr merge lp:~edwin-grubbs/lazr-js/activator-ie-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Māris Fogels (community) | Approve | ||
Canonical Launchpad Engineering | Pending | ||
Review via email: mp+14969@code.launchpad.net |
Commit message
Description of the change
Edwin Grubbs (edwin-grubbs) wrote : | # |
Māris Fogels (mars) wrote : | # |
Hi Edwin,
These changes look good, r=mars. I'm surprised by how subtle the IE fixes are.
The one question I had was: do we need the tabIndex attribute to be readonly, or is just setting to '-1' sufficient? Did we just prevent anyone from ever passing their own tabIndex into the constructor of the Widget? Put another way, does this effectively lock up tabIndex with "final int tabIndex = -1"?
I have only a few suggestions for polish:
• lines 147,170: Use .one() instead of .query()
• In the comment on line 192, the explanation is excellent, but please also explain why you chose to use get('tabIndex') instead of getAttribute(
• 374: instead of a for-in loop, which can be error-prone, consider using Y.each()
Maris
- 166. By Edwin Grubbs
-
Addressed reviewer comments.
- 167. By Edwin Grubbs
-
Merged in toolchain.
- 168. By Edwin Grubbs
-
Fixed widgets.conf.
- 169. By Edwin Grubbs
-
Fixed activator test includes.
- 170. By Edwin Grubbs
-
Fixed running tests standalone (not with jstestrunner).
- 171. By Edwin Grubbs
-
Fixed more places where yui is loaded.
Edwin Grubbs (edwin-grubbs) wrote : | # |
> Hi Edwin,
>
> These changes look good, r=mars. I'm surprised by how subtle the IE fixes
> are.
>
> The one question I had was: do we need the tabIndex attribute to be readonly,
> or is just setting to '-1' sufficient? Did we just prevent anyone from ever
> passing their own tabIndex into the constructor of the Widget? Put another
> way, does this effectively lock up tabIndex with "final int tabIndex = -1"?
>
> I have only a few suggestions for polish:
>
> • lines 147,170: Use .one() instead of .query()
> • In the comment on line 192, the explanation is excellent, but please also
> explain why you chose to use get('tabIndex') instead of
> getAttribute(
> • 374: instead of a for-in loop, which can be error-prone, consider using
> Y.each()
>
>
> Maris
Hi Maris,
Thanks for the review. I've addressed all the changes you requested, and we discussed your question on irc. After I merged in trunk, everything broke because:
1. src-js/
(removing two levels of directories)
2. build/yui/
This caused all the jstestdriver to fail until I updated the widgets.conf. BTW, if we upgrade to jstestdriver 1.2, we get a much clearer error message when files listed in widgets.conf don't exist, however, it causes firefox to display "not responding" errors that breaks the connection with jstestdriver. I'm not sure if Sidnei did anything to our current version of jstestdriver to prevent this from happening, but that is really not necessary to get this branch landed.
Even after jstestdriver was working, running the individual tests manually still didn't work until I updated all of them to point at the new directory. Most of the examples had already been updated. I verified that all the examples work except for examples/
Please review these changes.
Incremental diff:
{{{
=== modified file 'examples/
--- examples/
+++ examples/
@@ -2,8 +2,8 @@
"http://
<html>
<head>
- <title>Lazr-js examples: Activator</title>
- <script type="text/
+ <title>Lazr-js examples: Actions</title>
+ <script type="text/
<script type="text/
<script type="text/
<script type="text/
@@ -12,7 +12,7 @@
YUI({
- base: '../../
+ base: '../../build/',
filter: 'raw'
}).use('node', 'lazr.actions', function(Y) {
@@ -77,9 +77,9 @@
We need to include individual css files because some of them have
relative paths to images.
-->
- <link rel="stylesheet" type="text/css" href=".
- <link rel="stylesheet" type="text/css" href="../../bui...
Māris Fogels (mars) wrote : | # |
Hi Edwin,
Your additional changes look good to me. r=mars again.
Maris
- 172. By Edwin Grubbs
-
Merged in toolchain.
Preview Diff
1 | === modified file 'examples/actions/index.html' |
2 | --- examples/actions/index.html 2009-11-18 23:09:08 +0000 |
3 | +++ examples/actions/index.html 2009-11-30 19:14:09 +0000 |
4 | @@ -2,8 +2,8 @@ |
5 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
6 | <html> |
7 | <head> |
8 | - <title>Lazr-js examples: Activator</title> |
9 | - <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script> |
10 | + <title>Lazr-js examples: Actions</title> |
11 | + <script type="text/javascript" src="../../build/yui/yui.js"></script> |
12 | <script type="text/javascript" src="../../build/anim/anim.js"></script> |
13 | <script type="text/javascript" src="../../build/lazr/lazr.js"></script> |
14 | <script type="text/javascript" src="../../build/actions/actions.js"></script> |
15 | @@ -12,7 +12,7 @@ |
16 | |
17 | |
18 | YUI({ |
19 | - base: '../../build/yui/current/build/', |
20 | + base: '../../build/', |
21 | filter: 'raw' |
22 | }).use('node', 'lazr.actions', function(Y) { |
23 | |
24 | @@ -77,9 +77,9 @@ |
25 | We need to include individual css files because some of them have |
26 | relative paths to images. |
27 | --> |
28 | - <link rel="stylesheet" type="text/css" href="../../build/yui/current/build/cssreset/reset.css" /> |
29 | - <link rel="stylesheet" type="text/css" href="../../build/yui/current/build/cssfonts/fonts.css" /> |
30 | - <link rel="stylesheet" type="text/css" href="../../build/yui/current/build/cssbase/base.css" /> |
31 | + <link rel="stylesheet" type="text/css" href="../../build/cssreset/reset.css" /> |
32 | + <link rel="stylesheet" type="text/css" href="../../build/cssfonts/fonts.css" /> |
33 | + <link rel="stylesheet" type="text/css" href="../../build/cssbase/base.css" /> |
34 | |
35 | <link type="text/css" rel="stylesheet" href="../../build/lazr-sam.css"/> |
36 | <link type="text/css" rel="stylesheet" href="../../build/lazr/assets/skins/sam/lazr.css"/> |
37 | |
38 | === modified file 'examples/activator/index.html' |
39 | --- examples/activator/index.html 2009-11-19 17:27:44 +0000 |
40 | +++ examples/activator/index.html 2009-11-30 19:14:09 +0000 |
41 | @@ -166,7 +166,7 @@ |
42 | visibility: hidden"> |
43 | <form> |
44 | <input id="editor-1-textbox" type="text" autocomplete="off"/><br/> |
45 | -<input id="editor-1-save" type="submit" value="Save"/><br/> |
46 | +<button id="editor-1-save">Save</button><br/> |
47 | <a id="editor-1-cancel" href="http://www.ubuntu.com">Cancel</a><br/> |
48 | <button id="editor-1-failure">Trigger failure</button> |
49 | </form> |
50 | |
51 | === modified file 'examples/combo.html' |
52 | --- examples/combo.html 2009-11-19 17:27:44 +0000 |
53 | +++ examples/combo.html 2009-11-30 19:14:09 +0000 |
54 | @@ -128,7 +128,7 @@ |
55 | |
56 | <h3>Javascript</h3> |
57 | <pre> |
58 | - <script type="text/javascript" src="../../build/yui/current/build/yui/yui-min.js"></script> |
59 | + <script type="text/javascript" src="../../build/yui/yui-min.js"></script> |
60 | <script type="text/javascript" src="../../build/lazr/lazr-meta.js"></script> |
61 | </pre> |
62 | |
63 | |
64 | === modified file 'examples/formoverlay/index.html' |
65 | --- examples/formoverlay/index.html 2009-11-18 21:24:47 +0000 |
66 | +++ examples/formoverlay/index.html 2009-11-30 19:14:09 +0000 |
67 | @@ -123,7 +123,7 @@ |
68 | |
69 | <h3>Javascript</h3> |
70 | <pre> |
71 | - <script type="text/javascript" src="../../build/yui/current/build/yui/yui-min.js"></script> |
72 | + <script type="text/javascript" src="../../build/yui/yui-min.js"></script> |
73 | <script type="text/javascript" src="../../build/lazr/lazr-meta.js"></script> |
74 | </pre> |
75 | |
76 | |
77 | === modified file 'examples/lazr/index.html' |
78 | --- examples/lazr/index.html 2009-11-19 17:27:44 +0000 |
79 | +++ examples/lazr/index.html 2009-11-30 19:14:09 +0000 |
80 | @@ -49,6 +49,11 @@ |
81 | </script> |
82 | |
83 | <style id="style-overrides" type="text/css"> |
84 | + |
85 | + pre, code { |
86 | + background: #dddddd; |
87 | + } |
88 | + |
89 | #example { |
90 | margin-left: 5em; |
91 | padding: 3em; |
92 | @@ -139,13 +144,16 @@ |
93 | yes_button.set('innerHTML', 'yes'); |
94 | </pre> |
95 | |
96 | -<h2>Removing a Widget's tabindex attribute</h2> |
97 | +<h2>Disabling a Widget's tabindex attribute</h2> |
98 | |
99 | -<p><code>lazr.ui</code> provides a way to remove the tabindex attribute |
100 | +<p><code>lazr.ui</code> provides a way to disable the tabindex attribute |
101 | from a focused widget.</p> |
102 | |
103 | -<p>The attribute can be removed by augmenting a Widget with the |
104 | -<code>NoTabIndex</code> class:</p> |
105 | +<p>The tabindex can be disabled by augmenting a Widget with the |
106 | +<code>disableTabIndex</code> function. If you need to revert the |
107 | +behavior in certain instances, you can call my_widget.set('tabIndex', new_value) |
108 | +before syncUI() is called. If you need to revert the behavior |
109 | +in subclasses, you can set the WidgetSubclass.ATTRS['tabIndex'].</p> |
110 | |
111 | <p> |
112 | <strong>Use this with caution.</strong> tabindex is intended as an accessibility |
113 | @@ -154,10 +162,7 @@ |
114 | </p> |
115 | |
116 | <pre> |
117 | -// We need the 'true' parameter for Y.augment() to force overwriting of the |
118 | -// existing tabindex-associated methods. |
119 | - |
120 | -Y.augment(MyWidget, Y.lazr.ui.NoTabIndex, true); |
121 | +Y.lazr.ui.disableTabIndex(MyWidget); |
122 | </pre> |
123 | |
124 | </body> |
125 | |
126 | === modified file 'examples/picker/index.html' |
127 | --- examples/picker/index.html 2009-11-24 00:09:41 +0000 |
128 | +++ examples/picker/index.html 2009-11-30 19:14:09 +0000 |
129 | @@ -253,7 +253,7 @@ |
130 | |
131 | <h3>Javascript</h3> |
132 | <pre> |
133 | - <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script> |
134 | + <script type="text/javascript" src="../../build/yui/yui.js"></script> |
135 | <script type="text/javascript" src="../../build/lazr/lazr.js"></script> |
136 | <script type="text/javascript" src="../../build/overlay/overlay.js"></script> |
137 | <script type="text/javascript" src="../../build/picker/picker.js"></script> |
138 | |
139 | === modified file 'src-js/lazrjs/actions/tests/actions.html' |
140 | --- src-js/lazrjs/actions/tests/actions.html 2009-11-14 23:15:08 +0000 |
141 | +++ src-js/lazrjs/actions/tests/actions.html 2009-11-30 19:14:09 +0000 |
142 | @@ -5,10 +5,10 @@ |
143 | <title>Actions</title> |
144 | |
145 | <!-- YUI 3.0 Setup --> |
146 | - <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script> |
147 | - <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/> |
148 | - <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/> |
149 | - <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/> |
150 | + <script type="text/javascript" src="../../yui/yui/yui.js"></script> |
151 | + <link rel="stylesheet" href="../../yui/cssreset/reset.css"/> |
152 | + <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/> |
153 | + <link rel="stylesheet" href="../../yui/cssbase/base.css"/> |
154 | |
155 | <!-- The module under test --> |
156 | <script type="text/javascript" src="../../actions/actions.js"></script> |
157 | |
158 | === modified file 'src-js/lazrjs/actions/tests/actions.js' |
159 | --- src-js/lazrjs/actions/tests/actions.js 2009-11-18 23:09:08 +0000 |
160 | +++ src-js/lazrjs/actions/tests/actions.js 2009-11-30 19:14:09 +0000 |
161 | @@ -1,7 +1,7 @@ |
162 | /* Copyright (c) 2009, Canonical Ltd. All rights reserved. */ |
163 | |
164 | YUI({ |
165 | - base: '../../yui/current/build/', |
166 | + base: '../../yui/', |
167 | filter: 'raw', |
168 | combine: false |
169 | }).use('lazr.actions', 'lazr.testing.runner', 'node', |
170 | |
171 | === modified file 'src-js/lazrjs/activator/activator.js' |
172 | --- src-js/lazrjs/activator/activator.js 2009-11-18 21:24:47 +0000 |
173 | +++ src-js/lazrjs/activator/activator.js 2009-11-30 19:14:09 +0000 |
174 | @@ -242,6 +242,10 @@ |
175 | renderUI: function() { |
176 | // Just in case the user didn't assign the correct classes. |
177 | this.action_element.removeClass(C_HIDDEN); |
178 | + // Use   character to prevent IE7 from hiding the |
179 | + // yui-activator-act button, when it just has a background-image |
180 | + // and no content in it or in the data_box. |
181 | + this.get('contentBox').prepend(' '); |
182 | }, |
183 | |
184 | /** |
185 | @@ -268,11 +272,11 @@ |
186 | } |
187 | }); |
188 | |
189 | +Y.lazr.ui.disableTabIndex(Activator); |
190 | + |
191 | Y.namespace('lazr.activator'); |
192 | Y.lazr.activator.Activator = Activator; |
193 | |
194 | -// Nuke the tabindex attribute. |
195 | -Y.augment(Activator, Y.lazr.ui.NoTabIndex, true); |
196 | |
197 | }, "0.1", {"skinnable": true, |
198 | "requires": ["oop", "event", "node", "widget", |
199 | |
200 | === modified file 'src-js/lazrjs/activator/assets/skins/sam/activator-skin.css' |
201 | --- src-js/lazrjs/activator/assets/skins/sam/activator-skin.css 2009-03-20 04:17:08 +0000 |
202 | +++ src-js/lazrjs/activator/assets/skins/sam/activator-skin.css 2009-11-30 19:14:09 +0000 |
203 | @@ -24,6 +24,10 @@ |
204 | margin-left: auto; |
205 | margin-right: auto; |
206 | width: 30em; |
207 | + |
208 | + /* Center the message box on IE7. */ |
209 | + *left: 30%; |
210 | + *width: 40%; |
211 | } |
212 | |
213 | .yui-skin-sam button.yui-activator-message-close { |
214 | @@ -45,9 +49,10 @@ |
215 | } |
216 | |
217 | .yui-activator-message-body { |
218 | - padding: 0.5em; |
219 | - width: 29em; /* The width + 2*padding equals the message-box's width. */ |
220 | + padding: 0; |
221 | overflow: auto; |
222 | + /* Necessary for IE7. */ |
223 | + width: 100%; |
224 | } |
225 | |
226 | .yui-activator-failure .yui-activator-message-box { |
227 | |
228 | === modified file 'src-js/lazrjs/activator/tests/activator.html' |
229 | --- src-js/lazrjs/activator/tests/activator.html 2009-10-21 21:43:07 +0000 |
230 | +++ src-js/lazrjs/activator/tests/activator.html 2009-11-30 19:14:09 +0000 |
231 | @@ -5,10 +5,10 @@ |
232 | <title>Activator</title> |
233 | |
234 | <!-- YUI 3.0 Setup --> |
235 | - <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script> |
236 | - <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/> |
237 | - <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/> |
238 | - <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/> |
239 | + <script type="text/javascript" src="../../yui/yui/yui.js"></script> |
240 | + <link rel="stylesheet" href="../../yui/cssreset/reset.css"/> |
241 | + <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/> |
242 | + <link rel="stylesheet" href="../../yui/cssbase/base.css"/> |
243 | |
244 | <!-- The module under test --> |
245 | <script type="text/javascript" src="../../activator/activator.js"></script> |
246 | |
247 | === modified file 'src-js/lazrjs/activator/tests/activator.js' |
248 | --- src-js/lazrjs/activator/tests/activator.js 2009-10-21 21:54:04 +0000 |
249 | +++ src-js/lazrjs/activator/tests/activator.js 2009-11-30 19:14:09 +0000 |
250 | @@ -1,7 +1,7 @@ |
251 | /* Copyright (c) 2009, Canonical Ltd. All rights reserved. */ |
252 | |
253 | YUI({ |
254 | - base: '../../yui/current/build/', |
255 | + base: '../../yui/', |
256 | filter: 'raw', |
257 | combine: false |
258 | }).use('lazr.activator', 'lazr.testing.runner', 'node', |
259 | @@ -126,7 +126,8 @@ |
260 | |
261 | test_renderProcessing: function() { |
262 | this.activator.render(); |
263 | - var message = Y.Node.create('<b>processing message</b>'); |
264 | + var message_text = 'processing message'; |
265 | + var message = Y.Node.create('<b>' + message_text + '</b>'); |
266 | Assert.isFalse( |
267 | this.activator.get('contentBox').hasClass( |
268 | 'yui-activator-processing'), |
269 | @@ -139,18 +140,22 @@ |
270 | 'yui-activator-processing'), |
271 | 'renderProcessing did not add the processing css class'); |
272 | |
273 | - var message_body = this.activator.get('contentBox').query( |
274 | + var message_body = this.activator.get('contentBox').one( |
275 | '.yui-activator-message-body'); |
276 | |
277 | + // Opera uppercases all tags, Safari lowercases all tags, |
278 | + // and IE gets an extra _yuid attribute in the <b>. |
279 | + var added_node = message_body.one('b'); |
280 | Assert.areEqual( |
281 | - '<b>processing message</b>', |
282 | - message_body.get('innerHTML'), |
283 | + message_text, |
284 | + added_node.get('innerHTML'), |
285 | 'renderProcessing did not set the contents of the message-body'); |
286 | }, |
287 | |
288 | test_renderCancellation: function() { |
289 | this.activator.render(); |
290 | - var message = Y.Node.create('<b>cancel message</b>'); |
291 | + var message_text = 'cancel message'; |
292 | + var message = Y.Node.create('<b>' + message_text + '</b>'); |
293 | Assert.isFalse( |
294 | this.activator.get('contentBox').hasClass( |
295 | 'yui-activator-cancellation'), |
296 | @@ -163,11 +168,14 @@ |
297 | 'yui-activator-cancellation'), |
298 | 'renderCancellation did not add the cancel css class'); |
299 | |
300 | - var message_body = this.activator.get('contentBox').query( |
301 | + var message_body = this.activator.get('contentBox').one( |
302 | '.yui-activator-message-body'); |
303 | + // Opera uppercases all tags, Safari lowercases all tags, |
304 | + // and IE gets an extra _yuid attribute in the <b>. |
305 | + var added_node = message_body.one('b'); |
306 | Assert.areEqual( |
307 | - '<b>cancel message</b>', |
308 | - message_body.get('innerHTML'), |
309 | + message_text, |
310 | + added_node.get('innerHTML'), |
311 | "renderCancellation didn't set the contents of the message-body"); |
312 | }, |
313 | |
314 | @@ -233,14 +241,22 @@ |
315 | 'Message body contents should still be there.'); |
316 | }, |
317 | |
318 | - test_widget_does_not_have_a_tabindex_when_focused: function() { |
319 | + test_widget_has_a_disabled_tabindex_when_focused: function() { |
320 | // The tabindex attribute appears when the widget is focused. |
321 | this.activator.render(); |
322 | this.activator.focus(); |
323 | |
324 | - Assert.isFalse( |
325 | - this.activator.get('boundingBox').hasAttribute('tabindex'), |
326 | - "The widget should not have a tabindex attribute."); |
327 | + // Be aware that in IE when the tabIndex is set to -1, |
328 | + // get('tabIndex') returns -1 as expected but getAttribute('tabIndex') |
329 | + // returns 65535. This is due to YUI's getAttribute() calling |
330 | + // dom_node.getAttribute('tabIndex', 2), which is an IE extension |
331 | + // that happens to treat this attribute as an unsigned integer instead |
332 | + // of as a signed integer. |
333 | + // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx |
334 | + Assert.areEqual( |
335 | + -1, |
336 | + this.activator.get('boundingBox').get('tabIndex'), |
337 | + "The widget should have a tabindex of -1 (disabled)."); |
338 | } |
339 | })); |
340 | |
341 | |
342 | === modified file 'src-js/lazrjs/anim/tests/anim.html' |
343 | --- src-js/lazrjs/anim/tests/anim.html 2009-11-10 17:49:09 +0000 |
344 | +++ src-js/lazrjs/anim/tests/anim.html 2009-11-30 19:14:09 +0000 |
345 | @@ -5,10 +5,10 @@ |
346 | <title>Anim</title> |
347 | |
348 | <!-- YUI 3.0 Setup --> |
349 | - <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script> |
350 | - <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/> |
351 | - <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/> |
352 | - <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/> |
353 | + <script type="text/javascript" src="../../yui/yui/yui.js"></script> |
354 | + <link rel="stylesheet" href="../../yui/cssreset/reset.css"/> |
355 | + <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/> |
356 | + <link rel="stylesheet" href="../../yui/cssbase/base.css"/> |
357 | |
358 | <!-- The module under test --> |
359 | <script type="text/javascript" src="../../anim/anim.js"></script> |
360 | |
361 | === modified file 'src-js/lazrjs/anim/tests/anim.js' |
362 | --- src-js/lazrjs/anim/tests/anim.js 2009-11-10 22:18:32 +0000 |
363 | +++ src-js/lazrjs/anim/tests/anim.js 2009-11-30 19:14:09 +0000 |
364 | @@ -1,7 +1,7 @@ |
365 | /* Copyright (c) 2009, Canonical Ltd. All rights reserved. */ |
366 | |
367 | YUI({ |
368 | - base: '../../yui/current/build/', |
369 | + base: '../../yui/', |
370 | filter: 'raw', |
371 | combine: false |
372 | }).use('lazr.anim', 'lazr.testing.runner', 'node', |
373 | |
374 | === modified file 'src-js/lazrjs/autocomplete/tests/autocomplete.js' |
375 | --- src-js/lazrjs/autocomplete/tests/autocomplete.js 2009-10-21 21:43:07 +0000 |
376 | +++ src-js/lazrjs/autocomplete/tests/autocomplete.js 2009-11-30 19:14:09 +0000 |
377 | @@ -1,7 +1,7 @@ |
378 | /* Copyright (c) 2009, Canonical Ltd. All rights reserved. */ |
379 | |
380 | YUI({ |
381 | - base: '../../yui/current/build/', |
382 | + base: '../../yui/', |
383 | filter: 'raw', |
384 | combine: false |
385 | }).use('lazr.autocomplete', 'lazr.testing.runner', |
386 | |
387 | === modified file 'src-js/lazrjs/autocomplete/tests/index.html' |
388 | --- src-js/lazrjs/autocomplete/tests/index.html 2009-10-21 21:43:07 +0000 |
389 | +++ src-js/lazrjs/autocomplete/tests/index.html 2009-11-30 19:14:09 +0000 |
390 | @@ -5,10 +5,10 @@ |
391 | <title>autocomplete unit tests</title> |
392 | |
393 | <!-- YUI 3.0 Setup --> |
394 | - <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script> |
395 | - <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/> |
396 | - <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/> |
397 | - <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/> |
398 | + <script type="text/javascript" src="../../yui/yui/yui.js"></script> |
399 | + <link rel="stylesheet" href="../../yui/cssreset/reset.css"/> |
400 | + <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/> |
401 | + <link rel="stylesheet" href="../../yui/cssbase/base.css"/> |
402 | |
403 | <link rel="stylesheet" href="../../testing/assets/testlogger.css"/> |
404 | <script type="text/javascript" src="../../testing/testing.js"></script> |
405 | |
406 | === modified file 'src-js/lazrjs/choiceedit/tests/choiceedit.html' |
407 | --- src-js/lazrjs/choiceedit/tests/choiceedit.html 2009-10-21 21:43:07 +0000 |
408 | +++ src-js/lazrjs/choiceedit/tests/choiceedit.html 2009-11-30 19:14:09 +0000 |
409 | @@ -4,10 +4,10 @@ |
410 | <title>Status Editor</title> |
411 | |
412 | <!-- YUI 3.0 Setup --> |
413 | - <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script> |
414 | - <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/> |
415 | - <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/> |
416 | - <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/> |
417 | + <script type="text/javascript" src="../../yui/yui/yui.js"></script> |
418 | + <link rel="stylesheet" href="../../yui/cssreset/reset.css"/> |
419 | + <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/> |
420 | + <link rel="stylesheet" href="../../yui/cssbase/base.css"/> |
421 | |
422 | <!-- Dependency --> |
423 | <script type="text/javascript" src="../../lazr/lazr.js"></script> |
424 | |
425 | === modified file 'src-js/lazrjs/choiceedit/tests/choiceedit.js' |
426 | --- src-js/lazrjs/choiceedit/tests/choiceedit.js 2009-11-13 15:37:35 +0000 |
427 | +++ src-js/lazrjs/choiceedit/tests/choiceedit.js 2009-11-30 19:14:09 +0000 |
428 | @@ -1,7 +1,7 @@ |
429 | /* Copyright (c) 2008, Canonical Ltd. All rights reserved. */ |
430 | |
431 | YUI({ |
432 | - base: '../../yui/current/build/', |
433 | + base: '../../yui/', |
434 | filter: 'raw', |
435 | combine: false |
436 | }).use('lazr.choiceedit', 'lazr.testing.runner', 'node', |
437 | |
438 | === modified file 'src-js/lazrjs/error/tests/error.js' |
439 | --- src-js/lazrjs/error/tests/error.js 2009-11-24 08:08:53 +0000 |
440 | +++ src-js/lazrjs/error/tests/error.js 2009-11-30 19:14:09 +0000 |
441 | @@ -16,7 +16,7 @@ |
442 | */ |
443 | |
444 | YUI({ |
445 | - base: '../../yui/current/build/', |
446 | + base: '../../yui/', |
447 | filter: 'raw', |
448 | combine: false |
449 | }).use('lazr.error', 'lazr.error-widgets', 'lazr.testing.runner', 'node', |
450 | |
451 | === modified file 'src-js/lazrjs/error/tests/index.html' |
452 | --- src-js/lazrjs/error/tests/index.html 2009-11-21 22:17:49 +0000 |
453 | +++ src-js/lazrjs/error/tests/index.html 2009-11-30 19:14:09 +0000 |
454 | @@ -5,10 +5,10 @@ |
455 | <title>Lazr error unit tests</title> |
456 | |
457 | <!-- YUI 3.0 Setup --> |
458 | - <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script> |
459 | - <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/> |
460 | - <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/> |
461 | - <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/> |
462 | + <script type="text/javascript" src="../../yui/yui/yui.js"></script> |
463 | + <link rel="stylesheet" href="../../yui/cssreset/reset.css"/> |
464 | + <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/> |
465 | + <link rel="stylesheet" href="../../yui/cssbase/base.css"/> |
466 | |
467 | <link rel="stylesheet" href="../../testing/assets/testlogger.css"/> |
468 | |
469 | |
470 | === modified file 'src-js/lazrjs/formoverlay/tests/formoverlay.html' |
471 | --- src-js/lazrjs/formoverlay/tests/formoverlay.html 2009-10-21 21:43:07 +0000 |
472 | +++ src-js/lazrjs/formoverlay/tests/formoverlay.html 2009-11-30 19:14:09 +0000 |
473 | @@ -4,10 +4,10 @@ |
474 | <title>Form Overlay</title> |
475 | |
476 | <!-- YUI 3.0 Setup --> |
477 | - <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script> |
478 | - <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/> |
479 | - <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/> |
480 | - <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/> |
481 | + <script type="text/javascript" src="../../yui/yui/yui.js"></script> |
482 | + <link rel="stylesheet" href="../../yui/cssreset/reset.css"/> |
483 | + <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/> |
484 | + <link rel="stylesheet" href="../../yui/cssbase/base.css"/> |
485 | <link rel="stylesheet" href="../../testing/assets/testlogger.css"/> |
486 | |
487 | <!-- dependent modules from lazr--> |
488 | |
489 | === modified file 'src-js/lazrjs/formoverlay/tests/formoverlay.js' |
490 | --- src-js/lazrjs/formoverlay/tests/formoverlay.js 2009-11-13 20:50:08 +0000 |
491 | +++ src-js/lazrjs/formoverlay/tests/formoverlay.js 2009-11-30 19:14:09 +0000 |
492 | @@ -1,7 +1,7 @@ |
493 | /* Copyright (c) 2008, Canonical Ltd. All rights reserved. */ |
494 | |
495 | YUI({ |
496 | - base: '../../yui/current/build/', |
497 | + base: '../../yui/', |
498 | filter: 'raw', |
499 | combine: false |
500 | }).use('lazr.formoverlay', 'lazr.testing.runner', |
501 | |
502 | === modified file 'src-js/lazrjs/inlineedit/editor.js' |
503 | --- src-js/lazrjs/inlineedit/editor.js 2009-11-18 21:34:09 +0000 |
504 | +++ src-js/lazrjs/inlineedit/editor.js 2009-11-30 19:14:09 +0000 |
505 | @@ -994,11 +994,10 @@ |
506 | |
507 | }); |
508 | |
509 | +Y.lazr.ui.disableTabIndex(InlineEditor); |
510 | + |
511 | Y.InlineEditor = InlineEditor; |
512 | |
513 | -// Nuke the tabindex attribute. |
514 | -Y.augment(InlineEditor, Y.lazr.ui.NoTabIndex, true); |
515 | - |
516 | |
517 | var ETEXT = 'editable_text', |
518 | TEXT = 'text', |
519 | @@ -1492,11 +1491,10 @@ |
520 | } |
521 | }); |
522 | |
523 | +Y.lazr.ui.disableTabIndex(EditableText); |
524 | + |
525 | Y.EditableText = EditableText; |
526 | |
527 | -// Nuke the tabindex attribute. |
528 | -Y.augment(EditableText, Y.lazr.ui.NoTabIndex, true); |
529 | - |
530 | //~ Y.log("Module loaded", 'info', 'lazr.editor'); |
531 | |
532 | }, "0.2", {"skinnable": true, |
533 | |
534 | === modified file 'src-js/lazrjs/inlineedit/tests/index.html' |
535 | --- src-js/lazrjs/inlineedit/tests/index.html 2009-10-21 21:43:07 +0000 |
536 | +++ src-js/lazrjs/inlineedit/tests/index.html 2009-11-30 19:14:09 +0000 |
537 | @@ -5,10 +5,10 @@ |
538 | <title>Inline Edit</title> |
539 | |
540 | <!-- YUI 3.0 Setup --> |
541 | - <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script> |
542 | - <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/> |
543 | - <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/> |
544 | - <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/> |
545 | + <script type="text/javascript" src="../../yui/yui/yui.js"></script> |
546 | + <link rel="stylesheet" href="../../yui/cssreset/reset.css"/> |
547 | + <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/> |
548 | + <link rel="stylesheet" href="../../yui/cssbase/base.css"/> |
549 | <link rel="stylesheet" href="../../testing/assets/testlogger.css"/> |
550 | |
551 | <!-- The module under test --> |
552 | |
553 | === modified file 'src-js/lazrjs/inlineedit/tests/inline_edit.js' |
554 | --- src-js/lazrjs/inlineedit/tests/inline_edit.js 2009-11-13 15:37:35 +0000 |
555 | +++ src-js/lazrjs/inlineedit/tests/inline_edit.js 2009-11-30 19:14:09 +0000 |
556 | @@ -1,7 +1,7 @@ |
557 | /* Copyright (c) 2009, Canonical Ltd. All rights reserved. */ |
558 | |
559 | YUI({ |
560 | - base: '../../yui/current/build/', |
561 | + base: '../../yui/', |
562 | filter: 'raw', |
563 | combine: false |
564 | }).use('lazr.editor', 'lazr.testing.runner', 'node', |
565 | @@ -314,14 +314,20 @@ |
566 | this.wait(5000); |
567 | }, |
568 | |
569 | - test_widget_does_not_have_a_tabindex_when_focused: function() { |
570 | + test_widget_has_a_disabled_tabindex_when_focused: function() { |
571 | // The tabindex attribute appears when the widget is focused. |
572 | this.editor.render(); |
573 | this.editor.focus(); |
574 | |
575 | - Assert.isFalse( |
576 | - this.editor.get('boundingBox').hasAttribute('tabindex'), |
577 | - "The widget should not have a tabindex attribute."); |
578 | + // Be aware that in IE, get('tabIndex') and getAttribute('tabIndex') |
579 | + // return different values when set to -1. This is due to YUI's |
580 | + // getAttribute() calling dom_node.getAttribute('tabIndex', 2), which |
581 | + // is an IE extension. |
582 | + // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx |
583 | + Assert.areEqual( |
584 | + -1, |
585 | + this.editor.get('boundingBox').get('tabIndex'), |
586 | + "The widget should have a tabindex of -1 (disabled)."); |
587 | }, |
588 | |
589 | test_enter_key_saves_input: function() { |
590 | @@ -794,14 +800,24 @@ |
591 | "also be set to 'false'."); |
592 | }, |
593 | |
594 | - test_widget_does_not_have_a_tabindex_when_focused: function() { |
595 | + test_widget_has_a_disabled_tabindex_when_focused: function() { |
596 | // The tabindex attribute appears when the widget is focused. |
597 | this.etext.render(); |
598 | this.etext.focus(); |
599 | |
600 | - Assert.isFalse( |
601 | - this.etext.get('boundingBox').hasAttribute('tabindex'), |
602 | - "The widget should not have a tabindex attribute."); |
603 | + // Be aware that in IE, get('tabIndex') and getAttribute('tabIndex') |
604 | + // return different values when set to -1. This is due to YUI's |
605 | + // getAttribute() calling dom_node.getAttribute('tabIndex', 2), which |
606 | + // is an IE extension. |
607 | + // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx |
608 | + |
609 | + // On IE and KHTML, EditableText._onRender() will prevent the |
610 | + // default widget rendering that would set the tabIndex on the |
611 | + // boundingBox, so this test will fail for those browsers. |
612 | + Assert.areEqual( |
613 | + -1, |
614 | + this.etext.get('boundingBox').get('tabIndex'), |
615 | + "The widget should have a tabindex of -1 (disabled)."); |
616 | }, |
617 | |
618 | test_trigger_is_disabled_if_the_widget_is_not_rendered: function() { |
619 | @@ -884,8 +900,7 @@ |
620 | null, |
621 | box, |
622 | "Multi-line editor should have a top button box."); |
623 | - }, |
624 | - |
625 | + } |
626 | })); |
627 | |
628 | suite.add(new Y.Test.Case({ |
629 | |
630 | === modified file 'src-js/lazrjs/lazr/lazr.js' |
631 | --- src-js/lazrjs/lazr/lazr.js 2009-11-18 21:24:47 +0000 |
632 | +++ src-js/lazrjs/lazr/lazr.js 2009-11-30 19:14:09 +0000 |
633 | @@ -91,27 +91,27 @@ |
634 | UI.CSS_ODD = getCN(LAZR, 'odd'); |
635 | |
636 | /** |
637 | - * This object implements the necessary code to prevent the tabindex attribute |
638 | - * from being added to Widget instances. It is intended to augment existing |
639 | - * classes. |
640 | + * This function forces a class to have a tabIndex attribute which |
641 | + * takes the widget's boundingBox out of the tab order. |
642 | + * It is intended to be called on subclasses of Widget. |
643 | * |
644 | * Use with caution. tabindex is intended as a usability feature, for |
645 | * keyboard accessibility, and visual feedback. If you disable it, be sure to |
646 | * have a really good reason, or a replacement ready. |
647 | * |
648 | - * @class NoTabIndex |
649 | - */ |
650 | -UI.NoTabIndex = function() {}; |
651 | - |
652 | -/** |
653 | - * Override setting the widget's tabindex attribute. Since this widget |
654 | - * is in-page, then having a tabindex just messes up the page tab-order. |
655 | - * |
656 | - * @method _uiSetTabIndex |
657 | - * @param index {NUM} The tab index to (not) set. |
658 | - * @protected |
659 | - */ |
660 | -UI.NoTabIndex.prototype._uiSetTabIndex = function(index) {}; |
661 | + * @method disableTabIndex |
662 | + * @param {Class} widget_class Widget that should not be in the tab order. |
663 | + */ |
664 | +UI.disableTabIndex = function(widget_class) { |
665 | + if (widget_class === undefined) { |
666 | + throw "disableTabIndex() must be called after ATTRS " + |
667 | + "is set on the widget."; |
668 | + } |
669 | + widget_class.ATTRS.tabIndex = { |
670 | + readOnly: true, |
671 | + value: -1 |
672 | + }; |
673 | +}; |
674 | |
675 | /** |
676 | * Standard class for the UI 'waiting for new content' indicator. |
677 | |
678 | === modified file 'src-js/lazrjs/overlay/tests/overlay.html' |
679 | --- src-js/lazrjs/overlay/tests/overlay.html 2009-10-21 21:43:07 +0000 |
680 | +++ src-js/lazrjs/overlay/tests/overlay.html 2009-11-30 19:14:09 +0000 |
681 | @@ -5,10 +5,10 @@ |
682 | <title>Pretty Overlay</title> |
683 | |
684 | <!-- YUI 3.0 Setup --> |
685 | - <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script> |
686 | - <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/> |
687 | - <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/> |
688 | - <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/> |
689 | + <script type="text/javascript" src="../../yui/yui/yui.js"></script> |
690 | + <link rel="stylesheet" href="../../yui/cssreset/reset.css"/> |
691 | + <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/> |
692 | + <link rel="stylesheet" href="../../yui/cssbase/base.css"/> |
693 | <link rel="stylesheet" href="../../testing/assets/testlogger.css"/> |
694 | |
695 | <!-- The module under test --> |
696 | |
697 | === modified file 'src-js/lazrjs/overlay/tests/overlay.js' |
698 | --- src-js/lazrjs/overlay/tests/overlay.js 2009-11-13 15:37:35 +0000 |
699 | +++ src-js/lazrjs/overlay/tests/overlay.js 2009-11-30 19:14:09 +0000 |
700 | @@ -1,7 +1,7 @@ |
701 | /* Copyright (c) 2009, Canonical Ltd. All rights reserved. */ |
702 | |
703 | YUI({ |
704 | - base: '../../yui/current/build/', |
705 | + base: '../../yui/', |
706 | filter: 'raw', |
707 | combine: false |
708 | }).use('lazr.overlay', 'lazr.testing.runner', 'node', |
709 | |
710 | === modified file 'src-js/lazrjs/picker/tests/picker.html' |
711 | --- src-js/lazrjs/picker/tests/picker.html 2009-10-21 21:43:07 +0000 |
712 | +++ src-js/lazrjs/picker/tests/picker.html 2009-11-30 19:14:09 +0000 |
713 | @@ -5,10 +5,10 @@ |
714 | <title>Picker</title> |
715 | |
716 | <!-- YUI 3.0 Setup --> |
717 | - <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script> |
718 | - <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/> |
719 | - <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/> |
720 | - <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/> |
721 | + <script type="text/javascript" src="../../yui/yui/yui.js"></script> |
722 | + <link rel="stylesheet" href="../../yui/cssreset/reset.css"/> |
723 | + <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/> |
724 | + <link rel="stylesheet" href="../../yui/cssbase/base.css"/> |
725 | <link rel="stylesheet" href="../../testing/assets/testlogger.css"/> |
726 | |
727 | <!-- The module under test --> |
728 | |
729 | === modified file 'src-js/lazrjs/picker/tests/picker.js' |
730 | --- src-js/lazrjs/picker/tests/picker.js 2009-11-24 00:09:41 +0000 |
731 | +++ src-js/lazrjs/picker/tests/picker.js 2009-11-30 19:14:09 +0000 |
732 | @@ -1,7 +1,7 @@ |
733 | /* Copyright (c) 2009, Canonical Ltd. All rights reserved. */ |
734 | |
735 | YUI({ |
736 | - base: '../../yui/current/build/', |
737 | + base: '../../yui/', |
738 | filter: 'raw', |
739 | combine: false |
740 | }).use('lazr.picker', 'lazr.testing.runner', 'node', |
741 | |
742 | === modified file 'src-js/lazrjs/testing/testing.js' |
743 | --- src-js/lazrjs/testing/testing.js 2009-11-12 21:35:17 +0000 |
744 | +++ src-js/lazrjs/testing/testing.js 2009-11-30 19:14:09 +0000 |
745 | @@ -23,9 +23,8 @@ |
746 | // JsTestDriver. |
747 | var tests = []; |
748 | |
749 | - for (var idx in suite.items) { |
750 | + Y.each(suite.items, function(testCase, idx) { |
751 | var suiteName = suite.name; |
752 | - var testCase = suite.items[idx]; |
753 | var testCaseName = testCase.name; |
754 | |
755 | var clone = {}; |
756 | @@ -40,36 +39,36 @@ |
757 | // TestCase that wraps a single YUI TestSuite, that wraps |
758 | // a clone of the original TestCase but with only the |
759 | // single test method that we are interested in. |
760 | - for (var prop in testCase){ |
761 | - if (prop.indexOf("test") === 0 && |
762 | - Y.Lang.isFunction(testCase[prop])){ |
763 | + Y.each(testCase, function(property, name) { |
764 | + if (name.indexOf("test") === 0 && |
765 | + Y.Lang.isFunction(property)){ |
766 | tests.push({"suiteName": suiteName, |
767 | "caseName": testCaseName, |
768 | "case": clone, |
769 | - "methodName": prop, |
770 | - "method": testCase[prop]}); |
771 | + "methodName": name, |
772 | + "method": property}); |
773 | } |
774 | - } |
775 | - } |
776 | + }); |
777 | + }); |
778 | |
779 | - for (var i=0; i<tests.length; i++){ |
780 | + Y.each(tests, function(testObject, i) { |
781 | testObject = tests[i]; |
782 | |
783 | var fakeTestCase = { |
784 | "setUp": Y.bind(function(testObject){ |
785 | - var testSuite = new Y.Test.Suite(testObject["suiteName"]); |
786 | - var testCase = new Y.Test.Case(testObject["case"]); |
787 | - testCase[testObject["methodName"]] = testObject["method"]; |
788 | + var testSuite = new Y.Test.Suite(testObject.suiteName); |
789 | + var testCase = new Y.Test.Case(testObject['case']); |
790 | + testCase[testObject.methodName] = testObject.method; |
791 | testSuite.add(testCase); |
792 | Y.Test.Runner.clear(); |
793 | Y.Test.Runner.add(testSuite); |
794 | }, this, testObject), |
795 | "tearDown": function(){ |
796 | Y.Test.Runner.clear(); |
797 | - }, |
798 | + } |
799 | }; |
800 | |
801 | - fakeTestCase[testObject["methodName"]] = Y.bind(function (testObject) { |
802 | + fakeTestCase[testObject.methodName] = Y.bind(function (testObject) { |
803 | var results = []; |
804 | |
805 | var onComplete = function (caseName, methodName, results, e) { |
806 | @@ -79,8 +78,8 @@ |
807 | |
808 | Y.Test.Runner.subscribe( |
809 | "testsuitecomplete", |
810 | - Y.bind(onComplete, this, testObject["caseName"], |
811 | - testObject["methodName"], results), |
812 | + Y.bind(onComplete, this, testObject.caseName, |
813 | + testObject.methodName, results), |
814 | Y.Test.Runner); |
815 | |
816 | Clock.reset(); |
817 | @@ -93,16 +92,21 @@ |
818 | if (result === undefined) { |
819 | fail("Test did not finish after 100 iterations."); |
820 | } else { |
821 | - if (result["result"] == "fail"){ |
822 | - fail(result["message"]); |
823 | + if (result.result == "fail") { |
824 | + fail(result.message); |
825 | } |
826 | } |
827 | |
828 | }, this, testObject); |
829 | |
830 | - TestCase(testObject["caseName"] + "." + testObject["methodName"], |
831 | - fakeTestCase); |
832 | - } |
833 | + // JSLint will complain if the constructur is used without `new` |
834 | + // and if the result of `new` is not used. The TestCase class is |
835 | + // defined globally by jstestdriver and automatically registers |
836 | + // itself, so it is not necessary to return this object. |
837 | + var ignored = new TestCase( |
838 | + testObject.caseName + "." + testObject.methodName, |
839 | + fakeTestCase); |
840 | + }); |
841 | } |
842 | }; |
843 | |
844 | |
845 | === modified file 'src-py/lazr/js/skel/template.example' |
846 | --- src-py/lazr/js/skel/template.example 2009-11-12 21:05:22 +0000 |
847 | +++ src-py/lazr/js/skel/template.example 2009-11-30 19:14:09 +0000 |
848 | @@ -3,13 +3,13 @@ |
849 | <html> |
850 | <head> |
851 | <title>Lazr-js examples: ${WIDGET_NAME}</title> |
852 | - <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script> |
853 | + <script type="text/javascript" src="../../build/yui/yui.js"></script> |
854 | <script type="text/javascript" src="../../build/lazr/lazr.js"></script> |
855 | <script type="text/javascript" src="../../build/${WIDGET_NAME}/${WIDGET_NAME}.js"></script> |
856 | <script type="text/javascript"> |
857 | |
858 | YUI({ |
859 | - base: '../../build/yui/current/build/', |
860 | + base: '../../build/', |
861 | filter: 'raw' |
862 | }).use('node', 'event', 'lazr.${WIDGET_NAME}', function(Y) { |
863 | |
864 | |
865 | === modified file 'src-py/lazr/js/skel/template.test-html' |
866 | --- src-py/lazr/js/skel/template.test-html 2009-11-12 21:15:54 +0000 |
867 | +++ src-py/lazr/js/skel/template.test-html 2009-11-30 19:14:09 +0000 |
868 | @@ -5,10 +5,10 @@ |
869 | <title>${WIDGET_NAME} unit tests</title> |
870 | |
871 | <!-- YUI 3.0 Setup --> |
872 | - <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script> |
873 | - <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/> |
874 | - <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/> |
875 | - <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/> |
876 | + <script type="text/javascript" src="../../yui/yui/yui.js"></script> |
877 | + <link rel="stylesheet" href="../../yui/cssreset/reset.css"/> |
878 | + <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/> |
879 | + <link rel="stylesheet" href="../../yui/cssbase/base.css"/> |
880 | |
881 | <link rel="stylesheet" href="../../testing/assets/testlogger.css"/> |
882 | |
883 | |
884 | === modified file 'src-py/lazr/js/skel/template.test-js' |
885 | --- src-py/lazr/js/skel/template.test-js 2009-11-12 21:05:22 +0000 |
886 | +++ src-py/lazr/js/skel/template.test-js 2009-11-30 19:14:09 +0000 |
887 | @@ -16,7 +16,7 @@ |
888 | */ |
889 | |
890 | YUI({ |
891 | - base: '../../yui/current/build/', |
892 | + base: '../../yui/', |
893 | filter: 'raw', |
894 | combine: false |
895 | }).use('lazr.${WIDGET_NAME}', 'lazr.testing.runner', 'node', 'event', 'yuitest', 'console', function(Y) { |
896 | |
897 | === modified file 'widgets.conf' |
898 | --- widgets.conf 2009-11-03 21:59:24 +0000 |
899 | +++ widgets.conf 2009-11-30 19:14:09 +0000 |
900 | @@ -1,62 +1,62 @@ |
901 | load: |
902 | - - src-js/lazrjs/yui/current/build/cssreset/reset.css |
903 | - - src-js/lazrjs/yui/current/build/cssfonts/fonts.css |
904 | - - src-js/lazrjs/yui/current/build/cssbase/base.css |
905 | - - src-js/lazrjs/yui/current/build/widget/assets/skins/sam/widget.css |
906 | - - src-js/lazrjs/yui/current/build/widget/assets/skins/sam/widget-stack.css |
907 | - - src-js/lazrjs/yui/current/build/console/assets/skins/sam/console.css |
908 | - - src-js/lazrjs/yui/current/build/node-menunav/assets/skins/sam/node-menunav.css |
909 | + - src-js/lazrjs/yui/cssreset/reset.css |
910 | + - src-js/lazrjs/yui/cssfonts/fonts.css |
911 | + - src-js/lazrjs/yui/cssbase/base.css |
912 | + - src-js/lazrjs/yui/widget/assets/skins/sam/widget.css |
913 | + - src-js/lazrjs/yui/widget/assets/skins/sam/widget-stack.css |
914 | + - src-js/lazrjs/yui/console/assets/skins/sam/console.css |
915 | + - src-js/lazrjs/yui/node-menunav/assets/skins/sam/node-menunav.css |
916 | - src-js/lazrjs/testing/assets/testlogger.css |
917 | - src-js/lazrjs/testing/jsUnitMockTimeout.js |
918 | |
919 | # Unbundle yui.js so that the dynamic script loader is neither included nor |
920 | # activated. |
921 | - - src-js/lazrjs/yui/current/build/yui/yui-base.js |
922 | - - src-js/lazrjs/yui/current/build/yui/yui-log.js |
923 | - - src-js/lazrjs/yui/current/build/yui/yui-later.js |
924 | + - src-js/lazrjs/yui/yui/yui-base.js |
925 | + - src-js/lazrjs/yui/yui/yui-log.js |
926 | + - src-js/lazrjs/yui/yui/yui-later.js |
927 | |
928 | - - src-js/lazrjs/yui/current/build/anim/anim-easing.js |
929 | - - src-js/lazrjs/yui/current/build/anim/anim.js |
930 | - - src-js/lazrjs/yui/current/build/async-queue/async-queue.js |
931 | - - src-js/lazrjs/yui/current/build/attribute/attribute.js |
932 | - - src-js/lazrjs/yui/current/build/base/base.js |
933 | - - src-js/lazrjs/yui/current/build/cache/cache.js |
934 | - - src-js/lazrjs/yui/current/build/classnamemanager/classnamemanager.js |
935 | - - src-js/lazrjs/yui/current/build/console/console.js |
936 | - - src-js/lazrjs/yui/current/build/dataschema/dataschema-array.js |
937 | - - src-js/lazrjs/yui/current/build/dataschema/dataschema-base.js |
938 | - - src-js/lazrjs/yui/current/build/dataschema/dataschema-json.js |
939 | - - src-js/lazrjs/yui/current/build/dataschema/dataschema-text.js |
940 | - - src-js/lazrjs/yui/current/build/dataschema/dataschema-xml.js |
941 | - - src-js/lazrjs/yui/current/build/datasource/datasource.js |
942 | - - src-js/lazrjs/yui/current/build/datatype/datatype-date.js |
943 | - - src-js/lazrjs/yui/current/build/datatype/datatype-xml.js |
944 | - - src-js/lazrjs/yui/current/build/datatype/datatype.js |
945 | - - src-js/lazrjs/yui/current/build/dom/dom.js |
946 | - - src-js/lazrjs/yui/current/build/dump/dump.js |
947 | - - src-js/lazrjs/yui/current/build/event-custom/event-custom.js |
948 | - - src-js/lazrjs/yui/current/build/event-simulate/event-simulate.js |
949 | - - src-js/lazrjs/yui/current/build/event/event.js |
950 | - - src-js/lazrjs/yui/current/build/get/get.js |
951 | - - src-js/lazrjs/yui/current/build/io/io-form.js |
952 | - - src-js/lazrjs/yui/current/build/io/io.js |
953 | - - src-js/lazrjs/yui/current/build/json/json.js |
954 | - - src-js/lazrjs/yui/current/build/node-focusmanager/node-focusmanager.js |
955 | - - src-js/lazrjs/yui/current/build/node-menunav/node-menunav.js |
956 | - - src-js/lazrjs/yui/current/build/node/node-event-simulate.js |
957 | - - src-js/lazrjs/yui/current/build/node/node.js |
958 | - - src-js/lazrjs/yui/current/build/oop/oop.js |
959 | - - src-js/lazrjs/yui/current/build/overlay/overlay.js |
960 | - - src-js/lazrjs/yui/current/build/plugin/plugin.js |
961 | - - src-js/lazrjs/yui/current/build/pluginhost/pluginhost.js |
962 | - - src-js/lazrjs/yui/current/build/queue-promote/queue-promote.js |
963 | - - src-js/lazrjs/yui/current/build/substitute/substitute.js |
964 | - - src-js/lazrjs/yui/current/build/test/test.js |
965 | - - src-js/lazrjs/yui/current/build/widget/widget-position-ext.js |
966 | - - src-js/lazrjs/yui/current/build/widget/widget-position.js |
967 | - - src-js/lazrjs/yui/current/build/widget/widget-stack.js |
968 | - - src-js/lazrjs/yui/current/build/widget/widget-stdmod.js |
969 | - - src-js/lazrjs/yui/current/build/widget/widget.js |
970 | + - src-js/lazrjs/yui/anim/anim-easing.js |
971 | + - src-js/lazrjs/yui/anim/anim.js |
972 | + - src-js/lazrjs/yui/async-queue/async-queue.js |
973 | + - src-js/lazrjs/yui/attribute/attribute.js |
974 | + - src-js/lazrjs/yui/base/base.js |
975 | + - src-js/lazrjs/yui/cache/cache.js |
976 | + - src-js/lazrjs/yui/classnamemanager/classnamemanager.js |
977 | + - src-js/lazrjs/yui/console/console.js |
978 | + - src-js/lazrjs/yui/dataschema/dataschema-array.js |
979 | + - src-js/lazrjs/yui/dataschema/dataschema-base.js |
980 | + - src-js/lazrjs/yui/dataschema/dataschema-json.js |
981 | + - src-js/lazrjs/yui/dataschema/dataschema-text.js |
982 | + - src-js/lazrjs/yui/dataschema/dataschema-xml.js |
983 | + - src-js/lazrjs/yui/datasource/datasource.js |
984 | + - src-js/lazrjs/yui/datatype/datatype-date.js |
985 | + - src-js/lazrjs/yui/datatype/datatype-xml.js |
986 | + - src-js/lazrjs/yui/datatype/datatype.js |
987 | + - src-js/lazrjs/yui/dom/dom.js |
988 | + - src-js/lazrjs/yui/dump/dump.js |
989 | + - src-js/lazrjs/yui/event-custom/event-custom.js |
990 | + - src-js/lazrjs/yui/event-simulate/event-simulate.js |
991 | + - src-js/lazrjs/yui/event/event.js |
992 | + - src-js/lazrjs/yui/get/get.js |
993 | + - src-js/lazrjs/yui/io/io-form.js |
994 | + - src-js/lazrjs/yui/io/io.js |
995 | + - src-js/lazrjs/yui/json/json.js |
996 | + - src-js/lazrjs/yui/node-focusmanager/node-focusmanager.js |
997 | + - src-js/lazrjs/yui/node-menunav/node-menunav.js |
998 | + - src-js/lazrjs/yui/node/node-event-simulate.js |
999 | + - src-js/lazrjs/yui/node/node.js |
1000 | + - src-js/lazrjs/yui/oop/oop.js |
1001 | + - src-js/lazrjs/yui/overlay/overlay.js |
1002 | + - src-js/lazrjs/yui/plugin/plugin.js |
1003 | + - src-js/lazrjs/yui/pluginhost/pluginhost.js |
1004 | + - src-js/lazrjs/yui/queue-promote/queue-promote.js |
1005 | + - src-js/lazrjs/yui/substitute/substitute.js |
1006 | + - src-js/lazrjs/yui/test/test.js |
1007 | + - src-js/lazrjs/yui/widget/widget-position-ext.js |
1008 | + - src-js/lazrjs/yui/widget/widget-position.js |
1009 | + - src-js/lazrjs/yui/widget/widget-stack.js |
1010 | + - src-js/lazrjs/yui/widget/widget-stdmod.js |
1011 | + - src-js/lazrjs/yui/widget/widget.js |
1012 | - src-js/lazrjs/activator/activator.js |
1013 | - src-js/lazrjs/anim/anim.js |
1014 | - src-js/lazrjs/autocomplete/autocomplete.js |
Summary
-------
This branches gets the Activator working 100% in IE7&8, Webkit, and Opera.
Implementation details ------- ------- -
-------
Added disableTabIndex() function. js/lazrjs/ lazr/lazr. js lazr/index. html js/lazrjs/ activator/ activator. js js/lazrjs/ inlineedit/ editor. js
src-
examples/
src-
src-
Fixed all lint errors after discovering that some js/lazrjs/ testing/ testing. js
of them were breaking IE, because this file becomes
part of the one big consolidated javascript file.
src-
Fixed tests to run in IE7&8, Webkit, and Opera. js/lazrjs/ activator/ tests/activator .js
src-
Updated the tests for the new behavior of disableTabIndex(). js/lazrjs/ inlineedit/ tests/inline_ edit.js
This still does not pass all the tests in IE or Opera.
src-
Display fix for opera. activator/ index.html
examples/
Fix an IE7 issue centering a div. js/lazrjs/ activator/ assets/ skins/sam/ activator- skin.css
src-
Tests
-----
file:// /.../src- js/lazrjs/ activator/ tests/activator .html
or use ./bin/test to run the full suite with jstestdriver.
Demo and Q/A
------------
* Open file:// /.../examples/ activator/ index.html