Hi Sidnei,
I'm glad I didn't have to do all this work. Thanks. I have quite a few
questions, so I'm marking this
needs-fixing
-Edwin
>=== modified file 'examples/inlineeditor/index.html'
>--- examples/inlineeditor/index.html 2009-10-21 17:35:08.000000000 -0500
>+++ new 2009-10-21 17:31:07.000000000 -0500
> var multiline_text = new Y.EditableText({
>- contentBox: '#edit-description',
>- multiline: true,
>- buttons: 'top'
>+ contentBox: '#multiline_text',
>+ multi_line: true,
>+ size: 70
> });
> multiline_text.render();
>
>- // Add the 2 second delay to the underlying editor widget.
>- multiline_text.editor.plug({fn:DelayedSavePlugin});
Why was this removed?
>+ // XXX remove this when done writing the *error CSS stuff.
>+ // editor.editor.showError("Empty text is unacceptable!");
>+ // editor.show_editor();
Why were these comments added?
> });
>
>
>=== modified file 'src-js/lazrjs/choiceedit/tests/choiceedit.js'
>--- src-js/lazrjs/choiceedit/tests/choiceedit.js 2009-10-19 18:16:13 +0000
>+++ src-js/lazrjs/choiceedit/tests/choiceedit.js 2009-10-21 22:29:49 +0000
>@@ -4,7 +4,7 @@
> base: '../../yui/current/build/',
> filter: 'raw',
> combine: false
>- }).use('lazr.choiceedit', 'lazr.testing.runner', 'node', 'event', 'yuitest', 'widget-stack', 'console', function(Y) {
>+ }).use('lazr.choiceedit', 'lazr.testing.runner', 'node', 'event', 'widget-stack', 'console', function(Y) {
Line too long.
> // Local aliases
> var Assert = Y.Assert,
>
>=== modified file 'src-js/lazrjs/formoverlay/tests/formoverlay.js'
>--- src-js/lazrjs/formoverlay/tests/formoverlay.js 2009-10-20 13:47:36 +0000
>+++ src-js/lazrjs/formoverlay/tests/formoverlay.js 2009-10-21 22:29:49 +0000
>@@ -1,11 +1,11 @@
> /* Copyright (c) 2008, Canonical Ltd. All rights reserved. */
>
> YUI({
>- base: '../../yui/3.0.0pr2/build/',
>+ base: '../../yui/current/build/',
> filter: 'raw',
> combine: false
> }).use('lazr.formoverlay', 'lazr.testing.runner',
>- 'lazr.testing.mockio', 'node', 'event', 'yuitest', 'dump',
>+ 'lazr.testing.mockio', 'node', 'event', 'dump',
> 'console', function(Y) {
>
> var Assert = Y.Assert; // For easy access to isTrue(), etc.
>@@ -20,6 +20,17 @@
> Y.Event.simulate(rawnode, evtype, options);
> }
>
>+/* Helper function to cleanup and destroy a form overlay instance */
>+function cleanup_form_overlay(form_overlay) {
>+ if (form_overlay.get('rendered')) {
>+ var bb = form_overlay.get('boundingBox');
>+ bb.get('parentNode').removeChild(bb);
>+ }
>+
>+ // Kill the widget itself.
>+ form_overlay.destroy();
>+}
>+
> /* Helper function that creates a new form overlay instance. */
> function make_form_overlay(cfg) {
> var form_overlay = new Y.lazr.FormOverlay(cfg);
>@@ -52,17 +63,7 @@
>
> tearDown: function() {
> window.top.resizeTo(this.width, this.height);
>- this.cleanUp(this.form_overlay);
>- },
>-
>- cleanUp: function(form_overlay) {
>- if (form_overlay.get('rendered')) {
>- var bb = form_overlay.get('boundingBox');
>- bb.get('parentNode').removeChild(bb);
>- }
>-
>- // Kill the widget itself.
>- form_overlay.destroy();
>+ cleanup_form_overlay(this.form_overlay);
> },
>
> test_form_overlay_can_be_instantiated: function() {
>@@ -71,45 +72,45 @@
> Y.lazr.FormOverlay,
> overlay,
> "Form overlay could not be instantiated.");
>+ cleanup_form_overlay(overlay);
> },
>
> // This fails because YUI adds an extra div for some reason.
> // If and when this is fixed, and this passes, we'll need to
> // update test_form_content_in_bodyContent below.
>- _should: {
>- fail: {test_bodyContent_is_single_node: true}
>- },
>+ // _should: {
>+ // fail: {test_bodyContent_is_single_node: true}
>+ // },
If the following method is passing, can we get rid of the above
configuration and comment?
> test_bodyContent_is_single_node: function() {
> Assert.areEqual(
> 1,
>- this.form_overlay.get("bodyContent").size(),
>+ this.form_overlay.getStdModNode("body").size(),
> "The bodyContent should be a single node, not a node list.");
> },
>
> test_form_content_in_bodyContent: function() {
>- // The form_content should be included in the bodyContent of the
>+ // The form_content should be included in the body of the
> // overlay during initialization.
>- var body_content = this.form_overlay.get("bodyContent");
>+ var body_content = this.form_overlay.getStdModNode("body");
>
> // Ensure the body_content contains our form node.
> // Note: see failing test_bodyContent_is_single_node above for why
> // an index is used here.
Can we get rid of the note in the comment?
> Assert.isTrue(
>- body_content.contains(this.form_overlay.form_node)[1],
>+ body_content.contains(this.form_overlay.form_node),
> "The form node is part of the body content.");
>
> // And then make sure that the user-supplied form_content is
> // included in the form node:
> Assert.areNotEqual(
>- body_content.get("innerHTML")[1].search(
>+ body_content.get("innerHTML").search(
> this.form_overlay.get("form_content")));
> },
>
> test_first_input_has_focus: function() {
> // The first input element in the form content should have
> // focus.
>-
> var first_input = this.form_overlay.form_node.query('#field1');
>
> // Hide the overlay and ensure that the first input does not
>@@ -129,7 +130,7 @@
> });
> };
>
>- Y.on('focus', onFocus, first_input);
>+ first_input.on('focus', onFocus);
>
> this.form_overlay.show();
>
>@@ -139,12 +140,12 @@
> test_form_submit_in_bodyContent: function() {
> // The bodyContent should include the submit button.
>
>- var body_content = this.form_overlay.get("bodyContent");
>+ var body_content = this.form_overlay.getStdModNode("body");
> // Note: see failing test_bodyContent_is_single_node above for why
> // an index is used here.
> Assert.isTrue(
> body_content.contains(
>- this.form_overlay.get("form_submit_button"))[1],
>+ this.form_overlay.get("form_submit_button")),
> "The bodyContent includes the form_submit_button.");
> },
>
>@@ -165,18 +166,18 @@
> form_overlay.form_node.contains(submit_button),
> "The form should include the users submit button.");
>
>- this.cleanUp(form_overlay);
>+ cleanup_form_overlay(form_overlay);
> },
>
> test_form_cancel_in_bodyContent: function() {
> // The bodyContent should include the cancel button.
>
>- var body_content = this.form_overlay.get("bodyContent");
>+ var body_content = this.form_overlay.getStdModNode("body");
> // Note: see failing test_bodyContent_is_single_node above for why
> // an index is used here.
> Assert.isTrue(
> body_content.contains(
>- this.form_overlay.get("form_cancel_button"))[1],
>+ this.form_overlay.get("form_cancel_button")),
> "The bodyContent includes the form_cancel_button.");
> },
>
>@@ -197,7 +198,7 @@
> form_overlay.form_node.contains(cancel_button),
> "The form should include the users cancel button.");
>
>- this.cleanUp(form_overlay);
>+ cleanup_form_overlay(form_overlay);
> },
>
> test_hide_when_cancel_clicked: function() {
>@@ -223,11 +224,11 @@
>
> this.form_overlay.showError("My special error");
>
>- var body_content = this.form_overlay.get("bodyContent");
>+ var body_content = this.form_overlay.getStdModNode("body");
> // Note: see failing test_bodyContent_is_single_node above for why
> // an index is used here.
> Assert.areNotEqual(
>- body_content.get("innerHTML")[1].search("My special error"),
>+ body_content.get("innerHTML").search("My special error"),
> -1,
> "The error text was included in the body content.");
> },
>@@ -238,12 +239,12 @@
> // chars. Not sure what to do about unicode, for eg.
> this.form_overlay.showError("
My special error
");
>
>- var body_content = this.form_overlay.get("bodyContent");
>+ var body_content = this.form_overlay.getStdModNode("body");
> // Note: see failing test_bodyContent_is_single_node above for why
> // an index is used here.
> Assert.areEqual(
> -1,
>- body_content.get("innerHTML")[1].search(""),
>+ body_content.get("innerHTML").search(""),
> "The tags were stripped from the error message.");
> },
>
>@@ -251,9 +252,9 @@
> // The error message should be cleared from the body content.
> this.form_overlay.showError("My special error");
> this.form_overlay.clearError();
>- var body_content = this.form_overlay.get("bodyContent");
>+ var body_content = this.form_overlay.getStdModNode("body");
> Assert.areEqual(
>- body_content.get("innerHTML")[1].search("My special error"),
>+ body_content.get("innerHTML").search("My special error"),
> -1,
> "The error text is cleared from the body content.");
> },
>@@ -309,6 +310,7 @@
> Assert.isTrue(
> callback_called,
> "The form_submit_callback should be called.");
>+ cleanup_form_overlay(form_overlay);
> },
>
> test_submit_with_callback_prevents_propagation: function() {
>@@ -338,6 +340,7 @@
> Assert.isFalse(
> event_was_propagated,
> "The onsubmit event should not be propagated.");
>+ cleanup_form_overlay(form_overlay);
> }, 3000);
> },
>
>@@ -356,6 +359,8 @@
> Assert.isTrue(event_was_propagated,
> "The normal form submission event is propagated as " +
> "normal when no callback is provided.");
>+ cleanup_form_overlay(form_overlay);
>+
> });
> e.preventDefault();
> };
>@@ -386,6 +391,7 @@
> '{field1 => [val1], field2 => [val2], field3 => [val3]}',
> Y.dump(form_overlay.getFormData()),
> "The getFormData method returns simple input data correctly.");
>+ cleanup_form_overlay(form_overlay);
> },
>
> test_getFormData_returns_inputs_nested_several_levels: function() {
>@@ -410,6 +416,7 @@
> '{field1 => [val1], field2 => [val2], field3 => [val3]}',
> Y.dump(form_overlay.getFormData()),
> "The getFormData method returns simple input data correctly.");
>+ cleanup_form_overlay(form_overlay);
>
> },
>
>@@ -429,6 +436,7 @@
> Assert.isTrue(
> form_overlay.form_node.contains(input_node),
> "Failed to pass the form content as a Y.Node instance.");
>+ cleanup_form_overlay(form_overlay);
> },
>
> test_form_content_loaded_from_url_success: function() {
>@@ -459,6 +467,7 @@
> Assert.areEqual(
> external_form_content, form_node_text.match(external_form_content),
> "Failed to render the form.");
>+ cleanup_form_overlay(form_overlay);
> },
>
> test_form_content_loaded_from_url_failure: function() {
>@@ -486,6 +495,7 @@
> Assert.areEqual(
> error_message, form_node_text.match(error_message),
> "Failed to render the error message.");
>+ cleanup_form_overlay(form_overlay);
> },
>
> test_form_content_loaded_from_url_bind_submit: function() {
>@@ -515,6 +525,7 @@
> "input[type=submit]",
> 'click');
> Assert.isTrue(callback_called, "Submit button didn't get hooked up.");
>+ cleanup_form_overlay(form_overlay);
> }
> }));
>
>
>=== modified file 'src-js/lazrjs/overlay/tests/overlay.js'
>--- src-js/lazrjs/overlay/tests/overlay.js 2009-10-19 18:16:13 +0000
>+++ src-js/lazrjs/overlay/tests/overlay.js 2009-10-21 22:29:49 +0000
>@@ -4,7 +4,7 @@
> base: '../../yui/current/build/',
> filter: 'raw',
> combine: false
>- }).use('lazr.overlay', 'lazr.testing.runner', 'node', 'event', 'yuitest', 'widget-stack', 'console', function(Y) {
>+ }).use('lazr.overlay', 'lazr.testing.runner', 'node', 'event', 'widget-stack', 'console', function(Y) {
Line too long.
> // KeyCode for escape
> var ESCAPE = 27;
>@@ -85,8 +85,8 @@
> },
>
> test_overlay_can_hide_progressbar: function() {
>- this.overlay = new Y.lazr.PrettyOverlay();
>- this.overlay.render({progressbar: false});
>+ this.overlay = new Y.lazr.PrettyOverlay({progressbar: false});
>+ this.overlay.render();
> var bb = this.overlay.get('boundingBox');
> bb.set('headerContent', 'ALL HAIL DISCORDIA!');
> Assert.isNull(
>@@ -106,8 +106,8 @@
> },
>
> test_overlay_can_hide_steptitle: function() {
>- this.overlay = new Y.lazr.PrettyOverlay();
>- this.overlay.render({progressbar: false});
>+ this.overlay = new Y.lazr.PrettyOverlay({progressbar: false});
>+ this.overlay.render();
> var bb = this.overlay.get('boundingBox');
> bb.set('headerContent', 'ALL HAIL DISCORDIA!');
> Assert.isNull(
>
>=== modified file 'src-js/lazrjs/picker/picker.js'
>--- src-js/lazrjs/picker/picker.js 2009-07-06 16:18:36 +0000
>+++ src-js/lazrjs/picker/picker.js 2009-10-21 22:29:49 +0000
>@@ -204,7 +204,7 @@
> var options = this.get(BATCHES);
>
> // Clear previous batches.
>- Y.Event.purgeElement(this.batches_box, true);
>+ Y.Event.purgeElement(this._batches_box, true);
> this._batches_box.set('innerHTML', '');
>
> if (options.length === 0) {
>@@ -232,7 +232,7 @@
> this._batches_box.appendChild(batch_item);
>
> batch_item.on('click', function (e) {
>- this.set('selected_batch', i);
>+ this.set(SELECTED_BATCH, i);
> this.fire(
> SEARCH, this.get(CURRENT_SEARCH_STRING), data.value);
> }, this);
>@@ -259,7 +259,7 @@
> var idx = this.get(SELECTED_BATCH);
>
> var items = this._batches_box.queryAll('span');
>- if (items) {
>+ if (items.size()) {
> this._prev_button.set('disabled', idx === 0);
> items.removeClass(C_SELECTED_BATCH);
> items.item(idx).addClass(C_SELECTED_BATCH);
>@@ -415,8 +415,8 @@
> this._footer_slot_box = Y.Node.create('
this._footer_slot_box.addClass(C_FOOTER_SLOT);
>
>- //We cannot set the bodyContent element here, because
>- //YUI screwed it up. So fake it.
>+ // We cannot set the bodyContent element here, because
>+ // YUI screwed it up. So fake it.
The "bodyContent element" should probably be referred to
as the "Y.WidgetStdMod.BODY element".
> var body = Y.Node.create('');
> body.appendChild(search_box);
> body.appendChild(this._batches_box);
>@@ -445,8 +445,10 @@
>
> // Give the focus to the search input.
> Y.on('focus', function (e) {
>+ if (e.target !== this._search_input){
> e.halt();
> this._search_input.focus();
>+ }
Could you indent the inside of this if-statement?
> }, this.get(BOUNDING_BOX), this);
>
> // Focus search box when the widget is first displayed.
>@@ -485,7 +487,14 @@
> // is changed, and reset the selected one to the first one.
> this.after('batchesChange', function (e) {
> this._syncBatchesUI();
>+ if (this.get(SELECTED_BATCH) == 0){
>+ // If the attribute is already set to the same value,
>+ // the 'after' events won't be triggered, so we have
>+ // to trigger it manually.
>+ this._syncSelectedBatchUI();
>+ } else {
> this.set(SELECTED_BATCH, 0);
Could you indent this line?
>+ }
> }, this);
>
> // Keep the UI in sync with the currently selected batch.
>@@ -686,7 +695,7 @@
> */
> selected_batch: {
> value: 0,
>- get: function (value) {
>+ getter: function (value) {
> return value || 0;
> },
> validator: function (value) {
>@@ -730,6 +739,6 @@
>
> }, '0.1', {
> requires: [
>- 'oop', 'event', 'node', 'substitute', 'lazr.overlay', 'lazr.anim',
>- 'lazr.base']
>+ 'oop', 'event', 'event-focus', 'node', 'substitute',
>+ 'lazr.overlay', 'lazr.anim', 'lazr.base']
> });
>
>=== modified file 'src-js/lazrjs/testing/testing.js'
>--- src-js/lazrjs/testing/testing.js 2009-10-19 20:25:30 +0000
>+++ src-js/lazrjs/testing/testing.js 2009-10-21 22:29:49 +0000
>@@ -71,7 +71,7 @@
> fakeTestCase[testObject["methodName"]] = Y.bind(function (testObject) {
> var results = [];
>
>- var onComplete = function (event, testCaseName, testMethodName, results) {
>+ var onComplete = function (testCaseName, testMethodName, results, event) {
Line too long.
> Y.Test.Runner.unsubscribe("testsuitecomplete");
> results.push(event.results[testCaseName][testMethodName]);
> };
>
>=== modified file 'widgets.conf'
>--- widgets.conf 2009-10-20 13:11:56 +0000
>+++ widgets.conf 2009-10-21 22:29:49 +0000
>@@ -5,37 +5,53 @@
How is this file generated? There appear to be a bunch of diffs
from entries just moving to different spots. If this is generated by
a script, it would be nice to have it sort the list, so that future
diffs show only real changes.
> - src-js/lazrjs/yui/current/build/widget/assets/skins/sam/widget.css
> - src-js/lazrjs/yui/current/build/widget/assets/skins/sam/widget-stack.css
> - src-js/lazrjs/yui/current/build/console/assets/skins/sam/console.css
>+ - src-js/lazrjs/yui/current/build/node-menunav/assets/skins/sam/node-menunav.css
> - src-js/lazrjs/testing/assets/testlogger.css
> - src-js/lazrjs/jsUnitMockTimeout.js
> - src-js/lazrjs/yui/current/build/yui/yui.js
> - patch src-js/lazrjs/yui-patch.js
>- - src-js/lazrjs/yui/current/build/attribute/attribute.js
> - src-js/lazrjs/yui/current/build/oop/oop.js
> - src-js/lazrjs/yui/current/build/anim/anim.js
> - src-js/lazrjs/yui/current/build/anim/anim-easing.js
> - src-js/lazrjs/yui/current/build/substitute/substitute.js
> - src-js/lazrjs/yui/current/build/classnamemanager/classnamemanager.js
>- - src-js/lazrjs/yui/current/build/base/base.js
> - src-js/lazrjs/yui/current/build/dom/dom.js
> - src-js/lazrjs/yui/current/build/json/json.js
>- - src-js/lazrjs/yui/current/build/base/base.js
>+ - src-js/lazrjs/yui/current/build/event-custom/event-custom.js
> - src-js/lazrjs/yui/current/build/event/event.js
>+ - src-js/lazrjs/yui/current/build/event-simulate/event-simulate.js
>+ - src-js/lazrjs/yui/current/build/pluginhost/pluginhost.js
>+ - src-js/lazrjs/yui/current/build/attribute/attribute.js
>+ - src-js/lazrjs/yui/current/build/base/base.js
>+ - src-js/lazrjs/yui/current/build/plugin/plugin.js
> - src-js/lazrjs/yui/current/build/widget/widget.js
> - src-js/lazrjs/yui/current/build/widget/widget-position.js
> - src-js/lazrjs/yui/current/build/widget/widget-stack.js
> - src-js/lazrjs/yui/current/build/widget/widget-position-ext.js
> - src-js/lazrjs/yui/current/build/widget/widget-stdmod.js
> - src-js/lazrjs/yui/current/build/node/node.js
>+ - src-js/lazrjs/yui/current/build/node/node-event-simulate.js
>+ - src-js/lazrjs/yui/current/build/node-focusmanager/node-focusmanager.js
> - src-js/lazrjs/yui/current/build/node-menunav/node-menunav.js
> - src-js/lazrjs/yui/current/build/overlay/overlay.js
> - src-js/lazrjs/yui/current/build/io/io.js
> - src-js/lazrjs/yui/current/build/io/io-form.js
> - src-js/lazrjs/yui/current/build/get/get.js
>- - src-js/lazrjs/yui/current/build/plugin/plugin.js
>+ - src-js/lazrjs/yui/current/build/cache/cache.js
>+ - src-js/lazrjs/yui/current/build/datatype/datatype.js
>+ - src-js/lazrjs/yui/current/build/datatype/datatype-date.js
>+ - src-js/lazrjs/yui/current/build/datatype/datatype-xml.js
>+ - src-js/lazrjs/yui/current/build/dataschema/dataschema-base.js
>+ - src-js/lazrjs/yui/current/build/dataschema/dataschema-array.js
>+ - src-js/lazrjs/yui/current/build/dataschema/dataschema-json.js
>+ - src-js/lazrjs/yui/current/build/dataschema/dataschema-text.js
>+ - src-js/lazrjs/yui/current/build/dataschema/dataschema-xml.js
>+ - src-js/lazrjs/yui/current/build/datasource/datasource.js
> - src-js/lazrjs/yui/current/build/console/console.js
>- - src-js/lazrjs/yui/current/build/yuitest/yuitest.js
> - src-js/lazrjs/yui/current/build/dump/dump.js
>- - src-js/lazrjs/yui/current/build/queue/queue.js
>+ - src-js/lazrjs/yui/current/build/test/test.js
>+ - src-js/lazrjs/yui/current/build/async-queue/async-queue.js
>+ - src-js/lazrjs/yui/current/build/queue-promote/queue-promote.js
> - src-js/lazrjs/testing/mockio.js
> - src-js/lazrjs/testing/testing.js
> - src-js/lazrjs/activator/activator.js
>@@ -48,7 +64,7 @@
> - src-js/lazrjs/overlay/overlay.js
> - src-js/lazrjs/picker/picker.js
> - src-js/lazrjs/activator/tests/activator.js
>- - src-js/lazrjs/autocomplete/tests/test.js
>+ - src-js/lazrjs/autocomplete/tests/autocomplete.js
> - src-js/lazrjs/choiceedit/tests/choiceedit.js
> - src-js/lazrjs/formoverlay/tests/formoverlay.js
> - src-js/lazrjs/inlineedit/tests/inline_edit.js
>