← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wallyworld/launchpad/die-lazr-buttons-die into lp:launchpad

 

Ian Booth has proposed merging lp:~wallyworld/launchpad/die-lazr-buttons-die into lp:launchpad.

Requested reviews:
  j.c.sackett (jcsackett)
Related bugs:
  Bug #1043606 in Launchpad itself: "Form icon based buttons are unintuitive"
  https://bugs.launchpad.net/launchpad/+bug/1043606

For more details, see:
https://code.launchpad.net/~wallyworld/launchpad/die-lazr-buttons-die/+merge/121976

== Implementation ==

This branch removes the css classes lazr-btn, lazr-pos and lazr-neg from all the places which create a form overlay or confirmation overlay. Plus, the grantee picker is updated to use standard html buttons, as is the multicheckbox widget used on the build recipes page.

formoverlay is enhanced to allow the caller to specify the text to use on the ok and cancel buttons. eg the delete confirmation popup uses "Delete" and "Cancel" respectively. 

The multicheckbox widget needed a bit of surgery to migrate it from using a custom configured overlay to a standard formoverlay.

== Tests ==

I updated the multicheckbox widget and grantee picker yui tests to account for the new code. The other changes are essentially just css changes.

== Lint ==

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/canonical/launchpad/icing/css/forms.css
  lib/lp/app/javascript/multicheckbox.js
  lib/lp/app/javascript/confirmationoverlay/confirmationoverlay.js
  lib/lp/app/javascript/tests/test_multicheckboxwidget.html
  lib/lp/app/javascript/tests/test_multicheckboxwidget.js
  lib/lp/bugs/javascript/bug_subscription_portlet.js
  lib/lp/bugs/javascript/bugtask_index.js
  lib/lp/bugs/javascript/filebug_dupefinder.js
  lib/lp/bugs/javascript/information_type_choice.js
  lib/lp/bugs/javascript/subscription.js
  lib/lp/code/javascript/branch.subscription.js
  lib/lp/code/javascript/branchmergeproposal.nominate.js
  lib/lp/registry/javascript/distroseriesdifferences_details.js
  lib/lp/registry/javascript/structural-subscription.js
  lib/lp/registry/javascript/distroseries/differences.js
  lib/lp/registry/javascript/sharing/granteepicker.js
  lib/lp/registry/javascript/sharing/pillarsharingview.js
  lib/lp/registry/javascript/sharing/sharingdetailsview.js
  lib/lp/registry/javascript/sharing/tests/test_granteepicker.js
  lib/lp/translations/javascript/sourcepackage_sharing_details.js
-- 
https://code.launchpad.net/~wallyworld/launchpad/die-lazr-buttons-die/+merge/121976
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== modified file 'lib/canonical/launchpad/icing/css/forms.css'
--- lib/canonical/launchpad/icing/css/forms.css	2012-08-08 17:01:28 +0000
+++ lib/canonical/launchpad/icing/css/forms.css	2012-08-30 02:55:23 +0000
@@ -233,14 +233,12 @@
 .step-links {
     padding-top: 0;
     padding-bottom: 0;
+    margin-left: 0.75em;
     margin-right: 10em;
-    text-align: right;
-    }
-.step-links button.next {
-    padding-top: 10px;
+    text-align: left;
     }
 .step-links .prev {
-    margin-right: 2em;
+    margin-right: 0.7em;
     }
 .lazr-multiline-edit .yui3-ieditor {
     padding-right: 0;

=== modified file 'lib/lp/app/javascript/confirmationoverlay/confirmationoverlay.js'
--- lib/lp/app/javascript/confirmationoverlay/confirmationoverlay.js	2011-09-13 11:21:47 +0000
+++ lib/lp/app/javascript/confirmationoverlay/confirmationoverlay.js	2012-08-30 02:55:23 +0000
@@ -115,6 +115,30 @@
      */
     display_confirmation_fn: {
         value: null
+    },
+
+    /**
+     * The text to display on the OK button.
+     *
+     * @attribute submit_text
+     * @type Function
+     * @default 'OK'
+     *
+     */
+    submit_text: {
+        value: 'OK'
+    },
+
+    /**
+     * The text to display on the Cancel button.
+     *
+     * @attribute cancel_text
+     * @type Function
+     * @default 'Cancel'
+     *
+     */
+    cancel_text: {
+        value: 'Cancel'
     }
 };
 
@@ -122,11 +146,11 @@
 
     initializer: function(cfg) {
         var submit_button = Y.Node.create(
-            '<button type="submit" class="lazr-pos lazr-btn ok-btn" />')
-            .set("text", "OK");
+            '<button type="submit" class="ok-btn" />')
+            .set("text", this.get('submit_text'));
         var cancel_button = Y.Node.create(
-            '<button type="button" class="lazr-neg lazr-btn cancel-btn" />')
-            .set("text", "Cancel");
+            '<button type="button" class="cancel-btn" />')
+            .set("text", this.get('cancel_text'));
         this.set('form_submit_button', submit_button);
         this.set('form_cancel_button', cancel_button);
 

=== modified file 'lib/lp/app/javascript/multicheckbox.js'
--- lib/lp/app/javascript/multicheckbox.js	2012-05-12 01:50:39 +0000
+++ lib/lp/app/javascript/multicheckbox.js	2012-08-30 02:55:23 +0000
@@ -44,10 +44,7 @@
     };
 
     // The function called to save the selected items.
-    function save(editform, item_value_mapping) {
-        var choice_nodes = Y.one('[id="'+attribute_name+'.items"]');
-        var result = namespace.getSelectedItems(
-            choice_nodes, item_value_mapping, attribute_type);
+    function save(result) {
         activator.renderProcessing();
         var success_handler = function (entry) {
             result_node.setContent(entry.getHTML(attribute_name));
@@ -56,7 +53,7 @@
 
         var patch_payload = {};
         patch_payload[attribute_name] = result;
-        client.patch(editform._resource_uri, patch_payload, {
+        client.patch(resource_uri, patch_payload, {
             accept: 'application/json;include=lp_html',
             on: {
                 success: success_handler,
@@ -67,9 +64,8 @@
 
     config.save = save;
     config.content_box_id = content_box_id;
-    var editform = namespace.create(attribute_name, items, help_text, config);
-    editform._resource_uri = resource_uri;
-    var extra_buttons = Y.Node.create('<div class="extra-form-buttons"/>');
+    var editform = namespace.create(
+            attribute_name, attribute_type, items, help_text, config);
     activator.subscribe('act', function (e) {
         editform.show();
     });
@@ -85,6 +81,9 @@
   * @method create
   * @param {String} attribute_name The attribute on the resource being
   *                                modified.
+  * @param {String} attribute_type The attribute type.
+  *     "reference": the items are object references
+  *     Other values are currently ignored.
   * @param {Array} items Items for which to create checkbox elements.
   * @param {String} help_text text display below the checkboxes.
   * @param {Object} config Optional Object literal of config name/value pairs.
@@ -93,7 +92,8 @@
   *                        config.save is a Function (optional) which takes
   *                        a single string argument.
   */
-namespace.create = function (attribute_name, items, help_text, config) {
+namespace.create = function (attribute_name, attribute_type, items, help_text,
+                             config) {
     var header;
     if (config !== undefined) {
         header = 'Choose an item.';
@@ -102,22 +102,6 @@
         }
     }
 
-    var new_config = Y.merge(config, {
-        align: {
-            points: [Y.WidgetPositionAlign.CC,
-                     Y.WidgetPositionAlign.CC]
-        },
-        progressbar: true,
-        progress: 100,
-        headerContent: "<h2>" + header + "</h2>",
-        centered: true,
-        zIndex: 1000,
-        visible: false
-        });
-
-    // We use a pretty overlay to display the checkboxes.
-    var editform = new Y.lazr.PrettyOverlay(new_config);
-
     // The html for each checkbox.
     var CHECKBOX_TEMPLATE =
         ['<label style="{item_style}" for="{field_name}.{field_index}">',
@@ -148,7 +132,7 @@
             item_style: data.style, item_checked: checked_html});
 
         var choice_item = Y.Node.create("<li/>");
-        choice_item.set("innerHTML", checkbox_html);
+        choice_item.setContent(checkbox_html);
         choices_nodes.appendChild(choice_item);
         item_value_mapping[data.token] = data.value;
     }, this);
@@ -156,31 +140,34 @@
     content.appendChild(body);
     var help_node = Y.Node.create("<p class='formHelp'>"+help_text+"</p>");
     content.appendChild(help_node);
-    editform.set('bodyContent', content);
 
-    // We replace the default Close button (x) with our own save/cancel ones.
-    var close_node = editform.get('boundingBox').one('div.close');
-    var orig_close_button = close_node.one('a');
-    orig_close_button.setAttribute('style', 'display: none');
     var save_button = Y.Node.create(
-        '<button id="'+config.content_box_id+'-save" ' +
-        'class="overlay-close-button lazr-pos lazr-btn">Ok</button>');
-    var close_button = Y.Node.create(
-        '<button class="overlay-close-button lazr-neg lazr-btn">Cancel' +
-        '</button>');
-    save_button.on('click', function(e) {
-        e.halt();
+        '<button id="'+config.content_box_id+'-save">Save</button>');
+    var save_callback = function(data) {
         editform.hide();
-        config.save(editform, item_value_mapping);
-    });
-    close_button.on('click', function(e) {
-        e.halt();
-        editform.fire('cancel');
-    });
-    close_node.appendChild(close_button);
-    close_node.appendChild(save_button);
+        var result = namespace.getSelectedItems(
+            data, item_value_mapping, attribute_type);
+        config.save(result);
+    };
+    var new_config = Y.merge(config, {
+        align: {
+            points: [Y.WidgetPositionAlign.CC,
+                     Y.WidgetPositionAlign.CC]
+        },
+        progressbar: true,
+        progress: 100,
+        headerContent: "<h2>" + header + "</h2>",
+        centered: true,
+        zIndex: 1000,
+        visible: false,
+        form_content: content,
+        form_submit_button: save_button,
+        form_cancel_button: Y.Node.create(
+            '<button type="button">Cancel</button>'),
+        form_submit_callback: save_callback
+        });
+    var editform = new Y.lazr.FormOverlay(new_config);
     editform.render();
-    editform.hide();
     return editform;
 };
 
@@ -189,16 +176,13 @@
  * Return a list of the selected checkbox values.
  * Exposed via the namespace so it is accessible to tests.
  */
-namespace.getSelectedItems = function(choice_nodes, item_value_mapping,
+namespace.getSelectedItems = function(data, item_value_mapping,
                                       attribute_type) {
     var result = [];
-    choice_nodes.all('.checkboxType').each(function(item) {
-        if (item.get("checked")) {
-            var item_token = item.getAttribute("value");
+    Y.each(data, function(item_token, key) {
             var item_value = item_value_mapping[item_token];
             var marshalled_value = marshall(item_value, attribute_type);
             result.push(marshalled_value);
-        }
     });
     return result;
 };
@@ -218,5 +202,5 @@
 }
 
 }, "0.1", {"requires": [
-    "dom", "escape", "lazr.overlay", "lazr.activator", "lp.client"
+    "dom", "escape", "lazr.formoverlay", "lazr.activator", "lp.client"
     ]});

=== modified file 'lib/lp/app/javascript/tests/test_multicheckboxwidget.html'
--- lib/lp/app/javascript/tests/test_multicheckboxwidget.html	2012-08-22 20:28:52 +0000
+++ lib/lp/app/javascript/tests/test_multicheckboxwidget.html	2012-08-30 02:55:23 +0000
@@ -25,10 +25,17 @@
       <link rel="stylesheet" href="../../../app/javascript/testing/test.css" />
 
       <!-- Dependencies -->
+       <script type="text/javascript" src="../../../../../build/js/lp/app/lp.js"></script>
        <script type="text/javascript" src="../../../../../build/js/lp/app/client.js"></script>
        <script type="text/javascript" src="../../../../../build/js/lp/app/activator/activator.js"></script>
+       <script type="text/javascript" src="../../../../../build/js/lp/app/anim/anim.js"></script>
+       <script type="text/javascript" src="../../../../../build/js/lp/app/effects/effects.js"></script>
+       <script type="text/javascript" src="../../../../../build/js/lp/app/expander.js"></script>
+       <script type="text/javascript" src="../../../../../build/js/lp/app/extras/extras.js"></script>
+       <script type="text/javascript" src="../../../../../build/js/lp/app/lazr/lazr.js"></script>
+       <script type="text/javascript" src="../../../../../build/js/lp/app/overlay/overlay.js"></script>
+       <script type="text/javascript" src="../../../../../build/js/lp/app/formoverlay/formoverlay.js"></script>
        <script type="text/javascript" src="../../../../../build/js/lp/app/ui/ui.js"></script>
-       <script type="text/javascript" src="../../../../../build/js/lp/app/overlay/overlay.js"></script>
 
       <!-- The module under test. -->
       <script type="text/javascript" src="../multicheckbox.js"></script>

=== modified file 'lib/lp/app/javascript/tests/test_multicheckboxwidget.js'
--- lib/lp/app/javascript/tests/test_multicheckboxwidget.js	2012-06-26 17:06:01 +0000
+++ lib/lp/app/javascript/tests/test_multicheckboxwidget.js	2012-08-30 02:55:23 +0000
@@ -1,7 +1,7 @@
 /* Copyright (c) 2011, Canonical Ltd. All rights reserved. */
 
 YUI().use('lp.testing.runner', 'test', 'console', 'dom', 'event',
-        'event-simulate', 'lazr.overlay', 'lazr.activator',
+        'event-simulate', 'lazr.formoverlay', 'lazr.activator',
         'lp.client', 'lp.app.multicheckbox',
         function(Y) {
 
@@ -132,10 +132,10 @@
     test_getSelectedItems: function() {
         // Test that getSelectedItems returns the correct values.
         this.createWidget();
-        var items = Y.one('[id="multicheckboxtest.items"]');
+        var data = {'field.item.0': '0'};
         var mapping = {0: 'Item0', 1: 'Item1'};
         var selected = Y.lp.app.multicheckbox.getSelectedItems(
-            items, mapping, '');
+            data, mapping, '');
         Y.ArrayAssert.itemsAreEqual(['Item0'], selected);
     },
 
@@ -143,10 +143,10 @@
         // Test that getSelectedItems returns the correct values for reference
         // values which are links to domain objects.
         this.createWidget();
-        var items = Y.one('[id="multicheckboxtest.items"]');
+        var data = {'field.item.0': '0'};
         var mapping = {0: '/ubuntu/Item0', 1: '/ubuntu/Item1'};
         var selected = Y.lp.app.multicheckbox.getSelectedItems(
-            items, mapping, 'reference');
+            data, mapping, 'reference');
         var item_value = Y.lp.client.normalize_uri(selected[0]);
         var link = Y.lp.client.get_absolute_uri(item_value);
         Y.ArrayAssert.itemsAreEqual([link], selected);

=== modified file 'lib/lp/bugs/javascript/bug_subscription_portlet.js'
--- lib/lp/bugs/javascript/bug_subscription_portlet.js	2012-06-05 08:10:16 +0000
+++ lib/lp/bugs/javascript/bug_subscription_portlet.js	2012-08-30 02:55:23 +0000
@@ -275,10 +275,10 @@
                     '"Mute bug mail" option.</p>',
                     '<p>Do you really want to unsubscribe from this bug?',
                     '</p><div class="extra-form-buttons">',
-                    '<button class="lazr-pos lazr-btn ok-btn" ',
-                    'type="submit"></button>',
-                    '<button class="lazr-neg lazr-btn cancel-btn" ',
-                    'type="button"></button></div></div>'].join(''));
+                    '<button class="ok-btn" ',
+                    'type="submit">Unsubscribe</button>',
+                    '<button class="cancel-btn" ',
+                    'type="button">Cancel</button></div></div>'].join(''));
                 var remove_div = Y.one('.remove-direct-subscription');
                 var ok_btn = private_bug_warning_node.one('.ok-btn');
                 ok_btn.on('click', function (internal_e) {

=== modified file 'lib/lp/bugs/javascript/bugtask_index.js'
--- lib/lp/bugs/javascript/bugtask_index.js	2012-08-23 18:58:50 +0000
+++ lib/lp/bugs/javascript/bugtask_index.js	2012-08-30 02:55:23 +0000
@@ -365,7 +365,8 @@
             namespace.delete_bugtask(delete_link, conf);
         },
         form_content: delete_text,
-        headerContent: '<h2>Confirm bugtask deletion</h2>'
+        headerContent: '<h2>Confirm bugtask deletion</h2>',
+        submit_text: 'Delete'
     });
     co.show();
 };

=== modified file 'lib/lp/bugs/javascript/filebug_dupefinder.js'
--- lib/lp/bugs/javascript/filebug_dupefinder.js	2012-08-02 06:24:13 +0000
+++ lib/lp/bugs/javascript/filebug_dupefinder.js	2012-08-30 02:55:23 +0000
@@ -51,11 +51,9 @@
  */
 var submit_button_html =
     '<button type="submit" name="field.actions.this_is_my_bug" ' +
-    'value="Yes, this is the bug I\'m trying to report"' +
-    'class="lazr-pos lazr-btn" >OK</button>';
+    'value="Yes, this is the bug I\'m trying to report">Affects Me</button>';
 var cancel_button_html =
-    '<button type="button" name="field.actions.cancel" ' +
-    'class="lazr-neg lazr-btn" >Cancel</button>';
+    '<button type="button" name="field.actions.cancel">Choose Again</button>';
 
 /**
  * Return the relevant duplicate-details div for a bug-already-reported
@@ -263,7 +261,8 @@
     // the horror that entails.
     var subscribe_form_body =
         '<div style="width: 320px">' +
-        '    <p style="width: 100%">#' + bug_id + ' "' + bug_title + '"' +
+        '    <p style="width: 100%; font-size: 12px;">#'+
+                bug_id + ' "' + bug_title + '"' +
         '    <br /><br /></p>' +
         '    <p style="font-weight: bold;">' +
         '       <input type="hidden" name="field.bug_already_reported_as" ' +
@@ -286,7 +285,7 @@
         '</div>';
 
     // Create the do-you-want-to-subscribe FormOverlay.
-    subscribe_form_overlay = new Y.lazr.FormOverlay({
+    var subscribe_form_overlay = new Y.lazr.FormOverlay({
         headerContent: '<h2>Affected by this bug?</h2>',
         form_content: subscribe_form_body,
         form_submit_button: Y.Node.create(submit_button_html),

=== modified file 'lib/lp/bugs/javascript/information_type_choice.js'
--- lib/lp/bugs/javascript/information_type_choice.js	2012-08-28 01:52:34 +0000
+++ lib/lp/bugs/javascript/information_type_choice.js	2012-08-30 02:55:23 +0000
@@ -150,7 +150,8 @@
             do_save();
         },
         form_content: confirm_text,
-        headerContent: '<h2>Confirm information type change</h2>'
+        headerContent: '<h2>Confirm information type change</h2>',
+        submit_text: 'Confirm'
     });
     co.show();
 };

=== modified file 'lib/lp/bugs/javascript/subscription.js'
--- lib/lp/bugs/javascript/subscription.js	2012-08-21 04:04:47 +0000
+++ lib/lp/bugs/javascript/subscription.js	2012-08-30 02:55:23 +0000
@@ -1104,7 +1104,8 @@
                 var co = new ns.ConfirmationOverlay({
                     submit_fn: method_call,
                     form_content: content,
-                    headerContent: 'Unsubscribe from this bug'
+                    headerContent: 'Unsubscribe from this bug',
+                    submit_text: 'Unsubscribe'
                 });
                 co.show();
             } else {

=== modified file 'lib/lp/code/javascript/branch.subscription.js'
--- lib/lp/code/javascript/branch.subscription.js	2012-05-11 21:56:15 +0000
+++ lib/lp/code/javascript/branch.subscription.js	2012-08-30 02:55:23 +0000
@@ -90,10 +90,10 @@
             headerContent: "<h2>Subscribe to branch</h2>",
             form_submit_button: Y.Node.create(
                 '<button type="submit" name="field.actions.subscribe" ' +
-                'value="Subscribe" class="lazr-pos lazr-btn">Ok</button>'),
+                'value="Subscribe">Subscribe</button>'),
             form_cancel_button: Y.Node.create(
                 '<button type="button" name="field.actions.cancel" ' +
-                'class="lazr-neg lazr-btn">Cancel</button>'),
+                '>Cancel</button>'),
             centered: true,
             form_submit_callback: function(data ) {
 

=== modified file 'lib/lp/code/javascript/branchmergeproposal.nominate.js'
--- lib/lp/code/javascript/branchmergeproposal.nominate.js	2012-07-21 03:04:06 +0000
+++ lib/lp/code/javascript/branchmergeproposal.nominate.js	2012-08-30 02:55:23 +0000
@@ -132,7 +132,8 @@
             form.submit();
         },
         form_content: yn_content,
-        headerContent: '<h2>Confirm reviewer nomination</h2>'
+        headerContent: '<h2>Confirm reviewer nomination</h2>',
+        submit_text: 'Confirm'
     });
     co.show();
 };

=== modified file 'lib/lp/registry/javascript/distroseries/differences.js'
--- lib/lp/registry/javascript/distroseries/differences.js	2011-08-01 16:06:59 +0000
+++ lib/lp/registry/javascript/distroseries/differences.js	2012-08-30 02:55:23 +0000
@@ -124,10 +124,10 @@
 
     /* Buttons */
     var submit_button = Y.Node.create(
-        '<button type="submit" class="lazr-pos lazr-btn" />')
+        '<button type="submit"/>')
            .set("text", "OK");
     var cancel_button = Y.Node.create(
-        '<button type="button" class="lazr-neg lazr-btn" />')
+        '<button type="button"/>')
            .set("text", "Cancel");
 
     /* When the form overlay is submitted the search filter form is

=== modified file 'lib/lp/registry/javascript/distroseriesdifferences_details.js'
--- lib/lp/registry/javascript/distroseriesdifferences_details.js	2012-07-07 14:00:30 +0000
+++ lib/lp/registry/javascript/distroseriesdifferences_details.js	2012-08-30 02:55:23 +0000
@@ -269,10 +269,10 @@
                 .set("cols", "60"));
         /* Buttons */
         var submit_button = Y.Node.create(
-            '<button type="submit" class="lazr-pos lazr-btn" />')
+            '<button type="submit"/>')
                 .set("text", "OK");
         var cancel_button = Y.Node.create(
-            '<button type="button" class="lazr-neg lazr-btn" />')
+            '<button type="button"/>')
                 .set("text", "Cancel");
 
         var self = this;

=== modified file 'lib/lp/registry/javascript/sharing/granteepicker.js'
--- lib/lp/registry/javascript/sharing/granteepicker.js	2012-08-27 20:13:49 +0000
+++ lib/lp/registry/javascript/sharing/granteepicker.js	2012-08-30 02:55:23 +0000
@@ -90,18 +90,18 @@
         var step_two_html = [
             '<div class="picker-content-two transparent">',
             '<div class="step-links">',
-            '<a class="prev js-action" href="#">Back</a>',
-            '<button class="next lazr-pos lazr-btn"></button>',
-            '<a class="next js-action" href="#">Select</a>',
+            '<button class="prev">Back</a>',
+            '<button class="next">Update</button>',
             '</div></div>'
             ].join(' ');
         var self = this;
         var step_two_content = Y.Node.create(step_two_html);
         // Remove the back link if required.
         if (Y.Lang.isBoolean(back_enabled) && !back_enabled ) {
-            step_two_content.one('a.prev').remove(true);
+            step_two_content.one('.prev').remove(true);
         } else {
-            step_two_content.one('a.prev').on('click', function(e) {
+            step_two_content.one('.next').setContent('Share');
+            step_two_content.one('.prev').on('click', function(e) {
                 e.halt();
                 self._display_step_one();
             });
@@ -200,17 +200,17 @@
     },
 
     /**
-     * Disable the select links if no info type checkboxes are ticked.
+     * Disable the select button if no info type checkboxes are ticked.
      * @param content
      * @private
      */
     _disable_select_if_all_info_choices_nothing: function(content) {
-        var disable_links = this._all_info_choices_nothing(content);
+        var disable_btn = this._all_info_choices_nothing(content);
         content.all('.next').each(function(node) {
-            if (disable_links) {
-                node.addClass('invalid-link');
+            if (disable_btn) {
+                node.set('disabled', true);
             } else {
-                node.removeClass('invalid-link');
+                node.set('disabled', false);
             }
         });
     },
@@ -295,7 +295,8 @@
         // Disable the radio buttons 'Some' for selected info types.
         var disable_some_button = function(info_type) {
             var selector =
-                'input[name="field.permission.' + info_type + '"][value="SOME"]';
+                'input[name="field.permission.' + info_type + '"]' +
+                '[value="SOME"]';
             policies.all(selector).each(function(permission_node) {
                     permission_node.set('disabled', true);
                     permission_node.set(

=== modified file 'lib/lp/registry/javascript/sharing/pillarsharingview.js'
--- lib/lp/registry/javascript/sharing/pillarsharingview.js	2012-08-28 15:47:10 +0000
+++ lib/lp/registry/javascript/sharing/pillarsharingview.js	2012-08-30 02:55:23 +0000
@@ -434,7 +434,9 @@
                 self.perform_remove_grantee(delete_link, person_uri);
             },
             form_content: confirm_text,
-            headerContent: '<h2>Stop sharing</h2>'
+            headerContent: '<h2>Stop sharing</h2>',
+            submit_text: 'Yes',
+            cancel_text: 'No'
         });
         co.show();
     },

=== modified file 'lib/lp/registry/javascript/sharing/sharingdetailsview.js'
--- lib/lp/registry/javascript/sharing/sharingdetailsview.js	2012-08-24 05:09:51 +0000
+++ lib/lp/registry/javascript/sharing/sharingdetailsview.js	2012-08-30 02:55:23 +0000
@@ -135,7 +135,9 @@
                     delete_link, artifact_uri, artifact_type);
             },
             form_content: confirm_text,
-            headerContent: '<h2>Stop sharing</h2>'
+            headerContent: '<h2>Stop sharing</h2>',
+            submit_text: 'Yes',
+            cancel_text: 'No'
         });
         co.show();
     },

=== modified file 'lib/lp/registry/javascript/sharing/tests/test_granteepicker.js'
--- lib/lp/registry/javascript/sharing/tests/test_granteepicker.js	2012-08-14 16:20:28 +0000
+++ lib/lp/registry/javascript/sharing/tests/test_granteepicker.js	2012-08-30 02:55:23 +0000
@@ -134,9 +134,8 @@
                 });
             });
             // There should be a link back to previous step.
-            Y.Assert.isNotNull(step_two_content.one('a.prev'));
+            Y.Assert.isNotNull(step_two_content.one('button.prev'));
             // There should be a button and link to finalise the selection.
-            Y.Assert.isNotNull(step_two_content.one('a.next'));
             Y.Assert.isNotNull(step_two_content.one('button.next'));
         },
 
@@ -207,11 +206,11 @@
                     }
                 });
             });
-            // Back link should not he shown
-            var back_link = cb.one('a.prev');
-            Y.Assert.isNull(back_link);
+            // Back button should not he shown
+            var back_button = cb.one('button.prev');
+            Y.Assert.isNull(back_button);
             // When submit is clicked, the correct person uri is used.
-            var select_link = cb.one('a.next');
+            var select_link = cb.one('button.next');
             select_link.simulate('click');
             Y.Assert.areEqual('~/fred', selected_result.api_uri);
         },
@@ -265,9 +264,9 @@
                 check_permission_node);
         },
 
-        // Test that the back link goes back to step one when step two is
+        // Test that the back button goes back to step one when step two is
         // active.
-        test_second_step_back_link: function() {
+        test_second_step_back_button: function() {
             this.picker = this._create_picker();
             // Select a person to trigger transition to next step.
             this.picker.set('results', this.vocabulary);
@@ -276,8 +275,8 @@
                 '.yui3-picker-results li:nth-child(1)').simulate('click');
             var cb = this.picker.get('contentBox');
             var step_two_content = cb.one('.picker-content-two');
-            var back_link = step_two_content.one('a.prev');
-            back_link.simulate('click');
+            var back_button = step_two_content.one('button.prev');
+            back_button.simulate('click');
             // The progress should be 50%
             Y.Assert.areEqual(50, this.picker.get('progress'));
             // The first step ui should be visible.
@@ -316,8 +315,8 @@
             step_two_content
                 .one('input[name="field.permission.P2"][value="ALL"]')
                 .simulate('click');
-            var select_link = step_two_content.one('a.next');
-            select_link.simulate('click');
+            var select_button = step_two_content.one('button.next');
+            select_button.simulate('click');
             Y.Assert.areEqual(
                 3, Y.Object.size(selected_result.selected_permissions));
             Y.Assert.areEqual(
@@ -347,8 +346,8 @@
                 '.yui3-picker-results li:nth-child(1)').simulate('click');
             var cb = this.picker.get('contentBox');
             var step_two_content = cb.one('.picker-content-two');
-            var back_link = step_two_content.one('a.prev');
-            back_link.simulate('click');
+            var back_button = step_two_content.one('button.prev');
+            back_button.simulate('click');
             // Select a different person.
             this.picker.get('boundingBox').one(
                 '.yui3-picker-results li:nth-child(2)').simulate('click');
@@ -356,8 +355,8 @@
             step_two_content
                 .one('input[name="field.permission.P2"][value="ALL"]')
                 .simulate('click');
-            var select_link = step_two_content.one('a.next');
-            select_link.simulate('click');
+            var select_button = step_two_content.one('button.next');
+            select_button.simulate('click');
             // Check the results.
             Y.Assert.areEqual(
                 3, Y.Object.size(selected_result.selected_permissions));
@@ -390,31 +389,31 @@
             });
             var cb = this.picker.get('contentBox');
             // Check when first showing the picker.
-            cb.all('a.next', function(link) {
-                Y.Assert.isTrue(link.hasClass('invalid-link'));
+            cb.all('.next', function(button) {
+                Y.Assert.isTrue(button.get('disabled'));
             });
-            // Check that save is not called even if link is clicked.
-            var select_link = cb.one('a.next');
-            select_link.simulate('click');
+            // Check that save is not called even if button is clicked.
+            var select_button = cb.one('button.next');
+            select_button.simulate('click');
             Y.Assert.isFalse(save_called);
-            // Select one info type and check submit links are enabled.
+            // Select one info type and check submit button is enabled.
             cb.one('input[name="field.permission.P1"][value="ALL"]')
                 .simulate('click');
-            cb.all('a.next', function(link) {
-                Y.Assert.isFalse(link.hasClass('invalid-link'));
+            cb.all('button.next', function(button) {
+                Y.Assert.isFalse(button.get('disabled'));
             });
-            // De-select info type and submit links are disabled again.
+            // De-select info type and submit button is disabled again.
             cb.one('input[name="field.permission.P1"][value="NOTHING"]')
                 .simulate('click');
-            cb.all('a.next', function(link) {
-                Y.Assert.isTrue(link.hasClass('invalid-link'));
+            cb.all('button.next', function(button) {
+                Y.Assert.isTrue(button.get('disabled'));
             });
-            select_link.simulate('click');
+            select_button.simulate('click');
             Y.Assert.isFalse(save_called);
             // Once at least one info type is selected, save is called.
             cb.one('input[name="field.permission.P1"][value="ALL"]')
                 .simulate('click');
-            select_link.simulate('click');
+            select_button.simulate('click');
             Y.Assert.isTrue(save_called);
         }
     }));

=== modified file 'lib/lp/registry/javascript/structural-subscription.js'
--- lib/lp/registry/javascript/structural-subscription.js	2012-08-07 06:57:53 +0000
+++ lib/lp/registry/javascript/structural-subscription.js	2012-08-30 02:55:23 +0000
@@ -24,8 +24,7 @@
     ;
 
 var cancel_button_html =
-    '<button type="button" name="field.actions.cancel" ' +
-    'class="lazr-neg lazr-btn" >Cancel</button>';
+    '<button type="button" name="field.actions.cancel" >Cancel</button>';
 
 namespace.lp_client = undefined;
 
@@ -1164,8 +1163,7 @@
     clear_overlay(content_node, true);
     var submit_button = Y.Node.create(
             '<button type="submit" name="field.actions.create" ' +
-                'value="Save Changes" class="lazr-pos lazr-btn" ' +
-                '>OK</button>');
+                'value="Save Changes">Save</button>');
 
     var context = {
         filter_info: filter_info,
@@ -1597,7 +1595,8 @@
     if (filter.information_types.length !== 0) {
         filter_items.push(Y.Node.create('<li></li>')
             .set('text',
-                'are of information type: ' + filter.information_types.join(', ')));
+                'are of information type: ' +
+                filter.information_types.join(', ')));
     }
 
     // Format tag conditions.
@@ -1862,8 +1861,7 @@
 
     var submit_button = Y.Node.create(
         '<button type="submit" name="field.actions.create" ' +
-        'value="Create subscription" class="lazr-pos lazr-btn" '+
-        '>OK</button>');
+        'value="Create subscription">Create</button>');
 
     var success_callback = make_add_subscription_success_handler(config);
 

=== modified file 'lib/lp/translations/javascript/sourcepackage_sharing_details.js'
--- lib/lp/translations/javascript/sourcepackage_sharing_details.js	2012-07-07 14:00:30 +0000
+++ lib/lp/translations/javascript/sourcepackage_sharing_details.js	2012-08-30 02:55:23 +0000
@@ -136,12 +136,11 @@
 function create_form_overlay(title_html, submit_callback){
     var submit_button = Y.Node.create(
         '<button type="submit" name="field.actions.create" ' +
-        'value="Save Changes" class="lazr-pos lazr-btn" ' +
-        '>OK</button>'
+        'value="Save Changes">Save</button>'
         );
     var cancel_button = Y.Node.create(
         '<button type="button" name="field.actions.cancel" ' +
-        'class="lazr-neg lazr-btn" >Cancel</button>'
+        '>Cancel</button>'
         );
     function hide_and_callback(){
         form_overlay.hide();


Follow ups