Merge lp:~edwin-grubbs/lazr-js/activator-ie-fixes into lp:lazr-js

Proposed by Edwin Grubbs
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
Reviewer Review Type Date Requested Status
Māris Fogels (community) Approve
Canonical Launchpad Engineering Pending
Review via email: mp+14969@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Summary
-------

This branches gets the Activator working 100% in IE7&8, Webkit, and Opera.

Implementation details
----------------------

Added disableTabIndex() function.
    src-js/lazrjs/lazr/lazr.js
    examples/lazr/index.html
    src-js/lazrjs/activator/activator.js
    src-js/lazrjs/inlineedit/editor.js

Fixed all lint errors after discovering that some
of them were breaking IE, because this file becomes
part of the one big consolidated javascript file.
    src-js/lazrjs/testing/testing.js

Fixed tests to run in IE7&8, Webkit, and Opera.
    src-js/lazrjs/activator/tests/activator.js

Updated the tests for the new behavior of disableTabIndex().
This still does not pass all the tests in IE or Opera.
    src-js/lazrjs/inlineedit/tests/inline_edit.js

Display fix for opera.
    examples/activator/index.html

Fix an IE7 issue centering a div.
    src-js/lazrjs/activator/assets/skins/sam/activator-skin.css

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

Revision history for this message
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('tabIndex')
• 374: instead of a for-in loop, which can be error-prone, consider using Y.each()

Maris

review: Approve
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.

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :
Download full text (31.1 KiB)

> 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('tabIndex')
> • 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/lazrjs/yui/current/build became src-js/lazrjs/yui/
     (removing two levels of directories)
  2. build/yui/current/build became build/ (removing three levels of directories)

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/actions/index.html and examples/combo.html, which appear to be incomplete.

Please review these changes.

Incremental diff:
{{{
=== modified file 'examples/actions/index.html'
--- examples/actions/index.html 2009-11-18 23:09:08 +0000
+++ examples/actions/index.html 2009-11-24 22:40:02 +0000
@@ -2,8 +2,8 @@
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html>
 <head>
- <title>Lazr-js examples: Activator</title>
- <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script>
+ <title>Lazr-js examples: Actions</title>
+ <script type="text/javascript" src="../../build/yui/yui.js"></script>
   <script type="text/javascript" src="../../build/anim/anim.js"></script>
   <script type="text/javascript" src="../../build/lazr/lazr.js"></script>
   <script type="text/javascript" src="../../build/actions/actions.js"></script>
@@ -12,7 +12,7 @@

 YUI({
- base: '../../build/yui/current/build/',
+ 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="../../build/yui/current/build/cssreset/reset.css" />
- <link rel="stylesheet" type="text/css" href="../../bui...

Revision history for this message
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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'examples/actions/index.html'
--- examples/actions/index.html 2009-11-18 23:09:08 +0000
+++ examples/actions/index.html 2009-11-30 19:14:09 +0000
@@ -2,8 +2,8 @@
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html>3<html>
4<head>4<head>
5 <title>Lazr-js examples: Activator</title>5 <title>Lazr-js examples: Actions</title>
6 <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script>6 <script type="text/javascript" src="../../build/yui/yui.js"></script>
7 <script type="text/javascript" src="../../build/anim/anim.js"></script>7 <script type="text/javascript" src="../../build/anim/anim.js"></script>
8 <script type="text/javascript" src="../../build/lazr/lazr.js"></script>8 <script type="text/javascript" src="../../build/lazr/lazr.js"></script>
9 <script type="text/javascript" src="../../build/actions/actions.js"></script>9 <script type="text/javascript" src="../../build/actions/actions.js"></script>
@@ -12,7 +12,7 @@
1212
1313
14YUI({14YUI({
15 base: '../../build/yui/current/build/',15 base: '../../build/',
16 filter: 'raw'16 filter: 'raw'
17 }).use('node', 'lazr.actions', function(Y) {17 }).use('node', 'lazr.actions', function(Y) {
1818
@@ -77,9 +77,9 @@
77 We need to include individual css files because some of them have77 We need to include individual css files because some of them have
78 relative paths to images.78 relative paths to images.
79 -->79 -->
80 <link rel="stylesheet" type="text/css" href="../../build/yui/current/build/cssreset/reset.css" />80 <link rel="stylesheet" type="text/css" href="../../build/cssreset/reset.css" />
81 <link rel="stylesheet" type="text/css" href="../../build/yui/current/build/cssfonts/fonts.css" />81 <link rel="stylesheet" type="text/css" href="../../build/cssfonts/fonts.css" />
82 <link rel="stylesheet" type="text/css" href="../../build/yui/current/build/cssbase/base.css" />82 <link rel="stylesheet" type="text/css" href="../../build/cssbase/base.css" />
8383
84 <link type="text/css" rel="stylesheet" href="../../build/lazr-sam.css"/>84 <link type="text/css" rel="stylesheet" href="../../build/lazr-sam.css"/>
85 <link type="text/css" rel="stylesheet" href="../../build/lazr/assets/skins/sam/lazr.css"/>85 <link type="text/css" rel="stylesheet" href="../../build/lazr/assets/skins/sam/lazr.css"/>
8686
=== modified file 'examples/activator/index.html'
--- examples/activator/index.html 2009-11-19 17:27:44 +0000
+++ examples/activator/index.html 2009-11-30 19:14:09 +0000
@@ -166,7 +166,7 @@
166 visibility: hidden">166 visibility: hidden">
167<form>167<form>
168<input id="editor-1-textbox" type="text" autocomplete="off"/><br/>168<input id="editor-1-textbox" type="text" autocomplete="off"/><br/>
169<input id="editor-1-save" type="submit" value="Save"/><br/>169<button id="editor-1-save">Save</button><br/>
170<a id="editor-1-cancel" href="http://www.ubuntu.com">Cancel</a><br/>170<a id="editor-1-cancel" href="http://www.ubuntu.com">Cancel</a><br/>
171<button id="editor-1-failure">Trigger failure</button>171<button id="editor-1-failure">Trigger failure</button>
172</form>172</form>
173173
=== modified file 'examples/combo.html'
--- examples/combo.html 2009-11-19 17:27:44 +0000
+++ examples/combo.html 2009-11-30 19:14:09 +0000
@@ -128,7 +128,7 @@
128128
129 <h3>Javascript</h3>129 <h3>Javascript</h3>
130 <pre>130 <pre>
131 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/yui/current/build/yui/yui-min.js&quot;&gt;&lt;/script&gt;131 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/yui/yui-min.js&quot;&gt;&lt;/script&gt;
132 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/lazr/lazr-meta.js&quot;&gt;&lt;/script&gt;132 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/lazr/lazr-meta.js&quot;&gt;&lt;/script&gt;
133 </pre>133 </pre>
134134
135135
=== modified file 'examples/formoverlay/index.html'
--- examples/formoverlay/index.html 2009-11-18 21:24:47 +0000
+++ examples/formoverlay/index.html 2009-11-30 19:14:09 +0000
@@ -123,7 +123,7 @@
123123
124 <h3>Javascript</h3>124 <h3>Javascript</h3>
125 <pre>125 <pre>
126 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/yui/current/build/yui/yui-min.js&quot;&gt;&lt;/script&gt;126 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/yui/yui-min.js&quot;&gt;&lt;/script&gt;
127 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/lazr/lazr-meta.js&quot;&gt;&lt;/script&gt;127 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/lazr/lazr-meta.js&quot;&gt;&lt;/script&gt;
128 </pre>128 </pre>
129129
130130
=== modified file 'examples/lazr/index.html'
--- examples/lazr/index.html 2009-11-19 17:27:44 +0000
+++ examples/lazr/index.html 2009-11-30 19:14:09 +0000
@@ -49,6 +49,11 @@
49 </script>49 </script>
5050
51 <style id="style-overrides" type="text/css">51 <style id="style-overrides" type="text/css">
52
53 pre, code {
54 background: #dddddd;
55 }
56
52 #example {57 #example {
53 margin-left: 5em;58 margin-left: 5em;
54 padding: 3em;59 padding: 3em;
@@ -139,13 +144,16 @@
139yes_button.set('innerHTML', 'yes');144yes_button.set('innerHTML', 'yes');
140</pre>145</pre>
141146
142<h2>Removing a Widget's tabindex attribute</h2>147<h2>Disabling a Widget's tabindex attribute</h2>
143148
144<p><code>lazr.ui</code> provides a way to remove the tabindex attribute149<p><code>lazr.ui</code> provides a way to disable the tabindex attribute
145from a focused widget.</p>150from a focused widget.</p>
146151
147<p>The attribute can be removed by augmenting a Widget with the152<p>The tabindex can be disabled by augmenting a Widget with the
148<code>NoTabIndex</code> class:</p>153<code>disableTabIndex</code> function. If you need to revert the
154behavior in certain instances, you can call my_widget.set('tabIndex', new_value)
155before syncUI() is called. If you need to revert the behavior
156in subclasses, you can set the WidgetSubclass.ATTRS['tabIndex'].</p>
149157
150<p>158<p>
151<strong>Use this with caution.</strong> tabindex is intended as an accessibility159<strong>Use this with caution.</strong> tabindex is intended as an accessibility
@@ -154,10 +162,7 @@
154</p>162</p>
155163
156<pre>164<pre>
157// We need the 'true' parameter for Y.augment() to force overwriting of the165Y.lazr.ui.disableTabIndex(MyWidget);
158// existing tabindex-associated methods.
159
160Y.augment(MyWidget, Y.lazr.ui.NoTabIndex, true);
161</pre>166</pre>
162167
163</body>168</body>
164169
=== modified file 'examples/picker/index.html'
--- examples/picker/index.html 2009-11-24 00:09:41 +0000
+++ examples/picker/index.html 2009-11-30 19:14:09 +0000
@@ -253,7 +253,7 @@
253253
254 <h3>Javascript</h3>254 <h3>Javascript</h3>
255 <pre>255 <pre>
256 &lt;script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"&gt;&lt;/script&gt;256 &lt;script type="text/javascript" src="../../build/yui/yui.js"&gt;&lt;/script&gt;
257 &lt;script type="text/javascript" src="../../build/lazr/lazr.js"&gt;&lt;/script&gt;257 &lt;script type="text/javascript" src="../../build/lazr/lazr.js"&gt;&lt;/script&gt;
258 &lt;script type="text/javascript" src="../../build/overlay/overlay.js"&gt;&lt;/script&gt;258 &lt;script type="text/javascript" src="../../build/overlay/overlay.js"&gt;&lt;/script&gt;
259 &lt;script type="text/javascript" src="../../build/picker/picker.js"&gt;&lt;/script&gt;259 &lt;script type="text/javascript" src="../../build/picker/picker.js"&gt;&lt;/script&gt;
260260
=== modified file 'src-js/lazrjs/actions/tests/actions.html'
--- src-js/lazrjs/actions/tests/actions.html 2009-11-14 23:15:08 +0000
+++ src-js/lazrjs/actions/tests/actions.html 2009-11-30 19:14:09 +0000
@@ -5,10 +5,10 @@
5 <title>Actions</title>5 <title>Actions</title>
66
7 <!-- YUI 3.0 Setup -->7 <!-- YUI 3.0 Setup -->
8 <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script>8 <script type="text/javascript" src="../../yui/yui/yui.js"></script>
9 <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/>9 <link rel="stylesheet" href="../../yui/cssreset/reset.css"/>
10 <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/>10 <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/>
11 <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/>11 <link rel="stylesheet" href="../../yui/cssbase/base.css"/>
1212
13 <!-- The module under test -->13 <!-- The module under test -->
14 <script type="text/javascript" src="../../actions/actions.js"></script>14 <script type="text/javascript" src="../../actions/actions.js"></script>
1515
=== modified file 'src-js/lazrjs/actions/tests/actions.js'
--- src-js/lazrjs/actions/tests/actions.js 2009-11-18 23:09:08 +0000
+++ src-js/lazrjs/actions/tests/actions.js 2009-11-30 19:14:09 +0000
@@ -1,7 +1,7 @@
1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
22
3YUI({3YUI({
4 base: '../../yui/current/build/',4 base: '../../yui/',
5 filter: 'raw',5 filter: 'raw',
6 combine: false6 combine: false
7 }).use('lazr.actions', 'lazr.testing.runner', 'node',7 }).use('lazr.actions', 'lazr.testing.runner', 'node',
88
=== modified file 'src-js/lazrjs/activator/activator.js'
--- src-js/lazrjs/activator/activator.js 2009-11-18 21:24:47 +0000
+++ src-js/lazrjs/activator/activator.js 2009-11-30 19:14:09 +0000
@@ -242,6 +242,10 @@
242 renderUI: function() {242 renderUI: function() {
243 // Just in case the user didn't assign the correct classes.243 // Just in case the user didn't assign the correct classes.
244 this.action_element.removeClass(C_HIDDEN);244 this.action_element.removeClass(C_HIDDEN);
245 // Use &thinsp; character to prevent IE7 from hiding the
246 // yui-activator-act button, when it just has a background-image
247 // and no content in it or in the data_box.
248 this.get('contentBox').prepend('&thinsp;');
245 },249 },
246250
247 /**251 /**
@@ -268,11 +272,11 @@
268 }272 }
269});273});
270274
275Y.lazr.ui.disableTabIndex(Activator);
276
271Y.namespace('lazr.activator');277Y.namespace('lazr.activator');
272Y.lazr.activator.Activator = Activator;278Y.lazr.activator.Activator = Activator;
273279
274// Nuke the tabindex attribute.
275Y.augment(Activator, Y.lazr.ui.NoTabIndex, true);
276280
277}, "0.1", {"skinnable": true,281}, "0.1", {"skinnable": true,
278 "requires": ["oop", "event", "node", "widget",282 "requires": ["oop", "event", "node", "widget",
279283
=== modified file 'src-js/lazrjs/activator/assets/skins/sam/activator-skin.css'
--- src-js/lazrjs/activator/assets/skins/sam/activator-skin.css 2009-03-20 04:17:08 +0000
+++ src-js/lazrjs/activator/assets/skins/sam/activator-skin.css 2009-11-30 19:14:09 +0000
@@ -24,6 +24,10 @@
24 margin-left: auto;24 margin-left: auto;
25 margin-right: auto;25 margin-right: auto;
26 width: 30em;26 width: 30em;
27
28 /* Center the message box on IE7. */
29 *left: 30%;
30 *width: 40%;
27}31}
2832
29.yui-skin-sam button.yui-activator-message-close {33.yui-skin-sam button.yui-activator-message-close {
@@ -45,9 +49,10 @@
45}49}
4650
47.yui-activator-message-body {51.yui-activator-message-body {
48 padding: 0.5em;52 padding: 0;
49 width: 29em; /* The width + 2*padding equals the message-box's width. */
50 overflow: auto;53 overflow: auto;
54 /* Necessary for IE7. */
55 width: 100%;
51}56}
5257
53.yui-activator-failure .yui-activator-message-box {58.yui-activator-failure .yui-activator-message-box {
5459
=== modified file 'src-js/lazrjs/activator/tests/activator.html'
--- src-js/lazrjs/activator/tests/activator.html 2009-10-21 21:43:07 +0000
+++ src-js/lazrjs/activator/tests/activator.html 2009-11-30 19:14:09 +0000
@@ -5,10 +5,10 @@
5 <title>Activator</title>5 <title>Activator</title>
66
7 <!-- YUI 3.0 Setup -->7 <!-- YUI 3.0 Setup -->
8 <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script>8 <script type="text/javascript" src="../../yui/yui/yui.js"></script>
9 <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/>9 <link rel="stylesheet" href="../../yui/cssreset/reset.css"/>
10 <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/>10 <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/>
11 <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/>11 <link rel="stylesheet" href="../../yui/cssbase/base.css"/>
1212
13 <!-- The module under test -->13 <!-- The module under test -->
14 <script type="text/javascript" src="../../activator/activator.js"></script>14 <script type="text/javascript" src="../../activator/activator.js"></script>
1515
=== modified file 'src-js/lazrjs/activator/tests/activator.js'
--- src-js/lazrjs/activator/tests/activator.js 2009-10-21 21:54:04 +0000
+++ src-js/lazrjs/activator/tests/activator.js 2009-11-30 19:14:09 +0000
@@ -1,7 +1,7 @@
1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
22
3YUI({3YUI({
4 base: '../../yui/current/build/',4 base: '../../yui/',
5 filter: 'raw',5 filter: 'raw',
6 combine: false6 combine: false
7 }).use('lazr.activator', 'lazr.testing.runner', 'node',7 }).use('lazr.activator', 'lazr.testing.runner', 'node',
@@ -126,7 +126,8 @@
126126
127 test_renderProcessing: function() {127 test_renderProcessing: function() {
128 this.activator.render();128 this.activator.render();
129 var message = Y.Node.create('<b>processing message</b>');129 var message_text = 'processing message';
130 var message = Y.Node.create('<b>' + message_text + '</b>');
130 Assert.isFalse(131 Assert.isFalse(
131 this.activator.get('contentBox').hasClass(132 this.activator.get('contentBox').hasClass(
132 'yui-activator-processing'),133 'yui-activator-processing'),
@@ -139,18 +140,22 @@
139 'yui-activator-processing'),140 'yui-activator-processing'),
140 'renderProcessing did not add the processing css class');141 'renderProcessing did not add the processing css class');
141142
142 var message_body = this.activator.get('contentBox').query(143 var message_body = this.activator.get('contentBox').one(
143 '.yui-activator-message-body');144 '.yui-activator-message-body');
144145
146 // Opera uppercases all tags, Safari lowercases all tags,
147 // and IE gets an extra _yuid attribute in the <b>.
148 var added_node = message_body.one('b');
145 Assert.areEqual(149 Assert.areEqual(
146 '<b>processing message</b>',150 message_text,
147 message_body.get('innerHTML'),151 added_node.get('innerHTML'),
148 'renderProcessing did not set the contents of the message-body');152 'renderProcessing did not set the contents of the message-body');
149 },153 },
150154
151 test_renderCancellation: function() {155 test_renderCancellation: function() {
152 this.activator.render();156 this.activator.render();
153 var message = Y.Node.create('<b>cancel message</b>');157 var message_text = 'cancel message';
158 var message = Y.Node.create('<b>' + message_text + '</b>');
154 Assert.isFalse(159 Assert.isFalse(
155 this.activator.get('contentBox').hasClass(160 this.activator.get('contentBox').hasClass(
156 'yui-activator-cancellation'),161 'yui-activator-cancellation'),
@@ -163,11 +168,14 @@
163 'yui-activator-cancellation'),168 'yui-activator-cancellation'),
164 'renderCancellation did not add the cancel css class');169 'renderCancellation did not add the cancel css class');
165170
166 var message_body = this.activator.get('contentBox').query(171 var message_body = this.activator.get('contentBox').one(
167 '.yui-activator-message-body');172 '.yui-activator-message-body');
173 // Opera uppercases all tags, Safari lowercases all tags,
174 // and IE gets an extra _yuid attribute in the <b>.
175 var added_node = message_body.one('b');
168 Assert.areEqual(176 Assert.areEqual(
169 '<b>cancel message</b>',177 message_text,
170 message_body.get('innerHTML'),178 added_node.get('innerHTML'),
171 "renderCancellation didn't set the contents of the message-body");179 "renderCancellation didn't set the contents of the message-body");
172 },180 },
173181
@@ -233,14 +241,22 @@
233 'Message body contents should still be there.');241 'Message body contents should still be there.');
234 },242 },
235243
236 test_widget_does_not_have_a_tabindex_when_focused: function() {244 test_widget_has_a_disabled_tabindex_when_focused: function() {
237 // The tabindex attribute appears when the widget is focused.245 // The tabindex attribute appears when the widget is focused.
238 this.activator.render();246 this.activator.render();
239 this.activator.focus();247 this.activator.focus();
240248
241 Assert.isFalse(249 // Be aware that in IE when the tabIndex is set to -1,
242 this.activator.get('boundingBox').hasAttribute('tabindex'),250 // get('tabIndex') returns -1 as expected but getAttribute('tabIndex')
243 "The widget should not have a tabindex attribute.");251 // returns 65535. This is due to YUI's getAttribute() calling
252 // dom_node.getAttribute('tabIndex', 2), which is an IE extension
253 // that happens to treat this attribute as an unsigned integer instead
254 // of as a signed integer.
255 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
256 Assert.areEqual(
257 -1,
258 this.activator.get('boundingBox').get('tabIndex'),
259 "The widget should have a tabindex of -1 (disabled).");
244 }260 }
245}));261}));
246262
247263
=== modified file 'src-js/lazrjs/anim/tests/anim.html'
--- src-js/lazrjs/anim/tests/anim.html 2009-11-10 17:49:09 +0000
+++ src-js/lazrjs/anim/tests/anim.html 2009-11-30 19:14:09 +0000
@@ -5,10 +5,10 @@
5 <title>Anim</title>5 <title>Anim</title>
66
7 <!-- YUI 3.0 Setup -->7 <!-- YUI 3.0 Setup -->
8 <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script>8 <script type="text/javascript" src="../../yui/yui/yui.js"></script>
9 <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/>9 <link rel="stylesheet" href="../../yui/cssreset/reset.css"/>
10 <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/>10 <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/>
11 <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/>11 <link rel="stylesheet" href="../../yui/cssbase/base.css"/>
1212
13 <!-- The module under test -->13 <!-- The module under test -->
14 <script type="text/javascript" src="../../anim/anim.js"></script>14 <script type="text/javascript" src="../../anim/anim.js"></script>
1515
=== modified file 'src-js/lazrjs/anim/tests/anim.js'
--- src-js/lazrjs/anim/tests/anim.js 2009-11-10 22:18:32 +0000
+++ src-js/lazrjs/anim/tests/anim.js 2009-11-30 19:14:09 +0000
@@ -1,7 +1,7 @@
1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
22
3YUI({3YUI({
4 base: '../../yui/current/build/',4 base: '../../yui/',
5 filter: 'raw',5 filter: 'raw',
6 combine: false6 combine: false
7 }).use('lazr.anim', 'lazr.testing.runner', 'node',7 }).use('lazr.anim', 'lazr.testing.runner', 'node',
88
=== modified file 'src-js/lazrjs/autocomplete/tests/autocomplete.js'
--- src-js/lazrjs/autocomplete/tests/autocomplete.js 2009-10-21 21:43:07 +0000
+++ src-js/lazrjs/autocomplete/tests/autocomplete.js 2009-11-30 19:14:09 +0000
@@ -1,7 +1,7 @@
1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
22
3YUI({3YUI({
4 base: '../../yui/current/build/',4 base: '../../yui/',
5 filter: 'raw',5 filter: 'raw',
6 combine: false6 combine: false
7 }).use('lazr.autocomplete', 'lazr.testing.runner',7 }).use('lazr.autocomplete', 'lazr.testing.runner',
88
=== modified file 'src-js/lazrjs/autocomplete/tests/index.html'
--- src-js/lazrjs/autocomplete/tests/index.html 2009-10-21 21:43:07 +0000
+++ src-js/lazrjs/autocomplete/tests/index.html 2009-11-30 19:14:09 +0000
@@ -5,10 +5,10 @@
5 <title>autocomplete unit tests</title>5 <title>autocomplete unit tests</title>
66
7 <!-- YUI 3.0 Setup -->7 <!-- YUI 3.0 Setup -->
8 <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script>8 <script type="text/javascript" src="../../yui/yui/yui.js"></script>
9 <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/>9 <link rel="stylesheet" href="../../yui/cssreset/reset.css"/>
10 <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/>10 <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/>
11 <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/>11 <link rel="stylesheet" href="../../yui/cssbase/base.css"/>
1212
13 <link rel="stylesheet" href="../../testing/assets/testlogger.css"/>13 <link rel="stylesheet" href="../../testing/assets/testlogger.css"/>
14 <script type="text/javascript" src="../../testing/testing.js"></script>14 <script type="text/javascript" src="../../testing/testing.js"></script>
1515
=== modified file 'src-js/lazrjs/choiceedit/tests/choiceedit.html'
--- src-js/lazrjs/choiceedit/tests/choiceedit.html 2009-10-21 21:43:07 +0000
+++ src-js/lazrjs/choiceedit/tests/choiceedit.html 2009-11-30 19:14:09 +0000
@@ -4,10 +4,10 @@
4 <title>Status Editor</title>4 <title>Status Editor</title>
55
6 <!-- YUI 3.0 Setup -->6 <!-- YUI 3.0 Setup -->
7 <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script>7 <script type="text/javascript" src="../../yui/yui/yui.js"></script>
8 <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/>8 <link rel="stylesheet" href="../../yui/cssreset/reset.css"/>
9 <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/>9 <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/>
10 <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/>10 <link rel="stylesheet" href="../../yui/cssbase/base.css"/>
1111
12 <!-- Dependency -->12 <!-- Dependency -->
13 <script type="text/javascript" src="../../lazr/lazr.js"></script>13 <script type="text/javascript" src="../../lazr/lazr.js"></script>
1414
=== modified file 'src-js/lazrjs/choiceedit/tests/choiceedit.js'
--- src-js/lazrjs/choiceedit/tests/choiceedit.js 2009-11-13 15:37:35 +0000
+++ src-js/lazrjs/choiceedit/tests/choiceedit.js 2009-11-30 19:14:09 +0000
@@ -1,7 +1,7 @@
1/* Copyright (c) 2008, Canonical Ltd. All rights reserved. */1/* Copyright (c) 2008, Canonical Ltd. All rights reserved. */
22
3YUI({3YUI({
4 base: '../../yui/current/build/',4 base: '../../yui/',
5 filter: 'raw',5 filter: 'raw',
6 combine: false6 combine: false
7 }).use('lazr.choiceedit', 'lazr.testing.runner', 'node',7 }).use('lazr.choiceedit', 'lazr.testing.runner', 'node',
88
=== modified file 'src-js/lazrjs/error/tests/error.js'
--- src-js/lazrjs/error/tests/error.js 2009-11-24 08:08:53 +0000
+++ src-js/lazrjs/error/tests/error.js 2009-11-30 19:14:09 +0000
@@ -16,7 +16,7 @@
16*/16*/
1717
18YUI({18YUI({
19 base: '../../yui/current/build/',19 base: '../../yui/',
20 filter: 'raw',20 filter: 'raw',
21 combine: false21 combine: false
22 }).use('lazr.error', 'lazr.error-widgets', 'lazr.testing.runner', 'node',22 }).use('lazr.error', 'lazr.error-widgets', 'lazr.testing.runner', 'node',
2323
=== modified file 'src-js/lazrjs/error/tests/index.html'
--- src-js/lazrjs/error/tests/index.html 2009-11-21 22:17:49 +0000
+++ src-js/lazrjs/error/tests/index.html 2009-11-30 19:14:09 +0000
@@ -5,10 +5,10 @@
5 <title>Lazr error unit tests</title>5 <title>Lazr error unit tests</title>
66
7 <!-- YUI 3.0 Setup -->7 <!-- YUI 3.0 Setup -->
8 <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script>8 <script type="text/javascript" src="../../yui/yui/yui.js"></script>
9 <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/>9 <link rel="stylesheet" href="../../yui/cssreset/reset.css"/>
10 <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/>10 <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/>
11 <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/>11 <link rel="stylesheet" href="../../yui/cssbase/base.css"/>
1212
13 <link rel="stylesheet" href="../../testing/assets/testlogger.css"/>13 <link rel="stylesheet" href="../../testing/assets/testlogger.css"/>
1414
1515
=== modified file 'src-js/lazrjs/formoverlay/tests/formoverlay.html'
--- src-js/lazrjs/formoverlay/tests/formoverlay.html 2009-10-21 21:43:07 +0000
+++ src-js/lazrjs/formoverlay/tests/formoverlay.html 2009-11-30 19:14:09 +0000
@@ -4,10 +4,10 @@
4 <title>Form Overlay</title>4 <title>Form Overlay</title>
55
6 <!-- YUI 3.0 Setup -->6 <!-- YUI 3.0 Setup -->
7 <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script>7 <script type="text/javascript" src="../../yui/yui/yui.js"></script>
8 <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/>8 <link rel="stylesheet" href="../../yui/cssreset/reset.css"/>
9 <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/>9 <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/>
10 <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/>10 <link rel="stylesheet" href="../../yui/cssbase/base.css"/>
11 <link rel="stylesheet" href="../../testing/assets/testlogger.css"/>11 <link rel="stylesheet" href="../../testing/assets/testlogger.css"/>
1212
13 <!-- dependent modules from lazr-->13 <!-- dependent modules from lazr-->
1414
=== modified file 'src-js/lazrjs/formoverlay/tests/formoverlay.js'
--- src-js/lazrjs/formoverlay/tests/formoverlay.js 2009-11-13 20:50:08 +0000
+++ src-js/lazrjs/formoverlay/tests/formoverlay.js 2009-11-30 19:14:09 +0000
@@ -1,7 +1,7 @@
1/* Copyright (c) 2008, Canonical Ltd. All rights reserved. */1/* Copyright (c) 2008, Canonical Ltd. All rights reserved. */
22
3YUI({3YUI({
4 base: '../../yui/current/build/',4 base: '../../yui/',
5 filter: 'raw',5 filter: 'raw',
6 combine: false6 combine: false
7 }).use('lazr.formoverlay', 'lazr.testing.runner',7 }).use('lazr.formoverlay', 'lazr.testing.runner',
88
=== modified file 'src-js/lazrjs/inlineedit/editor.js'
--- src-js/lazrjs/inlineedit/editor.js 2009-11-18 21:34:09 +0000
+++ src-js/lazrjs/inlineedit/editor.js 2009-11-30 19:14:09 +0000
@@ -994,11 +994,10 @@
994994
995});995});
996996
997Y.lazr.ui.disableTabIndex(InlineEditor);
998
997Y.InlineEditor = InlineEditor;999Y.InlineEditor = InlineEditor;
9981000
999// Nuke the tabindex attribute.
1000Y.augment(InlineEditor, Y.lazr.ui.NoTabIndex, true);
1001
10021001
1003var ETEXT = 'editable_text',1002var ETEXT = 'editable_text',
1004 TEXT = 'text',1003 TEXT = 'text',
@@ -1492,11 +1491,10 @@
1492 }1491 }
1493});1492});
14941493
1494Y.lazr.ui.disableTabIndex(EditableText);
1495
1495Y.EditableText = EditableText;1496Y.EditableText = EditableText;
14961497
1497// Nuke the tabindex attribute.
1498Y.augment(EditableText, Y.lazr.ui.NoTabIndex, true);
1499
1500//~ Y.log("Module loaded", 'info', 'lazr.editor');1498//~ Y.log("Module loaded", 'info', 'lazr.editor');
15011499
1502}, "0.2", {"skinnable": true,1500}, "0.2", {"skinnable": true,
15031501
=== modified file 'src-js/lazrjs/inlineedit/tests/index.html'
--- src-js/lazrjs/inlineedit/tests/index.html 2009-10-21 21:43:07 +0000
+++ src-js/lazrjs/inlineedit/tests/index.html 2009-11-30 19:14:09 +0000
@@ -5,10 +5,10 @@
5 <title>Inline Edit</title>5 <title>Inline Edit</title>
66
7 <!-- YUI 3.0 Setup -->7 <!-- YUI 3.0 Setup -->
8 <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script>8 <script type="text/javascript" src="../../yui/yui/yui.js"></script>
9 <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/>9 <link rel="stylesheet" href="../../yui/cssreset/reset.css"/>
10 <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/>10 <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/>
11 <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/>11 <link rel="stylesheet" href="../../yui/cssbase/base.css"/>
12 <link rel="stylesheet" href="../../testing/assets/testlogger.css"/>12 <link rel="stylesheet" href="../../testing/assets/testlogger.css"/>
1313
14 <!-- The module under test -->14 <!-- The module under test -->
1515
=== modified file 'src-js/lazrjs/inlineedit/tests/inline_edit.js'
--- src-js/lazrjs/inlineedit/tests/inline_edit.js 2009-11-13 15:37:35 +0000
+++ src-js/lazrjs/inlineedit/tests/inline_edit.js 2009-11-30 19:14:09 +0000
@@ -1,7 +1,7 @@
1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
22
3YUI({3YUI({
4 base: '../../yui/current/build/',4 base: '../../yui/',
5 filter: 'raw',5 filter: 'raw',
6 combine: false6 combine: false
7 }).use('lazr.editor', 'lazr.testing.runner', 'node',7 }).use('lazr.editor', 'lazr.testing.runner', 'node',
@@ -314,14 +314,20 @@
314 this.wait(5000);314 this.wait(5000);
315 },315 },
316316
317 test_widget_does_not_have_a_tabindex_when_focused: function() {317 test_widget_has_a_disabled_tabindex_when_focused: function() {
318 // The tabindex attribute appears when the widget is focused.318 // The tabindex attribute appears when the widget is focused.
319 this.editor.render();319 this.editor.render();
320 this.editor.focus();320 this.editor.focus();
321321
322 Assert.isFalse(322 // Be aware that in IE, get('tabIndex') and getAttribute('tabIndex')
323 this.editor.get('boundingBox').hasAttribute('tabindex'),323 // return different values when set to -1. This is due to YUI's
324 "The widget should not have a tabindex attribute.");324 // getAttribute() calling dom_node.getAttribute('tabIndex', 2), which
325 // is an IE extension.
326 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
327 Assert.areEqual(
328 -1,
329 this.editor.get('boundingBox').get('tabIndex'),
330 "The widget should have a tabindex of -1 (disabled).");
325 },331 },
326332
327 test_enter_key_saves_input: function() {333 test_enter_key_saves_input: function() {
@@ -794,14 +800,24 @@
794 "also be set to 'false'.");800 "also be set to 'false'.");
795 },801 },
796802
797 test_widget_does_not_have_a_tabindex_when_focused: function() {803 test_widget_has_a_disabled_tabindex_when_focused: function() {
798 // The tabindex attribute appears when the widget is focused.804 // The tabindex attribute appears when the widget is focused.
799 this.etext.render();805 this.etext.render();
800 this.etext.focus();806 this.etext.focus();
801807
802 Assert.isFalse(808 // Be aware that in IE, get('tabIndex') and getAttribute('tabIndex')
803 this.etext.get('boundingBox').hasAttribute('tabindex'),809 // return different values when set to -1. This is due to YUI's
804 "The widget should not have a tabindex attribute.");810 // getAttribute() calling dom_node.getAttribute('tabIndex', 2), which
811 // is an IE extension.
812 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
813
814 // On IE and KHTML, EditableText._onRender() will prevent the
815 // default widget rendering that would set the tabIndex on the
816 // boundingBox, so this test will fail for those browsers.
817 Assert.areEqual(
818 -1,
819 this.etext.get('boundingBox').get('tabIndex'),
820 "The widget should have a tabindex of -1 (disabled).");
805 },821 },
806822
807 test_trigger_is_disabled_if_the_widget_is_not_rendered: function() {823 test_trigger_is_disabled_if_the_widget_is_not_rendered: function() {
@@ -884,8 +900,7 @@
884 null,900 null,
885 box,901 box,
886 "Multi-line editor should have a top button box.");902 "Multi-line editor should have a top button box.");
887 },903 }
888
889}));904}));
890905
891suite.add(new Y.Test.Case({906suite.add(new Y.Test.Case({
892907
=== modified file 'src-js/lazrjs/lazr/lazr.js'
--- src-js/lazrjs/lazr/lazr.js 2009-11-18 21:24:47 +0000
+++ src-js/lazrjs/lazr/lazr.js 2009-11-30 19:14:09 +0000
@@ -91,27 +91,27 @@
91UI.CSS_ODD = getCN(LAZR, 'odd');91UI.CSS_ODD = getCN(LAZR, 'odd');
9292
93/**93/**
94 * This object implements the necessary code to prevent the tabindex attribute94 * This function forces a class to have a tabIndex attribute which
95 * from being added to Widget instances. It is intended to augment existing95 * takes the widget's boundingBox out of the tab order.
96 * classes.96 * It is intended to be called on subclasses of Widget.
97 *97 *
98 * Use with caution. tabindex is intended as a usability feature, for98 * Use with caution. tabindex is intended as a usability feature, for
99 * keyboard accessibility, and visual feedback. If you disable it, be sure to99 * keyboard accessibility, and visual feedback. If you disable it, be sure to
100 * have a really good reason, or a replacement ready.100 * have a really good reason, or a replacement ready.
101 *101 *
102 * @class NoTabIndex102 * @method disableTabIndex
103 */103 * @param {Class} widget_class Widget that should not be in the tab order.
104UI.NoTabIndex = function() {};104 */
105105UI.disableTabIndex = function(widget_class) {
106/**106 if (widget_class === undefined) {
107 * Override setting the widget's tabindex attribute. Since this widget107 throw "disableTabIndex() must be called after ATTRS " +
108 * is in-page, then having a tabindex just messes up the page tab-order.108 "is set on the widget.";
109 *109 }
110 * @method _uiSetTabIndex110 widget_class.ATTRS.tabIndex = {
111 * @param index {NUM} The tab index to (not) set.111 readOnly: true,
112 * @protected112 value: -1
113 */113 };
114UI.NoTabIndex.prototype._uiSetTabIndex = function(index) {};114};
115115
116/**116/**
117 * Standard class for the UI 'waiting for new content' indicator.117 * Standard class for the UI 'waiting for new content' indicator.
118118
=== modified file 'src-js/lazrjs/overlay/tests/overlay.html'
--- src-js/lazrjs/overlay/tests/overlay.html 2009-10-21 21:43:07 +0000
+++ src-js/lazrjs/overlay/tests/overlay.html 2009-11-30 19:14:09 +0000
@@ -5,10 +5,10 @@
5 <title>Pretty Overlay</title>5 <title>Pretty Overlay</title>
66
7 <!-- YUI 3.0 Setup -->7 <!-- YUI 3.0 Setup -->
8 <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script>8 <script type="text/javascript" src="../../yui/yui/yui.js"></script>
9 <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/>9 <link rel="stylesheet" href="../../yui/cssreset/reset.css"/>
10 <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/>10 <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/>
11 <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/>11 <link rel="stylesheet" href="../../yui/cssbase/base.css"/>
12 <link rel="stylesheet" href="../../testing/assets/testlogger.css"/>12 <link rel="stylesheet" href="../../testing/assets/testlogger.css"/>
1313
14 <!-- The module under test -->14 <!-- The module under test -->
1515
=== modified file 'src-js/lazrjs/overlay/tests/overlay.js'
--- src-js/lazrjs/overlay/tests/overlay.js 2009-11-13 15:37:35 +0000
+++ src-js/lazrjs/overlay/tests/overlay.js 2009-11-30 19:14:09 +0000
@@ -1,7 +1,7 @@
1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
22
3YUI({3YUI({
4 base: '../../yui/current/build/',4 base: '../../yui/',
5 filter: 'raw',5 filter: 'raw',
6 combine: false6 combine: false
7 }).use('lazr.overlay', 'lazr.testing.runner', 'node',7 }).use('lazr.overlay', 'lazr.testing.runner', 'node',
88
=== modified file 'src-js/lazrjs/picker/tests/picker.html'
--- src-js/lazrjs/picker/tests/picker.html 2009-10-21 21:43:07 +0000
+++ src-js/lazrjs/picker/tests/picker.html 2009-11-30 19:14:09 +0000
@@ -5,10 +5,10 @@
5 <title>Picker</title>5 <title>Picker</title>
66
7 <!-- YUI 3.0 Setup -->7 <!-- YUI 3.0 Setup -->
8 <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script>8 <script type="text/javascript" src="../../yui/yui/yui.js"></script>
9 <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/>9 <link rel="stylesheet" href="../../yui/cssreset/reset.css"/>
10 <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/>10 <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/>
11 <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/>11 <link rel="stylesheet" href="../../yui/cssbase/base.css"/>
12 <link rel="stylesheet" href="../../testing/assets/testlogger.css"/>12 <link rel="stylesheet" href="../../testing/assets/testlogger.css"/>
1313
14 <!-- The module under test -->14 <!-- The module under test -->
1515
=== modified file 'src-js/lazrjs/picker/tests/picker.js'
--- src-js/lazrjs/picker/tests/picker.js 2009-11-24 00:09:41 +0000
+++ src-js/lazrjs/picker/tests/picker.js 2009-11-30 19:14:09 +0000
@@ -1,7 +1,7 @@
1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
22
3YUI({3YUI({
4 base: '../../yui/current/build/',4 base: '../../yui/',
5 filter: 'raw',5 filter: 'raw',
6 combine: false6 combine: false
7 }).use('lazr.picker', 'lazr.testing.runner', 'node',7 }).use('lazr.picker', 'lazr.testing.runner', 'node',
88
=== modified file 'src-js/lazrjs/testing/testing.js'
--- src-js/lazrjs/testing/testing.js 2009-11-12 21:35:17 +0000
+++ src-js/lazrjs/testing/testing.js 2009-11-30 19:14:09 +0000
@@ -23,9 +23,8 @@
23 // JsTestDriver.23 // JsTestDriver.
24 var tests = [];24 var tests = [];
2525
26 for (var idx in suite.items) {26 Y.each(suite.items, function(testCase, idx) {
27 var suiteName = suite.name;27 var suiteName = suite.name;
28 var testCase = suite.items[idx];
29 var testCaseName = testCase.name;28 var testCaseName = testCase.name;
3029
31 var clone = {};30 var clone = {};
@@ -40,36 +39,36 @@
40 // TestCase that wraps a single YUI TestSuite, that wraps39 // TestCase that wraps a single YUI TestSuite, that wraps
41 // a clone of the original TestCase but with only the40 // a clone of the original TestCase but with only the
42 // single test method that we are interested in.41 // single test method that we are interested in.
43 for (var prop in testCase){42 Y.each(testCase, function(property, name) {
44 if (prop.indexOf("test") === 0 &&43 if (name.indexOf("test") === 0 &&
45 Y.Lang.isFunction(testCase[prop])){44 Y.Lang.isFunction(property)){
46 tests.push({"suiteName": suiteName,45 tests.push({"suiteName": suiteName,
47 "caseName": testCaseName,46 "caseName": testCaseName,
48 "case": clone,47 "case": clone,
49 "methodName": prop,48 "methodName": name,
50 "method": testCase[prop]});49 "method": property});
51 }50 }
52 }51 });
53 }52 });
5453
55 for (var i=0; i<tests.length; i++){54 Y.each(tests, function(testObject, i) {
56 testObject = tests[i];55 testObject = tests[i];
5756
58 var fakeTestCase = {57 var fakeTestCase = {
59 "setUp": Y.bind(function(testObject){58 "setUp": Y.bind(function(testObject){
60 var testSuite = new Y.Test.Suite(testObject["suiteName"]);59 var testSuite = new Y.Test.Suite(testObject.suiteName);
61 var testCase = new Y.Test.Case(testObject["case"]);60 var testCase = new Y.Test.Case(testObject['case']);
62 testCase[testObject["methodName"]] = testObject["method"];61 testCase[testObject.methodName] = testObject.method;
63 testSuite.add(testCase);62 testSuite.add(testCase);
64 Y.Test.Runner.clear();63 Y.Test.Runner.clear();
65 Y.Test.Runner.add(testSuite);64 Y.Test.Runner.add(testSuite);
66 }, this, testObject),65 }, this, testObject),
67 "tearDown": function(){66 "tearDown": function(){
68 Y.Test.Runner.clear();67 Y.Test.Runner.clear();
69 },68 }
70 };69 };
7170
72 fakeTestCase[testObject["methodName"]] = Y.bind(function (testObject) {71 fakeTestCase[testObject.methodName] = Y.bind(function (testObject) {
73 var results = [];72 var results = [];
7473
75 var onComplete = function (caseName, methodName, results, e) {74 var onComplete = function (caseName, methodName, results, e) {
@@ -79,8 +78,8 @@
7978
80 Y.Test.Runner.subscribe(79 Y.Test.Runner.subscribe(
81 "testsuitecomplete",80 "testsuitecomplete",
82 Y.bind(onComplete, this, testObject["caseName"],81 Y.bind(onComplete, this, testObject.caseName,
83 testObject["methodName"], results),82 testObject.methodName, results),
84 Y.Test.Runner);83 Y.Test.Runner);
8584
86 Clock.reset();85 Clock.reset();
@@ -93,16 +92,21 @@
93 if (result === undefined) {92 if (result === undefined) {
94 fail("Test did not finish after 100 iterations.");93 fail("Test did not finish after 100 iterations.");
95 } else {94 } else {
96 if (result["result"] == "fail"){95 if (result.result == "fail") {
97 fail(result["message"]);96 fail(result.message);
98 }97 }
99 }98 }
10099
101 }, this, testObject);100 }, this, testObject);
102101
103 TestCase(testObject["caseName"] + "." + testObject["methodName"],102 // JSLint will complain if the constructur is used without `new`
104 fakeTestCase);103 // and if the result of `new` is not used. The TestCase class is
105 }104 // defined globally by jstestdriver and automatically registers
105 // itself, so it is not necessary to return this object.
106 var ignored = new TestCase(
107 testObject.caseName + "." + testObject.methodName,
108 fakeTestCase);
109 });
106 }110 }
107};111};
108112
109113
=== modified file 'src-py/lazr/js/skel/template.example'
--- src-py/lazr/js/skel/template.example 2009-11-12 21:05:22 +0000
+++ src-py/lazr/js/skel/template.example 2009-11-30 19:14:09 +0000
@@ -3,13 +3,13 @@
3<html>3<html>
4<head>4<head>
5 <title>Lazr-js examples: ${WIDGET_NAME}</title>5 <title>Lazr-js examples: ${WIDGET_NAME}</title>
6 <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script>6 <script type="text/javascript" src="../../build/yui/yui.js"></script>
7 <script type="text/javascript" src="../../build/lazr/lazr.js"></script>7 <script type="text/javascript" src="../../build/lazr/lazr.js"></script>
8 <script type="text/javascript" src="../../build/${WIDGET_NAME}/${WIDGET_NAME}.js"></script>8 <script type="text/javascript" src="../../build/${WIDGET_NAME}/${WIDGET_NAME}.js"></script>
9 <script type="text/javascript">9 <script type="text/javascript">
1010
11YUI({11YUI({
12 base: '../../build/yui/current/build/',12 base: '../../build/',
13 filter: 'raw'13 filter: 'raw'
14 }).use('node', 'event', 'lazr.${WIDGET_NAME}', function(Y) {14 }).use('node', 'event', 'lazr.${WIDGET_NAME}', function(Y) {
1515
1616
=== modified file 'src-py/lazr/js/skel/template.test-html'
--- src-py/lazr/js/skel/template.test-html 2009-11-12 21:15:54 +0000
+++ src-py/lazr/js/skel/template.test-html 2009-11-30 19:14:09 +0000
@@ -5,10 +5,10 @@
5 <title>${WIDGET_NAME} unit tests</title>5 <title>${WIDGET_NAME} unit tests</title>
66
7 <!-- YUI 3.0 Setup -->7 <!-- YUI 3.0 Setup -->
8 <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script>8 <script type="text/javascript" src="../../yui/yui/yui.js"></script>
9 <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/>9 <link rel="stylesheet" href="../../yui/cssreset/reset.css"/>
10 <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/>10 <link rel="stylesheet" href="../../yui/cssfonts/fonts.css"/>
11 <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/>11 <link rel="stylesheet" href="../../yui/cssbase/base.css"/>
1212
13 <link rel="stylesheet" href="../../testing/assets/testlogger.css"/>13 <link rel="stylesheet" href="../../testing/assets/testlogger.css"/>
1414
1515
=== modified file 'src-py/lazr/js/skel/template.test-js'
--- src-py/lazr/js/skel/template.test-js 2009-11-12 21:05:22 +0000
+++ src-py/lazr/js/skel/template.test-js 2009-11-30 19:14:09 +0000
@@ -16,7 +16,7 @@
16*/16*/
1717
18YUI({18YUI({
19 base: '../../yui/current/build/',19 base: '../../yui/',
20 filter: 'raw',20 filter: 'raw',
21 combine: false21 combine: false
22 }).use('lazr.${WIDGET_NAME}', 'lazr.testing.runner', 'node', 'event', 'yuitest', 'console', function(Y) {22 }).use('lazr.${WIDGET_NAME}', 'lazr.testing.runner', 'node', 'event', 'yuitest', 'console', function(Y) {
2323
=== modified file 'widgets.conf'
--- widgets.conf 2009-11-03 21:59:24 +0000
+++ widgets.conf 2009-11-30 19:14:09 +0000
@@ -1,62 +1,62 @@
1load:1load:
2 - src-js/lazrjs/yui/current/build/cssreset/reset.css2 - src-js/lazrjs/yui/cssreset/reset.css
3 - src-js/lazrjs/yui/current/build/cssfonts/fonts.css3 - src-js/lazrjs/yui/cssfonts/fonts.css
4 - src-js/lazrjs/yui/current/build/cssbase/base.css4 - src-js/lazrjs/yui/cssbase/base.css
5 - src-js/lazrjs/yui/current/build/widget/assets/skins/sam/widget.css5 - src-js/lazrjs/yui/widget/assets/skins/sam/widget.css
6 - src-js/lazrjs/yui/current/build/widget/assets/skins/sam/widget-stack.css6 - src-js/lazrjs/yui/widget/assets/skins/sam/widget-stack.css
7 - src-js/lazrjs/yui/current/build/console/assets/skins/sam/console.css7 - src-js/lazrjs/yui/console/assets/skins/sam/console.css
8 - src-js/lazrjs/yui/current/build/node-menunav/assets/skins/sam/node-menunav.css8 - src-js/lazrjs/yui/node-menunav/assets/skins/sam/node-menunav.css
9 - src-js/lazrjs/testing/assets/testlogger.css9 - src-js/lazrjs/testing/assets/testlogger.css
10 - src-js/lazrjs/testing/jsUnitMockTimeout.js10 - src-js/lazrjs/testing/jsUnitMockTimeout.js
1111
12 # Unbundle yui.js so that the dynamic script loader is neither included nor12 # Unbundle yui.js so that the dynamic script loader is neither included nor
13 # activated.13 # activated.
14 - src-js/lazrjs/yui/current/build/yui/yui-base.js14 - src-js/lazrjs/yui/yui/yui-base.js
15 - src-js/lazrjs/yui/current/build/yui/yui-log.js15 - src-js/lazrjs/yui/yui/yui-log.js
16 - src-js/lazrjs/yui/current/build/yui/yui-later.js16 - src-js/lazrjs/yui/yui/yui-later.js
1717
18 - src-js/lazrjs/yui/current/build/anim/anim-easing.js18 - src-js/lazrjs/yui/anim/anim-easing.js
19 - src-js/lazrjs/yui/current/build/anim/anim.js19 - src-js/lazrjs/yui/anim/anim.js
20 - src-js/lazrjs/yui/current/build/async-queue/async-queue.js20 - src-js/lazrjs/yui/async-queue/async-queue.js
21 - src-js/lazrjs/yui/current/build/attribute/attribute.js21 - src-js/lazrjs/yui/attribute/attribute.js
22 - src-js/lazrjs/yui/current/build/base/base.js22 - src-js/lazrjs/yui/base/base.js
23 - src-js/lazrjs/yui/current/build/cache/cache.js23 - src-js/lazrjs/yui/cache/cache.js
24 - src-js/lazrjs/yui/current/build/classnamemanager/classnamemanager.js24 - src-js/lazrjs/yui/classnamemanager/classnamemanager.js
25 - src-js/lazrjs/yui/current/build/console/console.js25 - src-js/lazrjs/yui/console/console.js
26 - src-js/lazrjs/yui/current/build/dataschema/dataschema-array.js26 - src-js/lazrjs/yui/dataschema/dataschema-array.js
27 - src-js/lazrjs/yui/current/build/dataschema/dataschema-base.js27 - src-js/lazrjs/yui/dataschema/dataschema-base.js
28 - src-js/lazrjs/yui/current/build/dataschema/dataschema-json.js28 - src-js/lazrjs/yui/dataschema/dataschema-json.js
29 - src-js/lazrjs/yui/current/build/dataschema/dataschema-text.js29 - src-js/lazrjs/yui/dataschema/dataschema-text.js
30 - src-js/lazrjs/yui/current/build/dataschema/dataschema-xml.js30 - src-js/lazrjs/yui/dataschema/dataschema-xml.js
31 - src-js/lazrjs/yui/current/build/datasource/datasource.js31 - src-js/lazrjs/yui/datasource/datasource.js
32 - src-js/lazrjs/yui/current/build/datatype/datatype-date.js32 - src-js/lazrjs/yui/datatype/datatype-date.js
33 - src-js/lazrjs/yui/current/build/datatype/datatype-xml.js33 - src-js/lazrjs/yui/datatype/datatype-xml.js
34 - src-js/lazrjs/yui/current/build/datatype/datatype.js34 - src-js/lazrjs/yui/datatype/datatype.js
35 - src-js/lazrjs/yui/current/build/dom/dom.js35 - src-js/lazrjs/yui/dom/dom.js
36 - src-js/lazrjs/yui/current/build/dump/dump.js36 - src-js/lazrjs/yui/dump/dump.js
37 - src-js/lazrjs/yui/current/build/event-custom/event-custom.js37 - src-js/lazrjs/yui/event-custom/event-custom.js
38 - src-js/lazrjs/yui/current/build/event-simulate/event-simulate.js38 - src-js/lazrjs/yui/event-simulate/event-simulate.js
39 - src-js/lazrjs/yui/current/build/event/event.js39 - src-js/lazrjs/yui/event/event.js
40 - src-js/lazrjs/yui/current/build/get/get.js40 - src-js/lazrjs/yui/get/get.js
41 - src-js/lazrjs/yui/current/build/io/io-form.js41 - src-js/lazrjs/yui/io/io-form.js
42 - src-js/lazrjs/yui/current/build/io/io.js42 - src-js/lazrjs/yui/io/io.js
43 - src-js/lazrjs/yui/current/build/json/json.js43 - src-js/lazrjs/yui/json/json.js
44 - src-js/lazrjs/yui/current/build/node-focusmanager/node-focusmanager.js44 - src-js/lazrjs/yui/node-focusmanager/node-focusmanager.js
45 - src-js/lazrjs/yui/current/build/node-menunav/node-menunav.js45 - src-js/lazrjs/yui/node-menunav/node-menunav.js
46 - src-js/lazrjs/yui/current/build/node/node-event-simulate.js46 - src-js/lazrjs/yui/node/node-event-simulate.js
47 - src-js/lazrjs/yui/current/build/node/node.js47 - src-js/lazrjs/yui/node/node.js
48 - src-js/lazrjs/yui/current/build/oop/oop.js48 - src-js/lazrjs/yui/oop/oop.js
49 - src-js/lazrjs/yui/current/build/overlay/overlay.js49 - src-js/lazrjs/yui/overlay/overlay.js
50 - src-js/lazrjs/yui/current/build/plugin/plugin.js50 - src-js/lazrjs/yui/plugin/plugin.js
51 - src-js/lazrjs/yui/current/build/pluginhost/pluginhost.js51 - src-js/lazrjs/yui/pluginhost/pluginhost.js
52 - src-js/lazrjs/yui/current/build/queue-promote/queue-promote.js52 - src-js/lazrjs/yui/queue-promote/queue-promote.js
53 - src-js/lazrjs/yui/current/build/substitute/substitute.js53 - src-js/lazrjs/yui/substitute/substitute.js
54 - src-js/lazrjs/yui/current/build/test/test.js54 - src-js/lazrjs/yui/test/test.js
55 - src-js/lazrjs/yui/current/build/widget/widget-position-ext.js55 - src-js/lazrjs/yui/widget/widget-position-ext.js
56 - src-js/lazrjs/yui/current/build/widget/widget-position.js56 - src-js/lazrjs/yui/widget/widget-position.js
57 - src-js/lazrjs/yui/current/build/widget/widget-stack.js57 - src-js/lazrjs/yui/widget/widget-stack.js
58 - src-js/lazrjs/yui/current/build/widget/widget-stdmod.js58 - src-js/lazrjs/yui/widget/widget-stdmod.js
59 - src-js/lazrjs/yui/current/build/widget/widget.js59 - src-js/lazrjs/yui/widget/widget.js
60 - src-js/lazrjs/activator/activator.js60 - src-js/lazrjs/activator/activator.js
61 - src-js/lazrjs/anim/anim.js61 - src-js/lazrjs/anim/anim.js
62 - src-js/lazrjs/autocomplete/autocomplete.js62 - src-js/lazrjs/autocomplete/autocomplete.js

Subscribers

People subscribed via source and target branches