Merge lp:~rockstar/launchpad/code-js-reorg into lp:launchpad

Proposed by Paul Hummer
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~rockstar/launchpad/code-js-reorg
Merge into: lp:launchpad
Diff against target: 343 lines (+49/-47)
11 files modified
lib/canonical/launchpad/javascript/code/branchlinks.js (+4/-4)
lib/canonical/launchpad/javascript/code/branchmergeproposal.js (+5/-5)
lib/canonical/launchpad/javascript/code/branchstatus.js (+4/-4)
lib/canonical/launchpad/javascript/code/codereview.js (+9/-7)
lib/canonical/launchpad/javascript/code/popupdiff.js (+6/-6)
lib/canonical/launchpad/javascript/code/subscription.js (+4/-4)
lib/canonical/launchpad/windmill/jstests/launchpad_ajax.js (+2/-2)
lib/lp/bugs/templates/bugtask-index.pt (+2/-2)
lib/lp/code/templates/branch-index.pt (+6/-6)
lib/lp/code/templates/branch-related-bugs-specs.pt (+2/-2)
lib/lp/code/templates/branchmergeproposal-index.pt (+5/-5)
To merge this branch: bzr merge lp:~rockstar/launchpad/code-js-reorg
Reviewer Review Type Date Requested Status
Graham Binns (community) code Approve
Review via email: mp+20170@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) wrote :

Hi there-

  This branch just fixes bug 513270. Basically, the code Javascript doesn't
conform to our new(er) Javascript standards. This branch is actually a split
up version of what I wanted to do with the javascript, but the revisions past
this will conflict with thumper's work that I reviewed yesterday, and I don't
want to make the major changes (from the latter revisions) so close to release
time.

Cheers,
Paul

Revision history for this message
Graham Binns (gmb) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/javascript/code/branchlinks.js'
--- lib/canonical/launchpad/javascript/code/branchlinks.js 2009-11-24 09:30:01 +0000
+++ lib/canonical/launchpad/javascript/code/branchlinks.js 2010-03-11 19:22:24 +0000
@@ -7,9 +7,9 @@
7 * @requires base, lazr.anim, lazr.formoverlay7 * @requires base, lazr.anim, lazr.formoverlay
8 */8 */
99
10YUI.add('code.branchlinks', function(Y) {10YUI.add('lp.code.branchlinks', function(Y) {
1111
12Y.branchlinks = Y.namespace('code.branchlinks');12var namespace = Y.namespace('lp.code.branchlinks');
1313
14var lp_client; // The LP client14var lp_client; // The LP client
1515
@@ -20,7 +20,7 @@
20/*20/*
21 * Connect the links to the javascript events.21 * Connect the links to the javascript events.
22 */22 */
23Y.branchlinks.connect_branchlinks = function() {23namespace.connect_branchlinks = function() {
2424
25 error_handler = new LP.client.ErrorHandler();25 error_handler = new LP.client.ErrorHandler();
26 error_handler.clearProgressUI = function() {26 error_handler.clearProgressUI = function() {
@@ -163,7 +163,7 @@
163163
164 // Check to see if that was the only bug linked.164 // Check to see if that was the only bug linked.
165 var buglinks = Y.all(".bug-branch-summary");165 var buglinks = Y.all(".bug-branch-summary");
166 if (buglinks.size() == 0) {166 if (!buglinks.size()) {
167 Y.one('#linkbug').set('innerHTML',167 Y.one('#linkbug').set('innerHTML',
168 'Link to a bug report');168 'Link to a bug report');
169 }169 }
170170
=== modified file 'lib/canonical/launchpad/javascript/code/branchmergeproposal.js'
--- lib/canonical/launchpad/javascript/code/branchmergeproposal.js 2010-02-25 00:39:57 +0000
+++ lib/canonical/launchpad/javascript/code/branchmergeproposal.js 2010-03-11 19:22:24 +0000
@@ -1,19 +1,19 @@
1/** Copyright (c) 2009, Canonical Ltd. All rights reserved.1/** Copyright (c) 2009, Canonical Ltd. All rights reserved.
2 *2 *
3 * Code for handling the update of the branch status.3 * Code for handling the update of the branch merge proposals.
4 *4 *
5 * @module branchstatus5 * @module lp.code.branchmergeproposal
6 * @requires node, lazr.choiceedit, lp.client.plugins6 * @requires node, lazr.choiceedit, lp.client.plugins
7 */7 */
88
9YUI.add('code.branchmergeproposal', function(Y) {9YUI.add('lp.code.branchmergeproposal', function(Y) {
1010
11Y.code.branchmergeproposal = Y.namespace('code.branchmergeproposal');11var namespace = Y.namespace('lp.code.branchmergeproposal');
1212
13/*13/*
14 * Connect the branch status to the javascript events.14 * Connect the branch status to the javascript events.
15 */15 */
16Y.code.branchmergeproposal.connect_status = function(conf) {16namespace.connect_status = function(conf) {
1717
18 var status_content = Y.get('#branchmergeproposal-status-value');18 var status_content = Y.get('#branchmergeproposal-status-value');
1919
2020
=== modified file 'lib/canonical/launchpad/javascript/code/branchstatus.js'
--- lib/canonical/launchpad/javascript/code/branchstatus.js 2009-11-24 09:30:01 +0000
+++ lib/canonical/launchpad/javascript/code/branchstatus.js 2010-03-11 19:22:24 +0000
@@ -3,18 +3,18 @@
3 *3 *
4 * Code for handling the update of the branch status.4 * Code for handling the update of the branch status.
5 *5 *
6 * @module branchstatus6 * @module lp.code.branchstatus
7 * @requires node, lazr.choiceedit, lp.client.plugins7 * @requires node, lazr.choiceedit, lp.client.plugins
8 */8 */
99
10YUI.add('code.branchstatus', function(Y) {10YUI.add('lp.code.branchstatus', function(Y) {
1111
12Y.branchstatus = Y.namespace('code.branchstatus');12var namespace = Y.namespace('lp.code.branchstatus');
1313
14/*14/*
15 * Connect the branch status to the javascript events.15 * Connect the branch status to the javascript events.
16 */16 */
17Y.branchstatus.connect_status = function(conf) {17namespace.connect_status = function(conf) {
1818
19 var status_content = Y.one('#branch-details-status-value');19 var status_content = Y.one('#branch-details-status-value');
2020
2121
=== modified file 'lib/canonical/launchpad/javascript/code/codereview.js'
--- lib/canonical/launchpad/javascript/code/codereview.js 2010-02-23 09:31:13 +0000
+++ lib/canonical/launchpad/javascript/code/codereview.js 2010-03-11 19:22:24 +0000
@@ -3,13 +3,13 @@
3 *3 *
4 * Library for code review javascript.4 * Library for code review javascript.
5 *5 *
6 * @module CodeReview6 * @module lp.code.codereview
7 * @requires base, lazr.anim, lazr.formoverlay7 * @requires base, lazr.anim, lazr.formoverlay
8 */8 */
99
10YUI.add('code.codereview', function(Y) {10YUI.add('lp.code.codereview', function(Y) {
1111
12Y.codereview = Y.namespace('code.codereview');12var namespace = Y.namespace('lp.code.codereview');
1313
14var reviewer_picker; // The "Request a review" overlay14var reviewer_picker; // The "Request a review" overlay
15var lp_client;15var lp_client;
@@ -23,7 +23,7 @@
23/*23/*
24 * Connect all the links to their given actions.24 * Connect all the links to their given actions.
25 */25 */
26Y.codereview.connect_links = function() {26namespace.connect_links = function() {
2727
28 var link = Y.one('#request-review');28 var link = Y.one('#request-review');
29 if (Y.Lang.isValue(link)) {29 if (Y.Lang.isValue(link)) {
@@ -51,7 +51,9 @@
5151
52function link_scroller(link_selector, node_selector, on_end) {52function link_scroller(link_selector, node_selector, on_end) {
53 var link = Y.one(link_selector);53 var link = Y.one(link_selector);
54 if (!Y.Lang.isValue(link)) return;54 if (!Y.Lang.isValue(link)) {
55 return;
56 }
5557
56 link.addClass('js-action');58 link.addClass('js-action');
57 link.on('click', function(e) {59 link.on('click', function(e) {
@@ -229,7 +231,7 @@
229 var target = Y.one('#votes-target');231 var target = Y.one('#votes-target');
230 target.set('innerHTML', response.responseText);232 target.set('innerHTML', response.responseText);
231233
232 Y.codereview.connect_links();234 namespace.connect_links();
233 var new_reviewer = Y.one('#review-' + username);235 var new_reviewer = Y.one('#review-' + username);
234 var anim = Y.lazr.anim.green_flash({node: new_reviewer});236 var anim = Y.lazr.anim.green_flash({node: new_reviewer});
235 anim.run();237 anim.run();
@@ -276,6 +278,6 @@
276 }278 }
277});279});
278280
279Y.codereview.NumberToggle = NumberToggle;281namespace.NumberToggle = NumberToggle;
280282
281}, "0.1", {"requires": ["base", "widget", "lazr.anim", "lazr.formoverlay", "lp.picker"]});283}, "0.1", {"requires": ["base", "widget", "lazr.anim", "lazr.formoverlay", "lp.picker"]});
282284
=== modified file 'lib/canonical/launchpad/javascript/code/popupdiff.js'
--- lib/canonical/launchpad/javascript/code/popupdiff.js 2010-02-19 17:04:52 +0000
+++ lib/canonical/launchpad/javascript/code/popupdiff.js 2010-03-11 19:22:24 +0000
@@ -3,11 +3,14 @@
3 *3 *
4 * Code for handling the popup diffs in the pretty overlays.4 * Code for handling the popup diffs in the pretty overlays.
5 *5 *
6 * @module popupdiff6 * @module lp.code.branchmergeproposal.popupdiff
7 * @requires node7 * @requires node
8 */8 */
99
10YUI.add('code.branchmergeproposal.popupdiff', function(Y) {10YUI.add('lp.code.branchmergeproposal.popupdiff', function(Y) {
11
12// Grab the namespace in order to be able to expose the connect method.
13var namespace = Y.namespace('lp.code.branchmergeproposal.popupdiff');
1114
12// The launchpad js client used.15// The launchpad js client used.
13var lp_client;16var lp_client;
@@ -90,9 +93,6 @@
90}93}
9194
9295
93// Grab the namespace in order to be able to expose the connect method.
94var popupdiff = Y.namespace('code.branchmergeproposal.popupdiff');
95
96/*96/*
97 * Link up the onclick handler for the a.diff-link in the node to the function97 * Link up the onclick handler for the a.diff-link in the node to the function
98 * that will popup the diff in the pretty overlay.98 * that will popup the diff in the pretty overlay.
@@ -113,7 +113,7 @@
113/*113/*
114 * Connect the diff links to their pretty overlay function.114 * Connect the diff links to their pretty overlay function.
115 */115 */
116popupdiff.connect_diff_links = function() {116namespace.connect_diff_links = function() {
117 // IE doesn't like pretty overlays.117 // IE doesn't like pretty overlays.
118 if (Y.UA.ie) {118 if (Y.UA.ie) {
119 return;119 return;
120120
=== modified file 'lib/canonical/launchpad/javascript/code/subscription.js'
--- lib/canonical/launchpad/javascript/code/subscription.js 2010-01-12 23:44:24 +0000
+++ lib/canonical/launchpad/javascript/code/subscription.js 2010-03-11 19:22:24 +0000
@@ -15,7 +15,7 @@
15 along with this program. If not, see <http://www.gnu.org/licenses/>.15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/16*/
1717
18YUI.add('code.branch.subscription', function(Y) {18YUI.add('lp.code.branch.subscription', function(Y) {
1919
20/*20/*
21 * Tools for working with branch subscriptions.21 * Tools for working with branch subscriptions.
@@ -24,7 +24,7 @@
24 * @namespace lp.code.branch.subscription24 * @namespace lp.code.branch.subscription
25 */25 */
2626
27var namespace = Y.namespace('code.branch.subscription');27var namespace = Y.namespace('lp.code.branch.subscription');
2828
29var display_name, // The logged in user's displayname.29var display_name, // The logged in user's displayname.
30 user_name, // The logged in user's username.30 user_name, // The logged in user's username.
@@ -207,7 +207,7 @@
207 Y.on(207 Y.on(
208 'branch:subscriber-list-stale',208 'branch:subscriber-list-stale',
209 this._updateSubscribersList);209 this._updateSubscribersList);
210 },210 }
211});211});
212namespace.SubscriptionWidget = SubscriptionWidget;212namespace.SubscriptionWidget = SubscriptionWidget;
213213
@@ -215,5 +215,5 @@
215 'event',215 'event',
216 'io',216 'io',
217 'lazr.formoverlay',217 'lazr.formoverlay',
218 'node',218 'node'
219 ]});219 ]});
220220
=== modified file 'lib/canonical/launchpad/windmill/jstests/launchpad_ajax.js'
--- lib/canonical/launchpad/windmill/jstests/launchpad_ajax.js 2010-02-16 16:29:36 +0000
+++ lib/canonical/launchpad/windmill/jstests/launchpad_ajax.js 2010-03-11 19:22:24 +0000
@@ -344,7 +344,7 @@
344344
345 // Now make sure patch() on a field resource works when we345 // Now make sure patch() on a field resource works when we
346 // request a JSON representation in return.346 // request a JSON representation in return.
347 var field_uri = LP.client.get_field_uri('~salgado', 'display_name');347 field_uri = LP.client.get_field_uri('~salgado', 'display_name');
348 client.patch(field_uri, 'Guilherme Salgado',348 client.patch(field_uri, 'Guilherme Salgado',
349 {on: test.create_yui_sync_on()});349 {on: test.create_yui_sync_on()});
350 },350 },
@@ -354,7 +354,7 @@
354 jum.assertEquals('success', test.result.callback);354 jum.assertEquals('success', test.result.callback);
355 var salgado_name_html = test.result.args[0];355 var salgado_name_html = test.result.args[0];
356 jum.assertEquals(salgado_name_html, "Guilherme Salgado");356 jum.assertEquals(salgado_name_html, "Guilherme Salgado");
357 },357 }
358]);358]);
359359
360//Test that modifying an entry and then calling lp_save() saves the360//Test that modifying an entry and then calling lp_save() saves the
361361
=== modified file 'lib/lp/bugs/templates/bugtask-index.pt'
--- lib/lp/bugs/templates/bugtask-index.pt 2010-01-22 03:16:44 +0000
+++ lib/lp/bugs/templates/bugtask-index.pt 2010-03-11 19:22:24 +0000
@@ -38,10 +38,10 @@
38 </tal:devmode>38 </tal:devmode>
39 <script type="text/javascript">39 <script type="text/javascript">
40 LPS.use('base', 'node', 'oop', 'event', 'bugs.bugtask_index',40 LPS.use('base', 'node', 'oop', 'event', 'bugs.bugtask_index',
41 'code.branchmergeproposal.popupdiff', function(Y) {41 'lp.code.branchmergeproposal.popupdiff', function(Y) {
42 Y.bugs.setup_bugtask_index();42 Y.bugs.setup_bugtask_index();
43 Y.on('load', function(e) {43 Y.on('load', function(e) {
44 Y.code.branchmergeproposal.popupdiff.connect_diff_links();44 Y.lp.code.branchmergeproposal.popupdiff.connect_diff_links();
45 }, window);45 }, window);
46 });46 });
47 </script>47 </script>
4848
=== modified file 'lib/lp/code/templates/branch-index.pt'
--- lib/lp/code/templates/branch-index.pt 2010-01-15 20:22:33 +0000
+++ lib/lp/code/templates/branch-index.pt 2010-03-11 19:22:24 +0000
@@ -44,18 +44,18 @@
44 <script type="text/javascript"44 <script type="text/javascript"
45 tal:content="string:45 tal:content="string:
46 LPS.use('node', 'event', 'widget', 'plugin', 'overlay',46 LPS.use('node', 'event', 'widget', 'plugin', 'overlay',
47 'lazr.choiceedit', 'code.branchstatus',47 'lazr.choiceedit', 'lp.code.branchstatus',
48 'code.branchmergeproposal.popupdiff',48 'lp.code.branchmergeproposal.popupdiff',
49 'code.branch.subscription', function(Y) {49 'lp.code.branch.subscription', function(Y) {
5050
51 Y.on('load', function(e) {51 Y.on('load', function(e) {
52 var subscription_portlet = new Y.code.branch.subscription.SubscriptionWidget({52 var subscription_portlet = new Y.lp.code.branch.subscription.SubscriptionWidget({
53 contentBox: '#portlet-subscribers'53 contentBox: '#portlet-subscribers'
54 });54 });
55 subscription_portlet.render();55 subscription_portlet.render();
5656
57 Y.branchstatus.connect_status(${view/status_config});57 Y.lp.code.branchstatus.connect_status(${view/status_config});
58 Y.code.branchmergeproposal.popupdiff.connect_diff_links();58 Y.lp.code.branchmergeproposal.popupdiff.connect_diff_links();
59 },59 },
60 window);60 window);
61 });61 });
6262
=== modified file 'lib/lp/code/templates/branch-related-bugs-specs.pt'
--- lib/lp/code/templates/branch-related-bugs-specs.pt 2009-12-03 18:33:22 +0000
+++ lib/lp/code/templates/branch-related-bugs-specs.pt 2010-03-11 19:22:24 +0000
@@ -42,14 +42,14 @@
42 string:&lt;script id='branchlink-script' type='text/javascript'&gt;" />42 string:&lt;script id='branchlink-script' type='text/javascript'&gt;" />
43 <!--43 <!--
4444
45 LPS.use('io-base', 'code.branchlinks', function(Y) {45 LPS.use('io-base', 'lp.code.branchlinks', function(Y) {
4646
47 if(Y.UA.ie) {47 if(Y.UA.ie) {
48 return;48 return;
49 }49 }
5050
51 Y.on('domready', function() {51 Y.on('domready', function() {
52 Y.code.branchlinks.connect_branchlinks();52 Y.lp.code.branchlinks.connect_branchlinks();
53 });53 });
5454
55 });55 });
5656
=== modified file 'lib/lp/code/templates/branchmergeproposal-index.pt'
--- lib/lp/code/templates/branchmergeproposal-index.pt 2010-02-23 09:31:13 +0000
+++ lib/lp/code/templates/branchmergeproposal-index.pt 2010-03-11 19:22:24 +0000
@@ -228,8 +228,8 @@
228 string:&lt;script id='codereview-script' type='text/javascript'&gt;" />228 string:&lt;script id='codereview-script' type='text/javascript'&gt;" />
229 conf = <tal:status-config replace="view/status_config" />229 conf = <tal:status-config replace="view/status_config" />
230 <!--230 <!--
231 LPS.use('io-base', 'code.codereview', 'code.branchmergeproposal', 'lp.comment',231 LPS.use('io-base', 'lp.code.codereview', 'lp.code.branchmergeproposal',
232 function(Y) {232 'lp.comment', function(Y) {
233233
234 Y.on('load', function() {234 Y.on('load', function() {
235 var logged_in = LP.client.links['me'] !== undefined;235 var logged_in = LP.client.links['me'] !== undefined;
@@ -242,10 +242,10 @@
242 return;242 return;
243 }243 }
244244
245 Y.code.branchmergeproposal.connect_status(conf);245 Y.lp.code.branchmergeproposal.connect_status(conf);
246 }246 }
247 Y.code.codereview.connect_links();247 Y.lp.code.codereview.connect_links();
248 (new Y.codereview.NumberToggle()).render();248 (new Y.lp.code.codereview.NumberToggle()).render();
249 }, window);249 }, window);
250 });250 });
251 -->251 -->