← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~thumper/launchpad/lp-client-yui-module into lp:launchpad

 

Tim Penhey has proposed merging lp:~thumper/launchpad/lp-client-yui-module into lp:launchpad with lp:~thumper/launchpad/lp-client-cache-move as a prerequisite.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #724004 client cache gets out of date
  https://bugs.launchpad.net/bugs/724004

For more details, see:
https://code.launchpad.net/~thumper/launchpad/lp-client-yui-module/+merge/51038
-- 
https://code.launchpad.net/~thumper/launchpad/lp-client-yui-module/+merge/51038
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~thumper/launchpad/lp-client-yui-module into lp:launchpad.
=== modified file 'lib/canonical/launchpad/javascript/client/client.js'
--- lib/canonical/launchpad/javascript/client/client.js	2011-02-24 00:11:15 +0000
+++ lib/canonical/launchpad/javascript/client/client.js	2011-02-24 00:11:15 +0000
@@ -6,18 +6,16 @@
   links: {}
 };
 
-YUI({
-    bootstrap: false,
-    fetchCSS: false,
-    combine: false,
-    timeout: 50
-}).use("attribute", "io-base", "json-parse", "json-stringify", function(Y) {
-
-LP.client.HTTP_CREATED = 201;
-LP.client.HTTP_SEE_ALSO = 303;
-LP.client.HTTP_NOT_FOUND = 404;
-
-LP.client.XHTML = 'application/xhtml+xml';
+
+YUI.add('lp.client', function(Y) {
+
+module = Y.namespace('lp.client');
+
+module.HTTP_CREATED = 201;
+module.HTTP_SEE_ALSO = 303;
+module.HTTP_NOT_FOUND = 404;
+
+module.XHTML = 'application/xhtml+xml';
 
 /* Log the normal attributes accessible via o[key], and if it is a
  * YUI node, log all of the attributes accessible via o.get(key).
@@ -27,7 +25,7 @@
  * @param o The object being logged.
  * @param {String} name An optional name to describe the object.
  */
-LP.log_object = function(o, name) {
+module.log_object = function(o, name) {
     var result;
     var format = function(value) {
         if (typeof value == 'string') {
@@ -86,7 +84,7 @@
 };
 
 // Generally useful functions.
-LP.client.append_qs = function(qs, key, value) {
+module.append_qs = function(qs, key, value) {
     /* Append a key-value pair to a query string. */
     if (qs === undefined) {
         qs = "";
@@ -98,7 +96,7 @@
     return qs;
 };
 
-LP.client.normalize_uri = function(uri) {
+module.normalize_uri = function(uri) {
     /* Converts an absolute URI into a relative URI.
 
        Appends the root to a relative URI that lacks the root.
@@ -138,10 +136,10 @@
  * @param {String} uri
  * @return {String} URI.
  */
-LP.client.get_absolute_uri = function(uri) {
+module.get_absolute_uri = function(uri) {
     var location = document.location;
 
-    uri = LP.client.normalize_uri(uri);
+    uri = module.normalize_uri(uri);
     return location.protocol + '//' + location.host + uri;
 };
 
@@ -152,8 +150,8 @@
  * @param {String} field_name
  * @return {String} URI
  */
-LP.client.get_field_uri = function(base_uri, field_name) {
-    base_uri = LP.client.normalize_uri(base_uri);
+module.get_field_uri = function(base_uri, field_name) {
+    base_uri = module.normalize_uri(base_uri);
     field_name = escape(field_name);
     if (base_uri.charAt(base_uri.length - 1) == '/') {
         return base_uri + field_name;
@@ -162,7 +160,7 @@
     }
 };
 
-LP.client.add_accept = function(config, headers) {
+module.add_accept = function(config, headers) {
     if (headers === undefined) {
         headers = {};
     }
@@ -171,25 +169,25 @@
     return headers;
 };
 
-LP.client.start_and_size = function(data, start, size) {
+module.start_and_size = function(data, start, size) {
     /* Create a query string with values for ws.start and/or ws.size. */
     if (start !== undefined) {
-        data = LP.client.append_qs(data, "ws.start", start);
+        data = module.append_qs(data, "ws.start", start);
     }
     if (size !== undefined) {
-        data = LP.client.append_qs(data, "ws.size", size);
+        data = module.append_qs(data, "ws.size", size);
     }
     return data;
 };
 
-LP.client.wrap_resource_on_success = function(ignore, response, args) {
+module.wrap_resource_on_success = function(ignore, response, args) {
     var client = args[0];
     var uri = args[1];
     var old_on_success = args[2];
     var representation, wrapped;
     if (old_on_success) {
         var media_type = response.getResponseHeader('Content-Type');
-        if (media_type == 'application/json') {
+        if (media_type.substring(0,16) == 'application/json') {
             representation = Y.JSON.parse(response.responseText);
             wrapped = client.wrap_resource(uri, representation);
             return old_on_success(wrapped);
@@ -204,7 +202,7 @@
 
 // A hosted file resource.
 
-LP.client.HostedFile = function(client, uri, content_type, contents) {
+var HostedFile = function(client, uri, content_type, contents) {
     /* A binary file manipulable through the web service. */
     this.lp_client = client;
     this.uri = uri;
@@ -212,7 +210,7 @@
     this.contents = contents;
 };
 
-LP.client.HostedFile.prototype = {
+HostedFile.prototype = {
 
     'lp_save' : function(config) {
         /* Write a new version of this file back to the web service. */
@@ -227,7 +225,7 @@
                         "Content-Disposition": disposition},
             'arguments': args,
             'data': hosted_file.contents};
-        Y.io(LP.client.normalize_uri(hosted_file.uri), y_config);
+        Y.io(module.normalize_uri(hosted_file.uri), y_config);
     },
 
     'lp_delete' : function(config) {
@@ -241,10 +239,12 @@
     }
 };
 
-LP.client.Resource = function() {
+module.HostedFile = HostedFile;
+
+var Resource = function() {
     /* The base class for objects retrieved from Launchpad's web service. */
 };
-LP.client.Resource.prototype = {
+Resource.prototype = {
     'init': function(client, representation, uri) {
         /* Initialize a resource with its representation and URI. */
         this.lp_client = client;
@@ -281,9 +281,9 @@
         on.failure = function(ignore, response, args) {
             var client = args[0];
             var original_url = args[1];
-            if (response.status == LP.client.HTTP_NOT_FOUND ||
-                response.status == LP.client.HTTP_SEE_ALSO) {
-                var file = new LP.client.HostedFile(client, original_url);
+            if (response.status == module.HTTP_NOT_FOUND ||
+                response.status == module.HTTP_SEE_ALSO) {
+                var file = new HostedFile(client, original_url);
                 return on_success(file);
             } else if (old_on_failure !== undefined) {
                 return old_on_failure(ignore, response, args);
@@ -305,27 +305,30 @@
     }
 };
 
+module.Resource = Resource;
+
+
 // The service root resource.
-LP.client.Root = function(client, representation, uri) {
+module.Root = function(client, representation, uri) {
     /* The root of the Launchpad web service. */
     this.init(client, representation, uri);
 };
-LP.client.Root.prototype = new LP.client.Resource();
-
-LP.client.Collection = function(client, representation, uri) {
+module.Root.prototype = new Resource();
+
+
+var Collection = function(client, representation, uri) {
     /* A grouped collection of objets from the Launchpad web service. */
     var index, entry;
     this.init(client, representation, uri);
     for (index = 0 ; index < this.entries.length ; index++) {
         entry = this.entries[index];
-        this.entries[index] = new LP.client.Entry(client, 
-        	entry, entry.self_link);
+        this.entries[index] = new Entry(client, entry, entry.self_link);
     }
 };
 
-LP.client.Collection.prototype = new LP.client.Resource();
+Collection.prototype = new Resource();
 
-LP.client.Collection.prototype.lp_slice = function(on, start, size) {
+Collection.prototype.lp_slice = function(on, start, size) {
     /* Retrieve a subset of the collection.
 
        :param start: Where in the collection to start serving entries.
@@ -335,8 +338,9 @@
                               {on: on, start: start, size: size});
 };
 
+module.Collection = Collection;
 
-LP.client.Entry = function(client, representation, uri) {
+var Entry = function(client, representation, uri) {
     /* A single object from the Launchpad web service. */
     this.lp_client = client;
     this.lp_original_uri = uri;
@@ -353,19 +357,19 @@
     }
 };
 
-LP.client.Entry.prototype = new LP.client.Resource();
+Entry.prototype = new Resource();
 
 // Augment with Attribute so that we can listen for attribute change events.
-Y.augment(LP.client.Entry, Y.Attribute);
+Y.augment(Entry, Y.Attribute);
 
-LP.client.Entry.prototype.mark_as_dirty = function(event) {
+Entry.prototype.mark_as_dirty = function(event) {
     /* Respond to an event triggered by modification to an Entry's field. */
     if (event.newVal != event.prevVal) {
         this.dirty_attributes.push(event.attrName);
     }
 };
 
-LP.client.Entry.prototype.lp_save = function(config) {
+Entry.prototype.lp_save = function(config) {
     /* Write modifications to this entry back to the web service. */
     var on = config.on;
     var representation = {};
@@ -377,41 +381,42 @@
     if (this.get('http_etag') !== undefined) {
         headers['If-Match'] = this.get('http_etag');
     }
-    var uri = LP.client.normalize_uri(this.get('self_link'));
+    var uri = module.normalize_uri(this.get('self_link'));
     this.lp_client.patch(uri, representation, config, headers);
     this.dirty_attributes = [];
 };
 
-LP.client.Entry.prototype.lookup_value = function(key) {
+Entry.prototype.lookup_value = function(key) {
     /* A common getter interface between Entrys and non-Entrys. */
     return this.get(key);
 };
 
+module.Entry = Entry;
 
 // The Launchpad client itself.
 
-LP.client.Launchpad = function() {
+var Launchpad = function() {
     /* A client that makes HTTP requests to Launchpad's web service. */
 };
 
-LP.client.Launchpad.prototype = {
+Launchpad.prototype = {
     'get': function (uri, config) {
         /* Get the current state of a resource. */
         var on = Y.merge(config.on);
         var start = config.start;
         var size = config.size;
         var data = config.data;
-        var headers = LP.client.add_accept(config);
-        uri = LP.client.normalize_uri(uri);
+        var headers = module.add_accept(config);
+        uri = module.normalize_uri(uri);
         if (data === undefined) {
             data = "";
         }
         if (start !== undefined || size !== undefined) {
-            data = LP.client.start_and_size(data, start, size);
+            data = module.start_and_size(data, start, size);
         }
 
         var old_on_success = on.success;
-        on.success = LP.client.wrap_resource_on_success;
+        on.success = module.wrap_resource_on_success;
         var client = this;
         var y_config = { on: on,
                          'arguments': [client, uri, old_on_success],
@@ -423,10 +428,10 @@
     'named_get' : function(uri, operation_name, config) {
         /* Retrieve the value of a named GET operation on the given URI. */
         var parameters = config.parameters;
-        var data = LP.client.append_qs("", "ws.op", operation_name);
+        var data = module.append_qs("", "ws.op", operation_name);
         for (name in parameters) {
             if (parameters.hasOwnProperty(name)) {
-                data = LP.client.append_qs(data, name, parameters[name]);
+                data = module.append_qs(data, name, parameters[name]);
             }
         }
         config.data = data;
@@ -437,18 +442,18 @@
         /* Perform a named POST operation on the given URI. */
         var on = Y.merge(config.on);
         var parameters = config.parameters;
-        uri = LP.client.normalize_uri(uri);
-        var data = LP.client.append_qs(data, "ws.op", operation_name);
+        uri = module.normalize_uri(uri);
+        var data = module.append_qs(data, "ws.op", operation_name);
         for (name in parameters) {
             if (parameters.hasOwnProperty(name)) {
-                data = LP.client.append_qs(data, name, parameters[name]);
+                data = module.append_qs(data, name, parameters[name]);
             }
         }
 
         var old_on_success = on.success;
 
         on.success = function(unknown, response, args) {
-            if (response.status == LP.client.HTTP_CREATED) {
+            if (response.status == module.HTTP_CREATED) {
                 // A new object was created as a result of the operation.
                 // Get that object and run the callback on it instead.
                 var new_location = response.getResponseHeader("Location");
@@ -456,7 +461,7 @@
                                   { on: { success: old_on_success,
                                               failure: on.failure } });
             }
-            return LP.client.wrap_resource_on_success(undefined, response, args);
+            return module.wrap_resource_on_success(undefined, response, args);
         };
         var client = this;
         var y_config = { method: "POST",
@@ -469,10 +474,10 @@
     'patch': function(uri, representation, config, headers) {
         var on = config.on;
         var data = Y.JSON.stringify(representation);
-        uri = LP.client.normalize_uri(uri);
+        uri = module.normalize_uri(uri);
 
         var old_on_success = on.success;
-        on.success = LP.client.wrap_resource_on_success;
+        on.success = module.wrap_resource_on_success;
         args = [this, uri, old_on_success];
 
         var extra_headers = {
@@ -487,7 +492,7 @@
                 }
             }
         }
-        extra_headers = LP.client.add_accept(config, extra_headers);
+        extra_headers = module.add_accept(config, extra_headers);
 
         var y_config = {
             'method': "POST",
@@ -514,27 +519,101 @@
                 || representation.total_size_link !== undefined) {
                 // It's a list. Treat it as a collection;
                 // it should be slicable.
-                return new LP.client.Collection(this, representation, uri);
+                return new Collection(this, representation, uri);
             } else {
                 // It's a random JSON object. Leave it alone.
                 return representation;
             }
         } else if (representation.resource_type_link.search(
             /\/#service-root$/) !== -1) {
-            return new LP.client.Root(this, representation, uri);
+            return new Root(this, representation, uri);
         } else if (representation.total_size === undefined) {
-            return new LP.client.Entry(this, representation, uri);
+            return new Entry(this, representation, uri);
         } else {
-            return new LP.client.Collection(this, representation, uri);
+            return new Collection(this, representation, uri);
         }
     }
 };
-});
+
+module.Launchpad = Launchpad;
+
+
+/**
+ * Helper object for handling XHR failures.
+ * clearProgressUI() and showError() need to be defined by the callsite
+ * using this object.
+ *
+ * @class ErrorHandler
+ */
+var ErrorHandler = function () {
+};
+
+ErrorHandler.prototype = {
+    /**
+     * Clear the progress indicator.
+     *
+     * The default implementation does nothing. Override this to provide
+     * an implementation to remove the UI elements used to indicate
+     * progress. After this method is called, the UI should be ready for
+     * repeating the interaction, allowing the user to retry submitting
+     * the data.
+     *
+     * @method clearProgressUI
+     */
+    clearProgressUI: function () {},
+
+    /**
+     * Show the error message to the user.
+     *
+     * The default implementation does nothing. Override this to provide
+     * an implementation to display the UI elements containing the error
+     * message.
+     *
+     * @method showError
+     * @param error_msg The error text to display.
+     */
+    showError: function (error_msg) {},
+
+    /**
+     * Return a failure handler function for XHR requests.
+     *
+     * Assign the result of this function as the failure handler when
+     * doing an XHR request using the API client.
+     *
+     * @method getFailureHandler
+     */
+    getFailureHandler: function () {
+        var self = this;
+        return function(ioId, o) {
+            self.clearProgressUI();
+            // If it was a timeout...
+            if (o.status == 503) {
+                self.showError(
+                    'Timeout error, please try again in a few minutes.');
+            // If it was a server error...
+            } else if (o.status >= 500) {
+                var server_error = 'Server error, please contact an administrator.';
+                if (o.getResponseHeader('X-Lazr-OopsId')) {
+                    server_error = server_error + ' OOPS ID:' + o.getResponseHeader('X-Lazr-OOPSid');
+                }
+                self.showError(server_error);
+            // Otherwise we send some sane text as an error
+            } else {
+                self.showError(o.responseText);
+            }
+        };
+    }
+};
+
+module.ErrorHandler = ErrorHandler;
+
+}, "0.1" ,{"requires":["attribute", "io", "json-parse", "json-stringify"]});
+
 
 YUI.add('lp.client.plugins', function (Y) {
 
 /**
- * A collection of plugins to hook LP.client into widgets.
+ * A collection of plugins to hook lp.client into widgets.
  *
  * @module lp.client.plugins
  */
@@ -620,78 +699,10 @@
         }
 }});
 
-/**
- * Helper object for handling XHR failures.
- * clearProgressUI() and showError() need to be defined by the callsite
- * using this object.
- *
- * @class ErrorHandler
- */
-LP.client.ErrorHandler = function () {
-
-};
-LP.client.ErrorHandler.prototype = {
-    /**
-     * Clear the progress indicator.
-     *
-     * The default implementation does nothing. Override this to provide
-     * an implementation to remove the UI elements used to indicate
-     * progress. After this method is called, the UI should be ready for
-     * repeating the interaction, allowing the user to retry submitting
-     * the data.
-     *
-     * @method clearProgressUI
-     */
-    clearProgressUI: function () {},
-
-    /**
-     * Show the error message to the user.
-     *
-     * The default implementation does nothing. Override this to provide
-     * an implementation to display the UI elements containing the error
-     * message.
-     *
-     * @method showError
-     * @param error_msg The error text to display.
-     */
-    showError: function (error_msg) {},
-
-    /**
-     * Return a failure handler function for XHR requests.
-     *
-     * Assign the result of this function as the failure handler when
-     * doing an XHR request using the API client.
-     *
-     * @method getFailureHandler
-     */
-    getFailureHandler: function () {
-        var self = this;
-        return function (ioId, o) {
-            self.clearProgressUI();
-            // If it was a timeout...
-            if(o.status == 503) {
-                self.showError(
-                    'Timeout error, please try again in a few minutes.');
-            // If it was a server error...
-            } else if(o.status >= 500) {
-                var server_error = 'Server error, please contact an administrator.';
-                if(o.getResponseHeader('X-Lazr-OopsId')) {
-                    server_error = server_error + ' OOPS ID:' + o.getResponseHeader('X-Lazr-OOPSid');
-                }
-                self.showError(server_error);
-            // Otherwise we send some sane text as an error
-            } else {
-                self.showError(o.responseText);
-            }
-        };
-    }
-};
-
-
 Y.extend(PATCHPlugin, Y.Plugin.Base, {
 
     /**
-     * Configuration parameters that will be passed through to the LP.client
+     * Configuration parameters that will be passed through to the lp.client
      * call.
      *
      * @property extra_config
@@ -716,7 +727,7 @@
         }
 
         // Save the config object that the user passed in so that we can pass
-        // any extra parameters through to the LP.client constructor.
+        // any extra parameters through to the lp.client constructor.
         this.extra_config = config || {};
 
         // Save a reference to the original _saveData()
@@ -730,7 +741,7 @@
         this.doBefore("_saveData", this.doPATCH);
 
         var self = this;
-        this.error_handler = new LP.client.ErrorHandler();
+        this.error_handler = new Y.lp.client.ErrorHandler();
         this.error_handler.clearProgressUI = function () {
             config.host._uiClearWaiting();
         };
@@ -757,7 +768,7 @@
         // Set the widget in 'waiting' state.
         owner._uiSetWaiting();
 
-        var client =  new LP.client.Launchpad();
+        var client =  new Y.lp.client.Launchpad();
         var formatter = Y.bind(this.get('formatter'), this);
         var attribute = this.get('patch');
 
@@ -816,4 +827,4 @@
 Y.namespace('lp.client.plugins');
 Y.lp.client.plugins.PATCHPlugin = PATCHPlugin;
 
-}, "0.1", {"requires": ["plugin", "dump", "lazr.editor"]});
+  }, "0.1", {"requires": ["plugin", "dump", "lazr.editor", "lp.client"]});

=== modified file 'lib/lp/app/javascript/comment.js'
--- lib/lp/app/javascript/comment.js	2011-02-24 00:11:15 +0000
+++ lib/lp/app/javascript/comment.js	2011-02-24 00:11:15 +0000
@@ -21,8 +21,8 @@
     initializer: function() {
         this.submit_button = this.get_submit();
         this.comment_input = Y.one('[id="field.comment"]');
-        this.lp_client = new LP.client.Launchpad();
-        this.error_handler = new LP.client.ErrorHandler();
+        this.lp_client = new Y.lp.client.Launchpad();
+        this.error_handler = new Y.lp.client.ErrorHandler();
         this.error_handler.clearProgressUI = bind(this.clearProgressUI, this);
         this.error_handler.showError = bind(function (error_msg) {
             Y.lp.app.errors.display_error(this.submit_button, error_msg);
@@ -125,7 +125,7 @@
             on: {
                 success: callback
             },
-            accept: LP.client.XHTML
+            accept: Y.lp.client.XHTML
         };
         // Randomize the URL to fake out bad XHR caching.
         var randomness = '?' + Math.random();
@@ -317,7 +317,7 @@
      */
     reply_clicked: function(e){
         e.halt();
-        var reply_link = LP.client.normalize_uri(e.target.get('href'));
+        var reply_link = Y.lp.client.normalize_uri(e.target.get('href'));
         var root_url = reply_link.substr(0,
             reply_link.length - '+reply'.length);
         var object_url = '/api/devel' + root_url;
@@ -425,4 +425,5 @@
 });
 namespace.CodeReviewComment = CodeReviewComment;
 
-}, "0.1" ,{"requires":["oop", "io", "widget", "node", "lp.client.plugins", "lp.app.errors"]});
+}, "0.1" ,{"requires":["oop", "io", "widget", "node", "lp.client",
+                       "lp.client.plugins", "lp.app.errors"]});

=== modified file 'lib/lp/app/javascript/lp-links.js'
--- lib/lp/app/javascript/lp-links.js	2010-11-12 13:01:34 +0000
+++ lib/lp/app/javascript/lp-links.js	2011-02-24 00:11:15 +0000
@@ -67,7 +67,7 @@
         // Get the final json to send
         var json_link_info = Y.JSON.stringify(links_to_check);
         var qs = '';
-        qs = LP.client.append_qs(qs, 'link_hrefs', json_link_info);
+        qs = Y.lp.client.append_qs(qs, 'link_hrefs', json_link_info);
 
         var config = {
             on: {
@@ -99,7 +99,5 @@
         Y.io(uri, y_config);
     };
 
-}, "0.1", {"requires": [
-    "base", "node", "io", "dom", "json"
-    ]});
+}, "0.1", {"requires": ["base", "node", "io", "dom", "json", "lp.client"]});
 

=== modified file 'lib/lp/app/javascript/picker.js'
--- lib/lp/app/javascript/picker.js	2011-02-24 00:11:15 +0000
+++ lib/lp/app/javascript/picker.js	2011-02-24 00:11:15 +0000
@@ -39,8 +39,8 @@
     var remove_button_text = 'Remove';
     var null_display_value = 'None';
     var show_search_box = true;
-    resource_uri = LP.client.normalize_uri(resource_uri)
-    var full_resource_uri = LP.client.get_absolute_uri(resource_uri);
+    resource_uri = Y.lp.client.normalize_uri(resource_uri)
+    var full_resource_uri = Y.lp.client.get_absolute_uri(resource_uri);
     var current_context_uri = LP.cache['context']['self_link'];
     var editing_main_context = (full_resource_uri == current_context_uri);
 
@@ -140,10 +140,10 @@
         };
 
         var patch_payload = {};
-        patch_payload[attribute_name] = LP.client.get_absolute_uri(
+        patch_payload[attribute_name] = Y.lp.client.get_absolute_uri(
             picker_result.api_uri);
 
-        var client = new LP.client.Launchpad();
+        var client = new Y.lp.client.Launchpad();
         client.patch(picker._resource_uri, patch_payload, {
             accept: 'application/xhtml+xml',
             on: {
@@ -173,7 +173,7 @@
         var patch_payload = {};
         patch_payload[attribute_name] = null;
 
-        var client = new LP.client.Launchpad();
+        var client = new Y.lp.client.Launchpad();
         // Use picker._resource_uri, since it might have been changed
         // from the outside after the widget has already been initialized.
         client.patch(picker._resource_uri, patch_payload, {
@@ -294,7 +294,7 @@
         var search_text = e.details[0];
         var selected_batch = e.details[1] || 0;
         var start = BATCH_SIZE * selected_batch;
-        var client = new LP.client.Launchpad();
+        var client = new Y.lp.client.Launchpad();
 
         var success_handler = function (ignore, response, args) {
             var entry = Y.JSON.parse(response.responseText);
@@ -331,10 +331,10 @@
         };
 
         var qs = '';
-        qs = LP.client.append_qs(qs, 'name', vocabulary);
-        qs = LP.client.append_qs(qs, 'search_text', search_text);
-        qs = LP.client.append_qs(qs, 'batch', BATCH_SIZE);
-        qs = LP.client.append_qs(qs, 'start', start);
+        qs = Y.lp.client.append_qs(qs, 'name', vocabulary);
+        qs = Y.lp.client.append_qs(qs, 'search_text', search_text);
+        qs = Y.lp.client.append_qs(qs, 'batch', BATCH_SIZE);
+        qs = Y.lp.client.append_qs(qs, 'start', start);
 
         // The uri needs to be relative, so that the vocabulary
         // has the same context as the form. Some vocabularies
@@ -364,5 +364,5 @@
 
 }, "0.1", {"requires": [
     "io", "dom", "dump", "lazr.picker", "lazr.activator", "json-parse",
-    "lp.client.helpers"
+    "lp.client"
     ]});

=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
--- lib/lp/app/templates/base-layout-macros.pt	2011-02-24 00:11:15 +0000
+++ lib/lp/app/templates/base-layout-macros.pt	2011-02-24 00:11:15 +0000
@@ -167,15 +167,25 @@
                    '${links/?key/fmt:api_url}';">
     </script>
     <script tal:repeat="key objects"
-      tal:content="string:LP.cache['${key}'] =
+      tal:content="structure string:LP.cache['${key}'] =
                    ${objects/?key/webservice:json};">
     </script>
   </tal:cache>
 
   <script tal:condition="context/webservice:is_entry"
-    tal:content="string:LP.cache['context'] =
+    tal:content="structure string:LP.cache['context'] =
                  ${context/webservice:json};">
   </script>
+
+  <script tal:content='structure string:
+  LPS.use(function(Y) {
+    Y.on("lp:context:changed", function(fields_changed, entry) {
+      if (Y.Array.indexOf(fields_changed, "web_link") >= 0) {
+        window.location = entry.get("web_link");
+      }
+    });
+  });'/>
+
 </metal:lp-client-cache>
 
 

=== modified file 'lib/lp/bugs/javascript/bug_tags_entry.js'
--- lib/lp/bugs/javascript/bug_tags_entry.js	2011-02-24 00:11:15 +0000
+++ lib/lp/bugs/javascript/bug_tags_entry.js	2011-02-24 00:11:15 +0000
@@ -67,11 +67,11 @@
  * @method save_tags
  */
 var save_tags = function() {
-    var lp_client = new LP.client.Launchpad();
+    var lp_client = new Y.lp.client.Launchpad();
     var tags = Y.Array(
         Y.Lang.trim(tag_input.get(VALUE)).split(new RegExp('\\s+'))).filter(
             function(elem) { return elem !== ''; });
-    var bug = new LP.client.Entry(
+    var bug = new Y.lp.client.Entry(
         lp_client, LP.cache[BUG], LP.cache[BUG].self_link);
     bug.removeAttr('http_etag');
     bug.set('tags', tags);
@@ -241,5 +241,6 @@
     });
 };
 }, "0.1", {"requires": ["base", "io-base", "node", "substitute", "node-menunav",
-                      "lazr.base", "lazr.anim", "lazr.autocomplete"]});
+                        "lazr.base", "lazr.anim", "lazr.autocomplete",
+                        "lp.client"]});
 

=== modified file 'lib/lp/bugs/javascript/bugtask_index.js'
--- lib/lp/bugs/javascript/bugtask_index.js	2011-02-24 00:11:15 +0000
+++ lib/lp/bugs/javascript/bugtask_index.js	2011-02-24 00:11:15 +0000
@@ -164,11 +164,11 @@
  * @method setup_client_and_bug
  */
 function setup_client_and_bug() {
-    lp_client = new LP.client.Launchpad();
+    lp_client = new Y.lp.client.Launchpad();
 
     if (bug_repr === undefined) {
         bug_repr = LP.cache.bug;
-        lp_bug_entry = new LP.client.Entry(
+        lp_bug_entry = new Y.lp.client.Entry(
             lp_client, bug_repr, bug_repr.self_link);
     }
 }
@@ -333,12 +333,12 @@
     privacy_spinner.setStyle('display', 'inline');
 
     if (lp_client === undefined) {
-        lp_client = new LP.client.Launchpad();
+        lp_client = new Y.lp.client.Launchpad();
     }
 
     if (lp_bug_entry === undefined) {
         var bug_repr = LP.cache.bug;
-        lp_bug_entry = new LP.client.Entry(
+        lp_bug_entry = new Y.lp.client.Entry(
             lp_client, bug_repr, bug_repr.self_link);
     }
 
@@ -348,7 +348,7 @@
 
     lp_bug_entry.set('private', private_flag);
     lp_bug_entry.set('security_related', security_related);
-    var error_handler = new LP.client.ErrorHandler();
+    var error_handler = new Y.lp.client.ErrorHandler();
     error_handler.clearProgressUI = function () {
         privacy_spinner.setStyle('display', 'none');
         privacy_link.setStyle('display', 'inline');
@@ -417,7 +417,7 @@
 function setup_link_branch_picker() {
     setup_client_and_bug();
 
-    var error_handler = new LP.client.ErrorHandler();
+    var error_handler = new Y.lp.client.ErrorHandler();
 
     error_handler.clearProgressUI = function () {
         link_branch_link.toggleClass('update-in-progress-message');
@@ -461,7 +461,7 @@
  *                        the Launchpad API.
  */
 function link_branch_to_bug(branch) {
-    var error_handler = new LP.client.ErrorHandler();
+    var error_handler = new Y.lp.client.ErrorHandler();
     error_handler.clearProgressUI = function () {
         link_branch_link.toggleClass('update-in-progress-message');
     };
@@ -485,7 +485,7 @@
                             add_branch_to_linked_branches(branch_html);
                         }
                     },
-                    accept: LP.client.XHTML
+                    accept: Y.lp.client.XHTML
                 };
                 lp_client.get(bug_branch_entry.get('self_link'), config);
             },
@@ -822,7 +822,7 @@
 Y.extend(MeTooChoiceSource, Y.ChoiceSource, {
     initializer: function() {
         var widget = this;
-        this.error_handler = new LP.client.ErrorHandler();
+        this.error_handler = new Y.lp.client.ErrorHandler();
         this.error_handler.clearProgressUI = function() {
             widget._uiClearWaiting();
         };
@@ -893,7 +893,7 @@
         this._uiSetWaiting();
 
         var value = this.getInput();
-        var client =  new LP.client.Launchpad();
+        var client =  new Y.lp.client.Launchpad();
         var widget = this;
 
         var config = {
@@ -939,5 +939,6 @@
                         "json-parse", "substitute", "widget-position-ext",
                         "lazr.formoverlay", "lazr.anim", "lazr.base",
                         "lazr.overlay", "lazr.choiceedit", "lp.app.picker",
+                        "lp.client",
                         "lp.client.plugins", "lp.bugs.bugtask_index.portlets",
                         "lp.bugs.subscriber", "lp.app.errors"]});

=== modified file 'lib/lp/bugs/javascript/bugtask_index_portlets.js'
--- lib/lp/bugs/javascript/bugtask_index_portlets.js	2011-02-24 00:11:15 +0000
+++ lib/lp/bugs/javascript/bugtask_index_portlets.js	2011-02-24 00:11:15 +0000
@@ -54,11 +54,11 @@
  * @method setup_client_and_bug
  */
 function setup_client_and_bug() {
-    lp_client = new LP.client.Launchpad();
+    lp_client = new Y.lp.client.Launchpad();
 
     if (bug_repr === undefined) {
         bug_repr = LP.cache.bug;
-        lp_bug_entry = new LP.client.Entry(
+        lp_bug_entry = new Y.lp.client.Entry(
             lp_client, bug_repr, bug_repr.self_link);
     }
 }
@@ -157,7 +157,7 @@
      * bugs:nameloaded and do the work here when the event fires.
      */
     namespace.portlet.subscribe('bugs:nameloaded', function(subscription) {
-        var error_handler = new LP.client.ErrorHandler();
+        var error_handler = new Y.lp.client.ErrorHandler();
         error_handler.clearProgressUI = function() {
             var temp_link = Y.one('#temp-username');
             if (temp_link) {
@@ -187,7 +187,7 @@
                 failure: error_handler.getFailureHandler()
             },
             parameters: {
-                person: LP.client.get_absolute_uri(
+                person: Y.lp.client.get_absolute_uri(
                     subscription.get('person').get('escaped_uri')),
                 suppress_notify: false
             }
@@ -413,7 +413,7 @@
         is_dupe = false;
     }
 
-    var error_handler = new LP.client.ErrorHandler();
+    var error_handler = new Y.lp.client.ErrorHandler();
     error_handler.clearProgressUI = function () {
         icon.set('src', '/@@/remove');
         // Grab the icon again to reset to click handler.
@@ -475,7 +475,7 @@
 
     if (!subscription.is_current_user_subscribing()) {
         config.parameters = {
-            person: LP.client.get_absolute_uri(user_uri)
+            person: Y.lp.client.get_absolute_uri(user_uri)
         };
     }
 
@@ -554,7 +554,7 @@
     var subscriber = subscription.get('subscriber');
     var bug_notification_level = subscription.get('bug_notification_level');
 
-    var error_handler = new LP.client.ErrorHandler();
+    var error_handler = new Y.lp.client.ErrorHandler();
     error_handler.clearProgressUI = function () {
         subscription.disable_spinner();
     };
@@ -600,7 +600,7 @@
         },
 
         parameters: {
-            person: LP.client.get_absolute_uri(subscriber.get('escaped_uri')),
+            person: Y.lp.client.get_absolute_uri(subscriber.get('escaped_uri')),
             suppress_notify: false,
             level: bug_notification_level
         }
@@ -619,7 +619,7 @@
     var subscription_link = subscription.get('link');
     var subscriber = subscription.get('subscriber');
 
-    var error_handler = new LP.client.ErrorHandler();
+    var error_handler = new Y.lp.client.ErrorHandler();
     error_handler.clearProgressUI = function () {
         subscription.disable_spinner();
     };
@@ -1034,7 +1034,7 @@
     });
     subscription.set('person', person);
 
-    var error_handler = new LP.client.ErrorHandler();
+    var error_handler = new Y.lp.client.ErrorHandler();
     error_handler.showError = function(error_msg) {
         Y.lp.app.errors.display_error(
            Y.one('.menu-link-addsubscriber'), error_msg);
@@ -1061,7 +1061,7 @@
  * @param subscription {Object} A Y.lp.bugs.subscriber.Subscription object.
  */
 function check_can_be_unsubscribed(subscription) {
-    var error_handler = new LP.client.ErrorHandler();
+    var error_handler = new Y.lp.client.ErrorHandler();
     error_handler.showError = function (error_msg) {
         Y.lp.app.errors.display_error(
            Y.one('.menu-link-addsubscriber'), error_msg);
@@ -1078,7 +1078,7 @@
                             var team_member = false;
                             for (var i=0; i<result.entries.length; i++) {
                                  if (result.entries[i].member_link ==
-                                    LP.client.get_absolute_uri(
+                                    Y.lp.client.get_absolute_uri(
                                         subscription.get(
                                             'subscriber').get('uri'))) {
                                     team_member = true;
@@ -1114,7 +1114,7 @@
             failure: error_handler.getFailureHandler()
         }
     };
-    lp_client.get(LP.client.get_absolute_uri(
+    lp_client.get(Y.lp.client.get_absolute_uri(
         subscription.get('person').get('escaped_uri')), config);
 }
 
@@ -1176,5 +1176,6 @@
                         "json-parse", "substitute", "widget-position-ext",
                         "lazr.formoverlay", "lazr.anim", "lazr.base",
                         "lazr.overlay", "lazr.choiceedit", "lp.app.picker",
+                        "lp.client",
                         "lp.client.plugins", "lp.bugs.subscriber",
                         "lp.app.errors"]});

=== modified file 'lib/lp/bugs/javascript/bugtracker_overlay.js'
--- lib/lp/bugs/javascript/bugtracker_overlay.js	2010-07-14 14:58:30 +0000
+++ lib/lp/bugs/javascript/bugtracker_overlay.js	2011-02-24 00:11:15 +0000
@@ -32,7 +32,7 @@
             next_step(entry);
         };
 
-        var client = new LP.client.Launchpad();
+        var client = new Y.lp.client.Launchpad();
         client.named_post('/bugs/bugtrackers', 'ensureBugTracker', {
             parameters: parameters,
             on: {
@@ -126,6 +126,6 @@
         config.activate_node.on('click', show_bugtracker_form);
     };
 
-}, "0.1", {"requires": [
-    "dom", "node", "io-base", "lazr.anim", "lazr.formoverlay", "lp.app.calendar"
+}, "0.1", {"requires": ["dom", "node", "io-base", "lazr.anim",
+                        "lazr.formoverlay", "lp.app.calendar", "lp.client"
     ]});

=== modified file 'lib/lp/bugs/javascript/subscriber.js'
--- lib/lp/bugs/javascript/subscriber.js	2011-02-24 00:11:15 +0000
+++ lib/lp/bugs/javascript/subscriber.js	2011-02-24 00:11:15 +0000
@@ -353,7 +353,7 @@
         } else {
             if (window.LP !== undefined &&
                 window.LP.links.me !== undefined) {
-                var client = new LP.client.Launchpad();
+                var client = new Y.lp.client.Launchpad();
                 this.get_display_name_from_api(client);
             }
         }
@@ -382,4 +382,4 @@
 
 namespace.Subscriber = Subscriber;
 
-}, "0.1", {"requires": ["base", "node"]});
+  }, "0.1", {"requires": ["base", "node", "lp.client"]});

=== modified file 'lib/lp/bugs/javascript/tests/test_bug_subscription_widget.js'
--- lib/lp/bugs/javascript/tests/test_bug_subscription_widget.js	2011-02-24 00:11:15 +0000
+++ lib/lp/bugs/javascript/tests/test_bug_subscription_widget.js	2011-02-24 00:11:15 +0000
@@ -7,7 +7,7 @@
     fetchCSS: false,
     }).use(
         'event', 'event-simulate', 'lazr.testing.mockio',
-        'lp.bugs.bug_subscription_wizard', 'node', 'test',
+        'lp.bugs.bug_subscription_wizard', 'lp.client', 'node', 'test',
         'widget-stack', 'console', 'log', function(Y) {
 
 // Local aliases
@@ -80,20 +80,18 @@
         // Monkeypatch LP to avoid network traffic and to make
         // some things work as expected.
         window.LP = {
-            client: {
-                // Empty client constructor.
-                Launchpad: function() {}
-            },
             links: {},
             cache: {}
         };
-        LP.client.Launchpad.prototype.named_post =
-            function(url, func, config) {
-                config.on.success();
-            };
         LP.cache.bug = {
             self_link: "http://bugs.example.com/bugs/1234";
         };
+        Y.lp.client.Launchpad = function() {}
+                // Empty client constructor.
+        Y.lp.client.Launchpad.prototype.named_post =
+          function(url, func, config) {
+            config.on.success();
+          };
 
         // Monkeypatch the subscribe_form_body attribute of the
         // wizard module so that the test doesn't cause the wizard to
@@ -154,17 +152,14 @@
         // Monkeypatch LP to avoid network traffic and to make
         // some things work as expected.
         window.LP = {
-            client: {
-                // Empty client constructor.
-                Launchpad: function() {}
-            },
             links: {},
             cache: {}
         };
-        LP.client.Launchpad.prototype.named_post =
-            function(url, func, config) {
-                config.on.success();
-            };
+        Y.lp.client.Launchpad = function() {}
+        Y.lp.client.Launchpad.prototype.named_post =
+          function(url, func, config) {
+            config.on.success();
+          };
         LP.cache.bug = {
             self_link: "http://bugs.example.com/bugs/1234";
         };

=== modified file 'lib/lp/bugs/javascript/tests/test_me_too.js'
--- lib/lp/bugs/javascript/tests/test_me_too.js	2011-02-24 00:11:15 +0000
+++ lib/lp/bugs/javascript/tests/test_me_too.js	2011-02-24 00:11:15 +0000
@@ -5,8 +5,8 @@
     filter: 'raw',
     combine: false,
     fetchCSS: false
-    }).use('event', 'lp.bugs.bugtask_index', 'node', 'test', 'widget-stack', 'console',
-        function(Y) {
+      }).use('event', 'lp.bugs.bugtask_index', 'lp.client', 'node',
+             'test', 'widget-stack', 'console', function(Y) {
 
 // Local aliases
 var Assert = Y.Assert,
@@ -30,10 +30,10 @@
     setUp: function() {
         // Monkeypatch LP to avoid network traffic and to make
         // some things work as expected.
-        LP.client.Launchpad.prototype.named_post =
-            function(url, func, config) {
-                config.on.success();
-            };
+        Y.lp.client.Launchpad.prototype.named_post =
+          function(url, func, config) {
+            config.on.success();
+          };
         LP.cache.bug = {
             self_link: "http://bugs.example.com/bugs/1234";
         };
@@ -143,7 +143,7 @@
         // assertions in this method because exceptions are swallowed
         // somewhere. Instead, we save something testable to a local
         // var.
-        LP.client.Launchpad.prototype.named_post =
+        Y.lp.client.Launchpad.prototype.named_post =
             function(url, func, config) {
                 edit_icon_src_during_save = edit_icon.get('src');
                 config.on[callback]();

=== modified file 'lib/lp/code/javascript/branch.bugspeclinks.js'
--- lib/lp/code/javascript/branch.bugspeclinks.js	2011-02-24 00:11:15 +0000
+++ lib/lp/code/javascript/branch.bugspeclinks.js	2011-02-24 00:11:15 +0000
@@ -22,7 +22,7 @@
  */
 namespace.connect_branchlinks = function() {
 
-    error_handler = new LP.client.ErrorHandler();
+    error_handler = new Y.lp.client.ErrorHandler();
     error_handler.clearProgressUI = function() {
         destroy_temporary_spinner();
     };
@@ -223,7 +223,7 @@
  */
 function set_up_lp_client() {
     if (lp_client === undefined) {
-        lp_client = new LP.client.Launchpad();
+        lp_client = new Y.lp.client.Launchpad();
     }
 }
 
@@ -254,4 +254,4 @@
 }
 
 }, "0.1", {"requires": ["base", "lazr.anim", "lazr.formoverlay",
-    "lp.client.plugins"]});
+                        "lp.client", "lp.client.plugins"]});

=== modified file 'lib/lp/code/javascript/branch.subscription.js'
--- lib/lp/code/javascript/branch.subscription.js	2011-02-24 00:11:15 +0000
+++ lib/lp/code/javascript/branch.subscription.js	2011-02-24 00:11:15 +0000
@@ -78,7 +78,7 @@
 
     initializer: function () {
 
-        this._lp_client = new LP.client.Launchpad();
+        this._lp_client = new Y.lp.client.Launchpad();
         this._branch_repr = LP.cache.context;
         setUpNames(this._lp_client);
 
@@ -151,7 +151,7 @@
                         }
                     },
                     parameters: {
-                        person: LP.client.get_absolute_uri(me),
+                        person: Y.lp.client.get_absolute_uri(me),
                         notification_level: notification_level_update,
                         max_diff_lines: max_diff_lines_update,
                         code_review_level: review_level_update
@@ -215,5 +215,6 @@
     'event',
     'io',
     'lazr.formoverlay',
+    'lp.client',
     'node'
     ]});

=== modified file 'lib/lp/code/javascript/branchmergeproposal.diff.js'
--- lib/lp/code/javascript/branchmergeproposal.diff.js	2011-02-17 17:25:21 +0000
+++ lib/lp/code/javascript/branchmergeproposal.diff.js	2011-02-24 00:11:15 +0000
@@ -88,7 +88,7 @@
                 document.location = librarian_url;
             }
         },
-        accept: LP.client.XHTML
+        accept: Y.lp.client.XHTML
     };
     lp_client.get(api_url, config);
 }
@@ -121,7 +121,7 @@
     }
 
     // Setup the LP client.
-    lp_client = new LP.client.Launchpad();
+    lp_client = new Y.lp.client.Launchpad();
 
     // Listen for the branch-linked custom event.
     Y.on('lp:branch-linked', link_popup_diff_onclick);
@@ -132,4 +132,4 @@
     }
 };
 
-    }, '0.1', {requires: ['event', 'io', 'node', 'lazr.overlay']});
+  }, '0.1', {requires: ['event', 'io', 'node', 'lazr.overlay', 'lp.client']});

=== modified file 'lib/lp/code/javascript/branchmergeproposal.reviewcomment.js'
--- lib/lp/code/javascript/branchmergeproposal.reviewcomment.js	2011-02-24 00:11:15 +0000
+++ lib/lp/code/javascript/branchmergeproposal.reviewcomment.js	2011-02-24 00:11:15 +0000
@@ -192,12 +192,12 @@
 
     var context = LP.cache.context;
     if (lp_client === undefined) {
-        lp_client = new LP.client.Launchpad();
+        lp_client = new Y.lp.client.Launchpad();
     }
 
     var config = {
         parameters: {
-            reviewer: LP.client.get_absolute_uri(person.api_uri),
+            reviewer: Y.lp.client.get_absolute_uri(person.api_uri),
             review_type: reviewtype
         },
         on: {
@@ -281,4 +281,4 @@
 namespace.NumberToggle = NumberToggle;
 
 }, "0.1", {"requires": ["base", "widget", "lazr.anim",
-                        "lazr.formoverlay", "lp.app.picker"]});
+                        "lazr.formoverlay", "lp.app.picker", "lp.client"]});

=== modified file 'lib/lp/code/javascript/branchmergeproposal.status.js'
--- lib/lp/code/javascript/branchmergeproposal.status.js	2011-02-24 00:11:15 +0000
+++ lib/lp/code/javascript/branchmergeproposal.status.js	2011-02-24 00:11:15 +0000
@@ -50,7 +50,7 @@
                 }
             };
             status_content.one('img').set('src', '/@@/spinner');
-            lp_client = new LP.client.Launchpad();
+            lp_client = new Y.lp.client.Launchpad();
             lp_client.named_post(
                 LP.cache.context.self_link, 'setStatus', config);
 
@@ -127,4 +127,5 @@
             }});
 }
 
-}, "0.1", {"requires": ["io", "node", "lazr.choiceedit", "lp.client.plugins"]});
+  }, "0.1", {"requires": ["io", "node", "lazr.choiceedit", "lp.client",
+                          "lp.client.plugins"]});

=== modified file 'lib/lp/code/javascript/requestbuild_overlay.js'
--- lib/lp/code/javascript/requestbuild_overlay.js	2011-02-24 00:11:15 +0000
+++ lib/lp/code/javascript/requestbuild_overlay.js	2011-02-24 00:11:15 +0000
@@ -17,7 +17,7 @@
 
 function set_up_lp_client() {
     if (lp_client === undefined) {
-        lp_client = new LP.client.Launchpad();
+        lp_client = new Y.lp.client.Launchpad();
     }
 }
 
@@ -119,7 +119,7 @@
         var submit_url = base_url+"/+request-daily-build";
         var current_builds = harvest_current_build_records();
 
-        var qs = LP.client.append_qs('', 'field.actions.build', 'Build now');
+        var qs = Y.lp.client.append_qs('', 'field.actions.build', 'Build now');
         var y_config = {
             method: "POST",
             headers: {'Accept': 'application/xhtml'},
@@ -301,5 +301,5 @@
 }
 
 }, "0.1", {"requires": [
-    "dom", "node", "io-base", "lazr.anim", "lazr.formoverlay"
+    "dom", "node", "io-base", "lazr.anim", "lazr.formoverlay", "lp.client"
     ]});

=== modified file 'lib/lp/registry/javascript/distroseriesdifferences_details.js'
--- lib/lp/registry/javascript/distroseriesdifferences_details.js	2011-02-24 00:11:15 +0000
+++ lib/lp/registry/javascript/distroseriesdifferences_details.js	2011-02-24 00:11:15 +0000
@@ -14,7 +14,7 @@
 /**
  * Create one Launchpad client that will be used with multiple requests.
  */
-var lp_client = new LP.client.Launchpad();
+var lp_client = new Y.lp.client.Launchpad();
 
 /*
  * Setup the expandable rows for each difference.
@@ -138,7 +138,7 @@
                         anim.run();
                     }
                     },
-                accept: LP.client.XHTML
+                accept: Y.lp.client.XHTML
                 };
             lp_client.get(comment_entry.get('self_link'), config);
             comment_form.one('textarea').set('value', '');
@@ -301,5 +301,5 @@
 
 };
 
-}, "0.1", {"requires": [
-    "event-simulate", "io-base", "lp.soyuz.base", "lazr.anim", "lazr.effects"]});
+}, "0.1", {"requires": ["event-simulate", "io-base", "lp.soyuz.base",
+                        "lazr.anim", "lazr.effects", "lp.client"]});

=== modified file 'lib/lp/registry/javascript/milestoneoverlay.js'
--- lib/lp/registry/javascript/milestoneoverlay.js	2010-07-15 10:55:27 +0000
+++ lib/lp/registry/javascript/milestoneoverlay.js	2011-02-24 00:11:15 +0000
@@ -36,7 +36,7 @@
             next_step(parameters);
         };
 
-        var client = new LP.client.Launchpad();
+        var client = new Y.lp.client.Launchpad();
         client.named_post(series_uri, 'newMilestone', {
             parameters: parameters,
             on: {
@@ -117,6 +117,11 @@
         config.activate_node.on('click', show_milestone_form);
     };
 
-}, "0.1", {"requires": [
-    "dom", "node", "io-base", "lazr.anim", "lazr.formoverlay", "lp.app.calendar"
-    ]});
+}, "0.1", {"requires": ["dom",
+                        "node",
+                        "io-base",
+                        "lazr.anim",
+                        "lazr.formoverlay",
+                        "lp.app.calendar",
+                        "lp.client"
+                        ]});

=== modified file 'lib/lp/registry/javascript/team.js'
--- lib/lp/registry/javascript/team.js	2011-02-24 00:11:15 +0000
+++ lib/lp/registry/javascript/team.js	2011-02-24 00:11:15 +0000
@@ -39,9 +39,9 @@
         addmember_link.removeClass('unseen');
         spinner.addClass('unseen');
     };
-    lp_client = new LP.client.Launchpad();
+    lp_client = new Y.lp.client.Launchpad();
 
-    var error_handler = new LP.client.ErrorHandler();
+    var error_handler = new Y.lp.client.ErrorHandler();
     error_handler.clearProgressUI = disable_spinner;
     error_handler.showError = function(error_msg) {
         Y.lp.app.errors.display_error(addmember_link, error_msg);
@@ -114,7 +114,7 @@
                         success: xhtml_person_handler,
                         failure: error_handler.getFailureHandler()
                     },
-                    accept: LP.client.XHTML
+                    accept: Y.lp.client.XHTML
                 };
                 lp_client.get(selected_person.api_uri, xhtml_person_config);
             },
@@ -124,8 +124,8 @@
             // XXX: EdwinGrubbs 2009-12-16 bug=497602
             // Why do I always have to get absolute URIs out of the URIs
             // in the picker's result/client.links?
-            reviewer: LP.client.get_absolute_uri(LP.links.me),
-            person: LP.client.get_absolute_uri(selected_person.api_uri)
+            reviewer: Y.lp.client.get_absolute_uri(LP.links.me),
+            person: Y.lp.client.get_absolute_uri(selected_person.api_uri)
         }
     };
 
@@ -133,6 +133,10 @@
         LP.cache.context.self_link, 'addMember', addmember_config);
 };
 
-}, '0.1', {requires: [
-    'node', 'lazr.anim', 'lp.app.picker', 'lp.app.errors', 'lp.client.plugins'
-    ]});
+}, '0.1', {requires: ['node',
+                      'lazr.anim',
+                      'lp.app.errors',
+                      'lp.app.picker',
+                      'lp.client',
+                      'lp.client.plugins'
+                      ]});

=== modified file 'lib/lp/registry/templates/object-timeline-graph.pt'
--- lib/lp/registry/templates/object-timeline-graph.pt	2011-02-24 00:11:15 +0000
+++ lib/lp/registry/templates/object-timeline-graph.pt	2011-02-24 00:11:15 +0000
@@ -47,7 +47,8 @@
           get_timeline_config.size = size;
       }
 
-      LPS.use('lp.registry.timeline', 'node', 'lp.app.dragscroll', function(Y) {
+      LPS.use('lp.registry.timeline', 'node', 'lp.app.dragscroll', 'lp.client',
+        function(Y) {
           Y.on('domready', function(e) {
               if (Y.UA.ie) {
                   return;
@@ -123,7 +124,7 @@
                   }
               };
 
-              var client = new LP.client.Launchpad();
+              var client = new Y.lp.client.Launchpad();
               client.named_get(
                   LP.cache['context']['self_link'],
                   'get_timeline', get_timeline_config);

=== modified file 'lib/lp/soyuz/javascript/lp_dynamic_dom_updater.js'
--- lib/lp/soyuz/javascript/lp_dynamic_dom_updater.js	2011-02-24 00:11:15 +0000
+++ lib/lp/soyuz/javascript/lp_dynamic_dom_updater.js	2011-02-24 00:11:15 +0000
@@ -228,7 +228,7 @@
             // create one now:
             if (null === this.get("lp_client")){
                 // Create our own instance of the LP client.
-                this.set("lp_client", new LP.client.Launchpad());
+                this.set("lp_client", new Y.lp.client.Launchpad());
             }
 
             setTimeout(
@@ -354,4 +354,4 @@
      */
     namespace.DynamicDomUpdater = DynamicDomUpdater;
 
-}, "0.1", {"requires":["node", "plugin"]});
+}, "0.1", {"requires":["node", "plugin", "lp.client"]});

=== modified file 'lib/lp/soyuz/javascript/update_archive_build_statuses.js'
--- lib/lp/soyuz/javascript/update_archive_build_statuses.js	2011-02-24 00:11:15 +0000
+++ lib/lp/soyuz/javascript/update_archive_build_statuses.js	2011-02-24 00:11:15 +0000
@@ -16,7 +16,7 @@
     /**
      * Create one Launchpad client to be used by both dynamic tables.
      */
-    var lp_client = new LP.client.Launchpad();
+    var lp_client = new Y.lp.client.Launchpad();
 
     /**
      * Configuration for the dynamic update of the build summary portlet.
@@ -280,5 +280,8 @@
                        source_package_table_dynamic_update_config);
         }
     });
-}, "0.1", {"requires":[
-    "node", "lazr.anim", "anim", "lp.soyuz.dynamic_dom_updater"]});
+}, "0.1", {"requires":["anim",
+                       "node",
+                       "lazr.anim",
+                       "lp.client",
+                       "lp.soyuz.dynamic_dom_updater"]});

=== modified file 'lib/lp/translations/javascript/importqueue.js'
--- lib/lp/translations/javascript/importqueue.js	2011-02-04 17:12:55 +0000
+++ lib/lp/translations/javascript/importqueue.js	2011-02-24 00:11:15 +0000
@@ -104,7 +104,7 @@
 
     var entry_uri = '+imports/' + entry_id;
     var div = output.one('div');
-    var lp = new LP.client.Launchpad();
+    var lp = new Y.lp.client.Launchpad();
     lp.get(entry_uri, output_loader(div));
 };
 
@@ -148,7 +148,7 @@
             }
         };
         Y.log(config);
-        lp_client = new LP.client.Launchpad();
+        lp_client = new Y.lp.client.Launchpad();
         var entry_uri = '+imports/' + entry_id;
         lp_client.named_post(entry_uri, 'setStatus', config);
     });
@@ -180,4 +180,5 @@
     // "oop" and "event" are required to fix known bugs in YUI, which
     // are apparently fixed in a later version.
     "requires": ["oop", "event", "node", "widget", "plugin", "overlay",
-               "lazr.choiceedit", "lp.client.plugins", "lp.app.errors"]});
+                 "lazr.choiceedit", "lp.client", "lp.client.plugins",
+                 "lp.app.errors"]});