Merge lp:~thumper/launchpad/lp-app-javascript into lp:launchpad
- lp-app-javascript
- Merge into devel
Proposed by
Tim Penhey
Status: | Merged |
---|---|
Approved by: | Paul Hummer |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11140 |
Proposed branch: | lp:~thumper/launchpad/lp-app-javascript |
Merge into: | lp:launchpad |
Diff against target: |
860 lines (+109/-109) 32 files modified
lib/canonical/launchpad/doc/lazr-js-widgets.txt (+2/-2) lib/canonical/launchpad/doc/location-widget.txt (+2/-2) lib/canonical/launchpad/templates/launchpad-widget-macros.pt (+3/-3) lib/canonical/widgets/location.py (+2/-2) lib/canonical/widgets/templates/inline-picker.pt (+2/-2) lib/canonical/widgets/templates/vocabulary-picker.js.template (+2/-2) lib/lp/app/javascript/calendar.js (+6/-6) lib/lp/app/javascript/comment.js (+6/-6) lib/lp/app/javascript/dragscroll.js (+5/-5) lib/lp/app/javascript/errors.js (+4/-4) lib/lp/app/javascript/mapping.js (+4/-4) lib/lp/app/javascript/picker.js (+6/-8) lib/lp/app/templates/base-layout-macros.pt (+11/-11) lib/lp/bugs/javascript/bugtask_index.js (+18/-18) lib/lp/bugs/javascript/bugtracker_overlay.js (+1/-1) lib/lp/bugs/templates/bugtask-index.pt (+2/-2) lib/lp/code/javascript/branch.status.js (+1/-1) lib/lp/code/javascript/branchmergeproposal.reviewcomment.js (+3/-2) lib/lp/code/javascript/branchmergeproposal.status.js (+1/-1) lib/lp/code/templates/branchmergeproposal-index.pt (+2/-2) lib/lp/registry/browser/person.py (+2/-2) lib/lp/registry/browser/team.py (+4/-4) lib/lp/registry/browser/tests/person-views.txt (+2/-2) lib/lp/registry/javascript/milestoneoverlay.js (+2/-2) lib/lp/registry/javascript/team.js (+5/-5) lib/lp/registry/stories/location/personlocation.txt (+2/-2) lib/lp/registry/stories/location/team-map.txt (+2/-2) lib/lp/registry/templates/object-timeline-graph.pt (+2/-2) lib/lp/registry/templates/teammembership-index.pt (+1/-1) lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt (+1/-1) lib/lp/translations/javascript/importqueue.js (+2/-2) utilities/lp-deps.py (+1/-0) |
To merge this branch: | bzr merge lp:~thumper/launchpad/lp-app-javascript |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer (community) | Approve | ||
Review via email:
|
Commit message
Move javascript files from canonical.
Description of the change
Move code from canonical.
Also changed (most) of the files to follow the proper namespace rules and be in lp.app.*
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/canonical/launchpad/doc/lazr-js-widgets.txt' |
2 | --- lib/canonical/launchpad/doc/lazr-js-widgets.txt 2009-07-14 13:16:50 +0000 |
3 | +++ lib/canonical/launchpad/doc/lazr-js-widgets.txt 2010-07-16 10:55:11 +0000 |
4 | @@ -99,7 +99,7 @@ |
5 | ... null_display_value='Nobody') |
6 | |
7 | An unauthenticated user cannot see the activator's edit button, which |
8 | -is revealed by Y.lp.picker.addPickerPatcher. |
9 | +is revealed by Y.lp.app.picker.addPickerPatcher. |
10 | |
11 | >>> login(ANONYMOUS) |
12 | >>> widget = create_inline_edit_picker_widget() |
13 | @@ -120,7 +120,7 @@ |
14 | <span id="inline-picker-activator-id-..."> |
15 | ...<div class="yui-activator-message-box yui-activator-hidden" /> |
16 | </span> |
17 | - ...Y.lp.picker.addPickerPatcher(... |
18 | + ...Y.lp.app.picker.addPickerPatcher(... |
19 | |
20 | The resource_uri is the canonical_url for the object in |
21 | WebServiceClientRequests. |
22 | |
23 | === modified file 'lib/canonical/launchpad/doc/location-widget.txt' |
24 | --- lib/canonical/launchpad/doc/location-widget.txt 2009-05-06 16:12:19 +0000 |
25 | +++ lib/canonical/launchpad/doc/location-widget.txt 2010-07-16 10:55:11 +0000 |
26 | @@ -177,9 +177,9 @@ |
27 | >>> print widget.map_javascript |
28 | <BLANKLINE> |
29 | <script type="text/javascript"> |
30 | - YUI().use('node', 'lp.mapping', function(Y) { |
31 | + YUI().use('node', 'lp.app.mapping', function(Y) { |
32 | function renderMap() { |
33 | - Y.lp.mapping.renderPersonMap( |
34 | + Y.lp.app.mapping.renderPersonMap( |
35 | 52.2, 0.3, "Colin Watson", |
36 | 'kamion', '<img ... />', 'totoro', |
37 | 'field.location.latitude', 'field.location.longitude', |
38 | |
39 | === modified file 'lib/canonical/launchpad/templates/launchpad-widget-macros.pt' |
40 | --- lib/canonical/launchpad/templates/launchpad-widget-macros.pt 2009-07-17 17:59:07 +0000 |
41 | +++ lib/canonical/launchpad/templates/launchpad-widget-macros.pt 2010-07-16 10:55:11 +0000 |
42 | @@ -101,7 +101,7 @@ |
43 | <script type="text/javascript" |
44 | tal:attributes="src string:${yui2}/calendar/calendar.js"></script> |
45 | <script type="text/javascript" |
46 | - tal:attributes="src string:${lp_js}/lp/calendar.js"></script> |
47 | + tal:attributes="src string:${lp_js}/app/calendar.js"></script> |
48 | </tal:devmode> |
49 | <tal:nondevmode condition="not: devmode"> |
50 | <script type="text/javascript" |
51 | @@ -116,8 +116,8 @@ |
52 | </tal:yui2resources> |
53 | |
54 | <script type="text/javascript"> |
55 | - YUI().use('node', 'lp.calendar', function(Y) { |
56 | - Y.lp.setup_calendar_widgets(); |
57 | + YUI().use('node', 'lp.app.calendar', function(Y) { |
58 | + Y.lp.app.calendar.setup_calendar_widgets(); |
59 | }); |
60 | </script> |
61 | </metal:yui2calendar-dependencies> |
62 | |
63 | === modified file 'lib/canonical/widgets/location.py' |
64 | --- lib/canonical/widgets/location.py 2009-11-22 19:05:39 +0000 |
65 | +++ lib/canonical/widgets/location.py 2010-07-16 10:55:11 +0000 |
66 | @@ -126,9 +126,9 @@ |
67 | show_marker=self.show_marker) |
68 | return """ |
69 | <script type="text/javascript"> |
70 | - YUI().use('node', 'lp.mapping', function(Y) { |
71 | + YUI().use('node', 'lp.app.mapping', function(Y) { |
72 | function renderMap() { |
73 | - Y.lp.mapping.renderPersonMap( |
74 | + Y.lp.app.mapping.renderPersonMap( |
75 | %(center_lat)s, %(center_lng)s, %(displayname)s, |
76 | '%(name)s', '%(logo_html)s', '%(geoname)s', |
77 | '%(lat_name)s', '%(lng_name)s', '%(tz_name)s', |
78 | |
79 | === modified file 'lib/canonical/widgets/templates/inline-picker.pt' |
80 | --- lib/canonical/widgets/templates/inline-picker.pt 2009-07-17 17:59:07 +0000 |
81 | +++ lib/canonical/widgets/templates/inline-picker.pt 2010-07-16 10:55:11 +0000 |
82 | @@ -9,12 +9,12 @@ |
83 | </span> |
84 | <script tal:condition="view/can_write" |
85 | tal:content="structure string: |
86 | -YUI().use('lp.picker', function(Y) { |
87 | +YUI().use('lp.app.picker', function(Y) { |
88 | if (Y.UA.ie) { |
89 | return; |
90 | } |
91 | |
92 | - Y.lp.picker.addPickerPatcher( |
93 | + Y.lp.app.picker.addPickerPatcher( |
94 | ${view/vocabulary_name}, |
95 | ${view/resource_uri}, |
96 | ${view/json_attribute}, |
97 | |
98 | === modified file 'lib/canonical/widgets/templates/vocabulary-picker.js.template' |
99 | --- lib/canonical/widgets/templates/vocabulary-picker.js.template 2010-01-29 10:52:58 +0000 |
100 | +++ lib/canonical/widgets/templates/vocabulary-picker.js.template 2010-07-16 10:55:11 +0000 |
101 | @@ -1,4 +1,4 @@ |
102 | -YUI().use('node', 'lp.picker', 'plugin', function(Y) { |
103 | +YUI().use('node', 'lp.app.picker', 'plugin', function(Y) { |
104 | if (Y.UA.ie) { |
105 | return; |
106 | } |
107 | @@ -14,7 +14,7 @@ |
108 | step_title: args.step_title, |
109 | extra_no_results_message: args.extra_no_results_message |
110 | }; |
111 | - var picker = Y.lp.picker.create(args.vocabulary, config); |
112 | + var picker = Y.lp.app.picker.create(args.vocabulary, config); |
113 | if (config.extra_no_results_message !== null) { |
114 | picker.before('resultsChange', function (e) { |
115 | var new_results = e.details[0].newVal; |
116 | |
117 | === renamed directory 'lib/canonical/launchpad/javascript/lp' => 'lib/lp/app/javascript' |
118 | === modified file 'lib/lp/app/javascript/calendar.js' |
119 | --- lib/canonical/launchpad/javascript/lp/calendar.js 2009-11-24 09:30:01 +0000 |
120 | +++ lib/lp/app/javascript/calendar.js 2010-07-16 10:55:11 +0000 |
121 | @@ -5,13 +5,13 @@ |
122 | * If the input also has the class 'withtime', it will include time |
123 | * fields and behave slightly differently. |
124 | |
125 | - * @module Y.lp.calendar |
126 | + * @module Y.lp.app.calendar |
127 | * @requires node |
128 | */ |
129 | |
130 | -YUI.add('lp.calendar', function(Y) { |
131 | +YUI.add('lp.app.calendar', function(Y) { |
132 | |
133 | -var lp = Y.namespace('lp'); |
134 | +var namespace = Y.namespace('lp.app.calendar'); |
135 | |
136 | /** |
137 | * Convert a number to a string padding single-digit numbers with a zero. |
138 | @@ -179,7 +179,7 @@ |
139 | * |
140 | * @method setup_calendar_widgets. |
141 | */ |
142 | -lp.add_calendar_widgets = function() { |
143 | +namespace.add_calendar_widgets = function() { |
144 | var date_inputs = Y.all('input.yui2-calendar'); |
145 | |
146 | if (date_inputs === null) { |
147 | @@ -241,8 +241,8 @@ |
148 | * |
149 | * @method setup_calendar_widgets. |
150 | */ |
151 | -lp.setup_calendar_widgets = function() { |
152 | - Y.on("domready", lp.add_calendar_widgets); |
153 | +namespace.setup_calendar_widgets = function() { |
154 | + Y.on("domready", namespace.add_calendar_widgets); |
155 | }; |
156 | |
157 | }, "0.1", {"requires": ["node"]}); |
158 | |
159 | === modified file 'lib/lp/app/javascript/comment.js' |
160 | --- lib/canonical/launchpad/javascript/lp/comment.js 2010-02-16 16:29:36 +0000 |
161 | +++ lib/lp/app/javascript/comment.js 2010-07-16 10:55:11 +0000 |
162 | @@ -1,6 +1,6 @@ |
163 | -YUI.add('lp.comment', function(Y) { |
164 | +YUI.add('lp.app.comment', function(Y) { |
165 | |
166 | -Y.lp = Y.namespace('lp'); |
167 | +var namespace = Y.namespace('lp.app.comment'); |
168 | |
169 | var Comment = function () { |
170 | Comment.superclass.constructor.apply(this, arguments); |
171 | @@ -25,7 +25,7 @@ |
172 | this.error_handler = new LP.client.ErrorHandler(); |
173 | this.error_handler.clearProgressUI = bind(this.clearProgressUI, this); |
174 | this.error_handler.showError = bind(function (error_msg) { |
175 | - Y.lp.display_error(this.submit_button, error_msg); |
176 | + Y.lp.app.errors.display_error(this.submit_button, error_msg); |
177 | }, this); |
178 | this.progress_message = Y.Node.create( |
179 | '<span class="update-in-progress-message">Saving...</span>'); |
180 | @@ -199,7 +199,7 @@ |
181 | } |
182 | }); |
183 | |
184 | -Y.lp.Comment = Comment; |
185 | +namespace.Comment = Comment; |
186 | |
187 | var CodeReviewComment = function(){ |
188 | CodeReviewComment.superclass.constructor.apply(this, arguments); |
189 | @@ -420,6 +420,6 @@ |
190 | }); |
191 | } |
192 | }); |
193 | -Y.lp.CodeReviewComment = CodeReviewComment; |
194 | +namespace.CodeReviewComment = CodeReviewComment; |
195 | |
196 | -}, "0.1" ,{"requires":["oop", "io", "widget", "node", "lp.client.plugins", "lp.errors"]}); |
197 | +}, "0.1" ,{"requires":["oop", "io", "widget", "node", "lp.client.plugins", "lp.app.errors"]}); |
198 | |
199 | === modified file 'lib/lp/app/javascript/dragscroll.js' |
200 | --- lib/canonical/launchpad/javascript/lp/dragscroll.js 2010-02-12 16:29:55 +0000 |
201 | +++ lib/lp/app/javascript/dragscroll.js 2010-07-16 10:55:11 +0000 |
202 | @@ -3,7 +3,7 @@ |
203 | * |
204 | * A milestone form overlay that can create a milestone within any page. |
205 | * |
206 | - * @module Y.lp.dragscroll |
207 | + * @module Y.lp.app.dragscroll |
208 | * |
209 | * Based on dragscroll script by Nicolas Mendoza <nicolasm@opera.com>. |
210 | * http://people.opera.com/nicolasm/userjs/dragscroll |
211 | @@ -15,16 +15,16 @@ |
212 | * @class DragScrollEventHandler |
213 | * @constructor |
214 | */ |
215 | -YUI.add('lp.dragscroll', function(Y) { |
216 | - var module = Y.namespace('lp.dragscroll'); |
217 | +YUI.add('lp.app.dragscroll', function(Y) { |
218 | + var namespace = Y.namespace('lp.app.dragscroll'); |
219 | |
220 | - module.DragScrollEventHandler = function() { |
221 | + namespace.DragScrollEventHandler = function() { |
222 | this.dragging = false; |
223 | this.last_position = null; |
224 | this.event_listeners = []; |
225 | }; |
226 | |
227 | - module.DragScrollEventHandler.prototype = { |
228 | + namespace.DragScrollEventHandler.prototype = { |
229 | /** |
230 | * Add the event handlers and change the cursor to indicate |
231 | * that drag scrolling is active. |
232 | |
233 | === modified file 'lib/lp/app/javascript/errors.js' |
234 | --- lib/canonical/launchpad/javascript/lp/errors.js 2009-12-22 20:30:39 +0000 |
235 | +++ lib/lp/app/javascript/errors.js 2010-07-16 10:55:11 +0000 |
236 | @@ -1,6 +1,6 @@ |
237 | -YUI.add('lp.errors', function(Y) { |
238 | +YUI.add('lp.app.errors', function(Y) { |
239 | |
240 | -Y.lp = Y.namespace('lp'); |
241 | +var namespace = Y.namespace('lp.app.errors'); |
242 | |
243 | /* |
244 | * Create a form button for canceling an error form |
245 | @@ -69,7 +69,7 @@ |
246 | * @param flash_node {Node} The node to red flash. |
247 | * @param msg {String} The message to display. |
248 | */ |
249 | -Y.lp.display_error = function(flash_node, msg) { |
250 | +namespace.display_error = function(flash_node, msg) { |
251 | create_error_overlay(); |
252 | maybe_red_flash(flash_node, function(){ |
253 | error_overlay.showError(msg); |
254 | @@ -85,7 +85,7 @@ |
255 | * @method display_info |
256 | * @param msg {String} The message to display. |
257 | */ |
258 | -Y.lp.display_info = function(msg) { |
259 | +namespace.display_info = function(msg) { |
260 | if (info_overlay === undefined) { |
261 | info_overlay = new Y.lazr.PrettyOverlay({ |
262 | centered: true, |
263 | |
264 | === modified file 'lib/lp/app/javascript/mapping.js' |
265 | --- lib/canonical/launchpad/javascript/lp/mapping.js 2010-02-09 05:13:05 +0000 |
266 | +++ lib/lp/app/javascript/mapping.js 2010-07-16 10:55:11 +0000 |
267 | @@ -3,12 +3,12 @@ |
268 | * |
269 | * Map rendering and marker creation depends on the Google GMap2 library. |
270 | * |
271 | - * @module lp.mapping |
272 | - * @namespace lp.mapping |
273 | + * @module lp.app.mapping |
274 | + * @namespace lp.app.mapping |
275 | * @required Google GMap2 |
276 | */ |
277 | -YUI.add('lp.mapping', function(Y) { |
278 | - var module = Y.namespace('lp.mapping'); |
279 | +YUI.add('lp.app.mapping', function(Y) { |
280 | + var module = Y.namespace('lp.app.mapping'); |
281 | |
282 | module.RETURN_FALSE = function() {return false;}; |
283 | module.RETURN_NULL = function() {return null;}; |
284 | |
285 | === modified file 'lib/lp/app/javascript/picker.js' |
286 | --- lib/canonical/launchpad/javascript/lp/picker.js 2010-02-09 05:13:05 +0000 |
287 | +++ lib/lp/app/javascript/picker.js 2010-07-16 10:55:11 +0000 |
288 | @@ -1,8 +1,6 @@ |
289 | -YUI.add('lp.picker', function(Y) { |
290 | - |
291 | -Y.log('loading lp.picker'); |
292 | - |
293 | -var module = Y.namespace('lp.picker'); |
294 | +YUI.add('lp.app.picker', function(Y) { |
295 | + |
296 | +var namespace = Y.namespace('lp.app.picker'); |
297 | |
298 | var BATCH_SIZE = 6; |
299 | var MAX_BATCHES = 20; |
300 | @@ -24,7 +22,7 @@ |
301 | * config.step_title overrides the subtitle. |
302 | * description strings. |
303 | */ |
304 | -module.addPickerPatcher = function ( |
305 | +namespace.addPickerPatcher = function ( |
306 | vocabulary, resource_uri, attribute_name, |
307 | content_box_id, show_remove_button, show_assign_me_button, config) { |
308 | |
309 | @@ -151,7 +149,7 @@ |
310 | }; |
311 | |
312 | config.save = save; |
313 | - var picker = module.create(vocabulary, config); |
314 | + var picker = namespace.create(vocabulary, config); |
315 | picker._resource_uri = resource_uri; |
316 | var extra_buttons = Y.Node.create( |
317 | '<div style="text-align: center; height: 3em; ' + |
318 | @@ -200,7 +198,7 @@ |
319 | * config.save is a Function (optional) which takes |
320 | * a single string argument. |
321 | */ |
322 | -module.create = function (vocabulary, config) { |
323 | +namespace.create = function (vocabulary, config) { |
324 | if (Y.UA.ie) { |
325 | return; |
326 | } |
327 | |
328 | === modified file 'lib/lp/app/templates/base-layout-macros.pt' |
329 | --- lib/lp/app/templates/base-layout-macros.pt 2010-06-29 15:42:35 +0000 |
330 | +++ lib/lp/app/templates/base-layout-macros.pt 2010-07-16 10:55:11 +0000 |
331 | @@ -171,15 +171,15 @@ |
332 | tal:attributes="src string:${lazr_js}/effects/effects.js"></script> |
333 | |
334 | <script type="text/javascript" |
335 | - tal:attributes="src string:${lp_js}/lp/lp.js"></script> |
336 | - <script type="text/javascript" |
337 | - tal:attributes="src string:${lp_js}/lp/lp-mochi.js"></script> |
338 | - <script type="text/javascript" |
339 | - tal:attributes="src string:${lp_js}/lp/dragscroll.js"></script> |
340 | - <script type="text/javascript" |
341 | - tal:attributes="src string:${lp_js}/lp/picker.js"></script> |
342 | - <script type="text/javascript" |
343 | - tal:attributes="src string:${lp_js}/lp/mapping.js"></script> |
344 | + tal:attributes="src string:${lp_js}/app/lp.js"></script> |
345 | + <script type="text/javascript" |
346 | + tal:attributes="src string:${lp_js}/app/lp-mochi.js"></script> |
347 | + <script type="text/javascript" |
348 | + tal:attributes="src string:${lp_js}/app/dragscroll.js"></script> |
349 | + <script type="text/javascript" |
350 | + tal:attributes="src string:${lp_js}/app/picker.js"></script> |
351 | + <script type="text/javascript" |
352 | + tal:attributes="src string:${lp_js}/app/mapping.js"></script> |
353 | <script type="text/javascript" |
354 | tal:attributes="src string:${lp_js}/bugs/bugtracker_overlay.js"></script> |
355 | <script type="text/javascript" |
356 | @@ -217,9 +217,9 @@ |
357 | tal:attributes="src string:${lp_js}/code/productseries-setbranch.js"> |
358 | </script> |
359 | <script type="text/javascript" |
360 | - tal:attributes="src string:${lp_js}/lp/comment.js"></script> |
361 | + tal:attributes="src string:${lp_js}/app/comment.js"></script> |
362 | <script type="text/javascript" |
363 | - tal:attributes="src string:${lp_js}/lp/errors.js"></script> |
364 | + tal:attributes="src string:${lp_js}/app/errors.js"></script> |
365 | <script type="text/javascript" |
366 | tal:attributes="src string:${lp_js}/registry/team.js"></script> |
367 | |
368 | |
369 | === modified file 'lib/lp/bugs/javascript/bugtask_index.js' |
370 | --- lib/lp/bugs/javascript/bugtask_index.js 2010-07-11 00:32:53 +0000 |
371 | +++ lib/lp/bugs/javascript/bugtask_index.js 2010-07-16 10:55:11 +0000 |
372 | @@ -110,7 +110,7 @@ |
373 | } |
374 | }; |
375 | error_handler.showError = function(error_msg) { |
376 | - Y.lp.display_error(Y.one('.menu-link-addsubscriber'), error_msg); |
377 | + Y.lp.app.errors.display_error(Y.one('.menu-link-addsubscriber'), error_msg); |
378 | }; |
379 | |
380 | var config = { |
381 | @@ -255,7 +255,7 @@ |
382 | config.save = function(result) { |
383 | subscribe_someone_else(result, subscription); |
384 | }; |
385 | - var picker = Y.lp.picker.create('ValidPersonOrTeam', config); |
386 | + var picker = Y.lp.app.picker.create('ValidPersonOrTeam', config); |
387 | } |
388 | |
389 | /* |
390 | @@ -581,7 +581,7 @@ |
391 | link_branch_link.toggleClass('update-in-progress-message'); |
392 | }; |
393 | error_handler.showError = function(error_msg) { |
394 | - display_error(Y.one('.menu-link-addsubscriber'), error_msg); |
395 | + Y.lp.app.errors.display_error(Y.one('.menu-link-addsubscriber'), error_msg); |
396 | }; |
397 | |
398 | function get_branch_and_link_to_bug(data) { |
399 | @@ -608,7 +608,7 @@ |
400 | }; |
401 | |
402 | config.save = get_branch_and_link_to_bug; |
403 | - var picker = Y.lp.picker.create('Branch', config); |
404 | + var picker = Y.lp.app.picker.create('Branch', config); |
405 | } |
406 | } |
407 | |
408 | @@ -623,7 +623,7 @@ |
409 | link_branch_link.toggleClass('update-in-progress-message'); |
410 | }; |
411 | error_handler.showError = function(error_msg) { |
412 | - display_error(Y.one('.menu-link-addsubscriber'), error_msg); |
413 | + Y.lp.app.errors.display_error(Y.one('.menu-link-addsubscriber'), error_msg); |
414 | }; |
415 | |
416 | // Call linkBranch() on the bug. |
417 | @@ -1086,7 +1086,7 @@ |
418 | }; |
419 | error_handler.showError = function (error_msg) { |
420 | var flash_node = Y.one('.' + person.get('css_name')); |
421 | - Y.lp.display_error(flash_node, error_msg); |
422 | + Y.lp.app.errors.display_error(flash_node, error_msg); |
423 | |
424 | }; |
425 | |
426 | @@ -1161,7 +1161,7 @@ |
427 | subscription.disable_spinner(); |
428 | }; |
429 | error_handler.showError = function (error_msg) { |
430 | - Y.lp.display_error(subscription_link, error_msg); |
431 | + Y.lp.app.errors.display_error(subscription_link, error_msg); |
432 | }; |
433 | |
434 | var config = { |
435 | @@ -1218,7 +1218,7 @@ |
436 | subscription.disable_spinner(); |
437 | }; |
438 | error_handler.showError = function (error_msg) { |
439 | - Y.lp.display_error(subscription_link, error_msg); |
440 | + Y.lp.app.errors.display_error(subscription_link, error_msg); |
441 | }; |
442 | |
443 | var config = { |
444 | @@ -1313,7 +1313,7 @@ |
445 | ' class="sprite edit yui-activator-act" />'), |
446 | bugtarget_content.one('.yui-activator-act')); |
447 | } else { |
448 | - var bugtarget_picker = Y.lp.picker.addPickerPatcher( |
449 | + var bugtarget_picker = Y.lp.app.picker.addPickerPatcher( |
450 | 'Product', |
451 | conf.bugtask_path, |
452 | "target_link", |
453 | @@ -1336,7 +1336,7 @@ |
454 | backgroundColor: tr.hasClass('highlight') ? '#FFFF99' : '#FFFFFF' |
455 | }); |
456 | status_choice_edit.showError = function(err) { |
457 | - Y.lp.display_error(null, err); |
458 | + Y.lp.app.errors.display_error(null, err); |
459 | }; |
460 | status_choice_edit.on('save', function(e) { |
461 | var cb = status_choice_edit.get('contentBox'); |
462 | @@ -1368,7 +1368,7 @@ |
463 | backgroundColor: tr.hasClass('highlight') ? '#FFFF99' : '#FFFFFF' |
464 | }); |
465 | importance_choice_edit.showError = function(err) { |
466 | - Y.lp.display_error(null, err); |
467 | + Y.lp.app.errors.display_error(null, err); |
468 | }; |
469 | importance_choice_edit.on('save', function(e) { |
470 | var cb = importance_choice_edit.get('contentBox'); |
471 | @@ -1403,7 +1403,7 @@ |
472 | clickable_content: false |
473 | }); |
474 | milestone_choice_edit.showError = function(err) { |
475 | - Y.lp.display_error(null, err); |
476 | + Y.lp.app.errors.display_error(null, err); |
477 | }; |
478 | milestone_choice_edit.plug({ |
479 | fn: Y.lp.client.plugins.PATCHPlugin, cfg: { |
480 | @@ -1450,7 +1450,7 @@ |
481 | (conf.assignee_vocabulary == 'ValidAssignee') ? |
482 | "Search for people or teams" : |
483 | "Select a team of which you are a member"; |
484 | - var assignee_picker = Y.lp.picker.addPickerPatcher( |
485 | + var assignee_picker = Y.lp.app.picker.addPickerPatcher( |
486 | conf.assignee_vocabulary, |
487 | conf.bugtask_path, |
488 | "assignee_link", |
489 | @@ -1611,7 +1611,7 @@ |
490 | }, |
491 | |
492 | showError: function(err) { |
493 | - Y.lp.display_error(null, err); |
494 | + Y.lp.app.errors.display_error(null, err); |
495 | }, |
496 | |
497 | render: function() { |
498 | @@ -1664,7 +1664,7 @@ |
499 | function check_can_be_unsubscribed(subscription) { |
500 | var error_handler = new LP.client.ErrorHandler(); |
501 | error_handler.showError = function (error_msg) { |
502 | - Y.lp.display_error(Y.one('.menu-link-addsubscriber'), error_msg); |
503 | + Y.lp.app.errors.display_error(Y.one('.menu-link-addsubscriber'), error_msg); |
504 | }; |
505 | |
506 | var config = { |
507 | @@ -1733,7 +1733,7 @@ |
508 | |
509 | var error_handler = new LP.client.ErrorHandler(); |
510 | error_handler.showError = function(error_msg) { |
511 | - Y.lp.display_error(Y.one('.menu-link-addsubscriber'), error_msg); |
512 | + Y.lp.app.errors.display_error(Y.one('.menu-link-addsubscriber'), error_msg); |
513 | }; |
514 | |
515 | if (subscription.is_already_subscribed()) { |
516 | @@ -1873,5 +1873,5 @@ |
517 | }, "0.1", {"requires": ["base", "oop", "node", "event", "io-base", "json-parse", |
518 | "substitute", "widget-position-ext", "lazr.formoverlay", |
519 | "lazr.anim", "lazr.base", "lazr.overlay", |
520 | - "lazr.choiceedit", "lp.picker", "lp.client.plugins", |
521 | - "lp.bugs.subscriber", "lp.errors"]}); |
522 | + "lazr.choiceedit", "lp.app.picker", "lp.client.plugins", |
523 | + "lp.bugs.subscriber", "lp.app.errors"]}); |
524 | |
525 | === modified file 'lib/lp/bugs/javascript/bugtracker_overlay.js' |
526 | --- lib/lp/bugs/javascript/bugtracker_overlay.js 2010-06-21 04:08:54 +0000 |
527 | +++ lib/lp/bugs/javascript/bugtracker_overlay.js 2010-07-16 10:55:11 +0000 |
528 | @@ -127,5 +127,5 @@ |
529 | }; |
530 | |
531 | }, "0.1", {"requires": [ |
532 | - "dom", "node", "io-base", "lazr.anim", "lazr.formoverlay", "lp.calendar" |
533 | + "dom", "node", "io-base", "lazr.anim", "lazr.formoverlay", "lp.app.calendar" |
534 | ]}); |
535 | |
536 | === modified file 'lib/lp/bugs/templates/bugtask-index.pt' |
537 | --- lib/lp/bugs/templates/bugtask-index.pt 2010-07-13 14:08:24 +0000 |
538 | +++ lib/lp/bugs/templates/bugtask-index.pt 2010-07-16 10:55:11 +0000 |
539 | @@ -287,8 +287,8 @@ |
540 | button.style.display = 'none'; |
541 | </script> |
542 | <script type="text/javascript"> |
543 | - LPS.use('lp.comment', function(Y) { |
544 | - var comment = new Y.lp.Comment(); |
545 | + LPS.use('lp.app.comment', function(Y) { |
546 | + var comment = new Y.lp.app.comment.Comment(); |
547 | comment.render(); |
548 | }); |
549 | </script> |
550 | |
551 | === modified file 'lib/lp/code/javascript/branch.status.js' |
552 | --- lib/lp/code/javascript/branch.status.js 2010-03-01 19:22:51 +0000 |
553 | +++ lib/lp/code/javascript/branch.status.js 2010-07-16 10:55:11 +0000 |
554 | @@ -25,7 +25,7 @@ |
555 | title: 'Change status to', |
556 | items: conf.status_widget_items}); |
557 | status_choice_edit.showError = function(err) { |
558 | - display_error(null, err); |
559 | + Y.lp.app.errors.display_error(null, err); |
560 | }; |
561 | status_choice_edit.on('save', function(e) { |
562 | var cb = status_choice_edit.get('contentBox'); |
563 | |
564 | === modified file 'lib/lp/code/javascript/branchmergeproposal.reviewcomment.js' |
565 | --- lib/lp/code/javascript/branchmergeproposal.reviewcomment.js 2010-03-11 17:07:57 +0000 |
566 | +++ lib/lp/code/javascript/branchmergeproposal.reviewcomment.js 2010-07-16 10:55:11 +0000 |
567 | @@ -160,7 +160,7 @@ |
568 | var review_type = Y.one("[id=field.review_type]").get('value'); |
569 | request_reviewer(result, review_type); |
570 | }; |
571 | - reviewer_picker = Y.lp.picker.create('ValidPersonOrTeam', config); |
572 | + reviewer_picker = Y.lp.app.picker.create('ValidPersonOrTeam', config); |
573 | reviewer_picker.set('footer_slot', Y.Node.create([ |
574 | '<div>', |
575 | '<div style="float: left; padding-right: 9px;">', |
576 | @@ -280,4 +280,5 @@ |
577 | |
578 | namespace.NumberToggle = NumberToggle; |
579 | |
580 | -}, "0.1", {"requires": ["base", "widget", "lazr.anim", "lazr.formoverlay", "lp.picker"]}); |
581 | +}, "0.1", {"requires": ["base", "widget", "lazr.anim", |
582 | + "lazr.formoverlay", "lp.app.picker"]}); |
583 | |
584 | === modified file 'lib/lp/code/javascript/branchmergeproposal.status.js' |
585 | --- lib/lp/code/javascript/branchmergeproposal.status.js 2010-03-11 17:07:57 +0000 |
586 | +++ lib/lp/code/javascript/branchmergeproposal.status.js 2010-07-16 10:55:11 +0000 |
587 | @@ -24,7 +24,7 @@ |
588 | title: 'Change status to', |
589 | items: conf.status_widget_items}); |
590 | status_choice_edit.showError = function(err) { |
591 | - display_error(null, err); |
592 | + Y.lp.app.errors.display_error(null, err); |
593 | }; |
594 | status_choice_edit.on('save', function(e) { |
595 | config = { |
596 | |
597 | === modified file 'lib/lp/code/templates/branchmergeproposal-index.pt' |
598 | --- lib/lp/code/templates/branchmergeproposal-index.pt 2010-03-11 17:07:57 +0000 |
599 | +++ lib/lp/code/templates/branchmergeproposal-index.pt 2010-07-16 10:55:11 +0000 |
600 | @@ -229,13 +229,13 @@ |
601 | conf = <tal:status-config replace="view/status_config" /> |
602 | <!-- |
603 | LPS.use('io-base', 'lp.code.branchmergeproposal.reviewcomment', |
604 | - 'lp.code.branchmergeproposal.status', 'lp.comment', function(Y) { |
605 | + 'lp.code.branchmergeproposal.status', 'lp.app.comment', function(Y) { |
606 | |
607 | Y.on('load', function() { |
608 | var logged_in = LP.client.links['me'] !== undefined; |
609 | |
610 | if (logged_in) { |
611 | - var comment = new Y.lp.CodeReviewComment(); |
612 | + var comment = new Y.lp.app.comment.CodeReviewComment(); |
613 | comment.render(); |
614 | |
615 | if(Y.UA.ie) { |
616 | |
617 | === modified file 'lib/lp/registry/browser/person.py' |
618 | --- lib/lp/registry/browser/person.py 2010-07-14 21:49:53 +0000 |
619 | +++ lib/lp/registry/browser/person.py 2010-07-16 10:55:11 +0000 |
620 | @@ -3268,9 +3268,9 @@ |
621 | 'center_lng': self.context.longitude} |
622 | return u""" |
623 | <script type="text/javascript"> |
624 | - YUI().use('node', 'lp.mapping', function(Y) { |
625 | + YUI().use('node', 'lp.app.mapping', function(Y) { |
626 | function renderMap() { |
627 | - Y.lp.mapping.renderPersonMapSmall( |
628 | + Y.lp.app.mapping.renderPersonMapSmall( |
629 | %(center_lat)s, %(center_lng)s); |
630 | } |
631 | Y.on("domready", renderMap); |
632 | |
633 | === modified file 'lib/lp/registry/browser/team.py' |
634 | --- lib/lp/registry/browser/team.py 2010-05-21 17:04:28 +0000 |
635 | +++ lib/lp/registry/browser/team.py 2010-07-16 10:55:11 +0000 |
636 | @@ -1070,9 +1070,9 @@ |
637 | """HTML which shows the map with location of the team's members.""" |
638 | return """ |
639 | <script type="text/javascript"> |
640 | - YUI().use('node', 'lp.mapping', function(Y) { |
641 | + YUI().use('node', 'lp.app.mapping', function(Y) { |
642 | function renderMap() { |
643 | - Y.lp.mapping.renderTeamMap( |
644 | + Y.lp.app.mapping.renderTeamMap( |
645 | %(min_lat)s, %(max_lat)s, %(min_lng)s, |
646 | %(max_lng)s, %(center_lat)s, %(center_lng)s); |
647 | } |
648 | @@ -1085,9 +1085,9 @@ |
649 | """The HTML which shows a small version of the team's map.""" |
650 | return """ |
651 | <script type="text/javascript"> |
652 | - YUI().use('node', 'lp.mapping', function(Y) { |
653 | + YUI().use('node', 'lp.app.mapping', function(Y) { |
654 | function renderMap() { |
655 | - Y.lp.mapping.renderTeamMapSmall( |
656 | + Y.lp.app.mapping.renderTeamMapSmall( |
657 | %(center_lat)s, %(center_lng)s); |
658 | } |
659 | Y.on("domready", renderMap); |
660 | |
661 | === modified file 'lib/lp/registry/browser/tests/person-views.txt' |
662 | --- lib/lp/registry/browser/tests/person-views.txt 2010-07-14 16:27:33 +0000 |
663 | +++ lib/lp/registry/browser/tests/person-views.txt 2010-07-16 10:55:11 +0000 |
664 | @@ -356,7 +356,7 @@ |
665 | |
666 | >>> print person_view.map_portlet_html |
667 | <script type="text/javascript"> |
668 | - YUI().use('node', 'lp.mapping', function(Y) { ... |
669 | + YUI().use('node', 'lp.app.mapping', function(Y) { ... |
670 | |
671 | The small_maps key in the launchpad_views cookie can be set of the |
672 | viewing user to 'false' to indicate that small maps are not wanted. |
673 | @@ -371,7 +371,7 @@ |
674 | |
675 | >>> print person_view.map_portlet_html |
676 | <script type="text/javascript"> |
677 | - YUI().use('node', 'lp.mapping', function(Y) { ... |
678 | + YUI().use('node', 'lp.app.mapping', function(Y) { ... |
679 | |
680 | The map portlet is shown if the user has not set his location and is |
681 | viewing his own page. |
682 | |
683 | === modified file 'lib/lp/registry/javascript/milestoneoverlay.js' |
684 | --- lib/lp/registry/javascript/milestoneoverlay.js 2010-06-16 04:57:44 +0000 |
685 | +++ lib/lp/registry/javascript/milestoneoverlay.js 2010-07-16 10:55:11 +0000 |
686 | @@ -67,7 +67,7 @@ |
687 | }); |
688 | milestone_form.render(); |
689 | milestone_form.loadFormContentAndRender(milestone_form_uri); |
690 | - Y.lp.add_calendar_widgets(); |
691 | + Y.lp.app.calendar.add_calendar_widgets(); |
692 | milestone_form.show(); |
693 | }; |
694 | |
695 | @@ -118,5 +118,5 @@ |
696 | }; |
697 | |
698 | }, "0.1", {"requires": [ |
699 | - "dom", "node", "io-base", "lazr.anim", "lazr.formoverlay", "lp.calendar" |
700 | + "dom", "node", "io-base", "lazr.anim", "lazr.formoverlay", "lp.app.calendar" |
701 | ]}); |
702 | |
703 | === modified file 'lib/lp/registry/javascript/team.js' |
704 | --- lib/lp/registry/javascript/team.js 2010-04-29 15:21:05 +0000 |
705 | +++ lib/lp/registry/javascript/team.js 2010-07-16 10:55:11 +0000 |
706 | @@ -26,7 +26,7 @@ |
707 | }; |
708 | |
709 | config.save = _add_member; |
710 | - Y.lp.picker.create('ValidTeamMember', config); |
711 | + Y.lp.app.picker.create('ValidTeamMember', config); |
712 | }; |
713 | |
714 | var _add_member = function(selected_person) { |
715 | @@ -44,7 +44,7 @@ |
716 | var error_handler = new LP.client.ErrorHandler(); |
717 | error_handler.clearProgressUI = disable_spinner; |
718 | error_handler.showError = function(error_msg) { |
719 | - Y.lp.display_error(addmember_link, error_msg); |
720 | + Y.lp.app.errors.display_error(addmember_link, error_msg); |
721 | }; |
722 | |
723 | addmember_config = { |
724 | @@ -55,7 +55,7 @@ |
725 | var members_section, members_ul, count_elem; |
726 | if (did_status_change === false) { |
727 | disable_spinner(); |
728 | - Y.lp.display_info( |
729 | + Y.lp.app.errors.display_info( |
730 | selected_person.title + ' is already ' + |
731 | current_status.toLowerCase() + |
732 | ' as a member of the team.'); |
733 | @@ -75,7 +75,7 @@ |
734 | members_ul = box.query('#recently-approved-ul'); |
735 | count_elem = box.query('#approved-member-count'); |
736 | } else { |
737 | - Y.lp.display_error( |
738 | + Y.lp.app.errors.display_error( |
739 | addmember_link, |
740 | 'Unexpected status: ' + current_status); |
741 | return; |
742 | @@ -134,4 +134,4 @@ |
743 | }; |
744 | |
745 | }, '0.1', {requires: [ |
746 | - 'node', 'lazr.anim', 'lp.picker', 'lp.errors', 'lp.client.plugins']}); |
747 | + 'node', 'lazr.anim', 'lp.app.picker', 'lp.app.errors', 'lp.client.plugins']}); |
748 | |
749 | === modified file 'lib/lp/registry/stories/location/personlocation.txt' |
750 | --- lib/lp/registry/stories/location/personlocation.txt 2009-11-16 21:56:23 +0000 |
751 | +++ lib/lp/registry/stories/location/personlocation.txt 2010-07-16 10:55:11 +0000 |
752 | @@ -30,8 +30,8 @@ |
753 | >>> print extract_text(find_tag_by_id(markup, 'portlet-map'), skip_tags=[]) |
754 | Location |
755 | Time zone: Europe/London... |
756 | - Y.lp.mapping.renderPersonMapSmall(... |
757 | + Y.lp.app.mapping.renderPersonMapSmall(... |
758 | >>> 'src="http://maps.google.com/maps' in markup |
759 | True |
760 | - >>> 'build/lp/mapping.js' in markup |
761 | + >>> 'build/app/mapping.js' in markup |
762 | True |
763 | |
764 | === modified file 'lib/lp/registry/stories/location/team-map.txt' |
765 | --- lib/lp/registry/stories/location/team-map.txt 2010-06-24 20:22:57 +0000 |
766 | +++ lib/lp/registry/stories/location/team-map.txt 2010-07-16 10:55:11 +0000 |
767 | @@ -7,12 +7,12 @@ |
768 | >>> nopriv_browser.open('http://launchpad.dev/~guadamen') |
769 | >>> body = find_main_content(nopriv_browser.contents) |
770 | >>> mapdiv = find_tag_by_id(str(body), 'team_map_div') |
771 | - >>> 'lp.mapping.renderTeamMapSmall(' in str(body) |
772 | + >>> 'lp.app.mapping.renderTeamMapSmall(' in str(body) |
773 | True |
774 | >>> markup = str(nopriv_browser.contents) |
775 | >>> 'src="http://maps.google.com/maps' in markup |
776 | True |
777 | - >>> 'build/lp/mapping.js' in markup |
778 | + >>> 'build/app/mapping.js' in markup |
779 | True |
780 | |
781 | You should also be able to see a map of the team. |
782 | |
783 | === modified file 'lib/lp/registry/templates/object-timeline-graph.pt' |
784 | --- lib/lp/registry/templates/object-timeline-graph.pt 2010-04-29 15:21:05 +0000 |
785 | +++ lib/lp/registry/templates/object-timeline-graph.pt 2010-07-16 10:55:11 +0000 |
786 | @@ -34,7 +34,7 @@ |
787 | include_inactive = false; |
788 | } |
789 | |
790 | - LPS.use('lp.registry.timeline', 'node', 'lp.dragscroll', function(Y) { |
791 | + LPS.use('lp.registry.timeline', 'node', 'lp.app.dragscroll', function(Y) { |
792 | Y.on('domready', function(e) { |
793 | if (Y.UA.ie) { |
794 | return; |
795 | @@ -89,7 +89,7 @@ |
796 | }); |
797 | |
798 | var drag_scroll_handler = |
799 | - new Y.lp.dragscroll.DragScrollEventHandler(); |
800 | + new Y.lp.app.dragscroll.DragScrollEventHandler(); |
801 | drag_scroll_handler.activate(); |
802 | }); |
803 | }); |
804 | |
805 | === modified file 'lib/lp/registry/templates/teammembership-index.pt' |
806 | --- lib/lp/registry/templates/teammembership-index.pt 2010-01-15 13:36:09 +0000 |
807 | +++ lib/lp/registry/templates/teammembership-index.pt 2010-07-16 10:55:11 +0000 |
808 | @@ -20,7 +20,7 @@ |
809 | use-macro="context/@@launchpad_widget_macros/yui2calendar-dependencies" /> |
810 | |
811 | <script type="text/javascript"> |
812 | - LPS.use('node', 'lp.calendar', function(Y) { |
813 | + LPS.use('node', 'lp.app.calendar', function(Y) { |
814 | // Ensure that when the picker is used the radio button switches |
815 | // from 'Never' to 'On' and the expiry field is enabled. |
816 | Y.on("available", function(e) { |
817 | |
818 | === modified file 'lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt' |
819 | --- lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt 2010-03-08 18:01:33 +0000 |
820 | +++ lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt 2010-07-16 10:55:11 +0000 |
821 | @@ -54,7 +54,7 @@ |
822 | >>> print extract_all_script_and_style_links(cprov_browser.contents) |
823 | /... |
824 | ... |
825 | - http://launchpad.dev/+icing/.../build/lp/calendar.js |
826 | + http://launchpad.dev/+icing/.../build/app/calendar.js |
827 | http://launchpad.dev/+icing/.../yui_2.7.0b/build/calendar/assets/skins/sam/calendar.css |
828 | ... |
829 | |
830 | |
831 | === modified file 'lib/lp/translations/javascript/importqueue.js' |
832 | --- lib/lp/translations/javascript/importqueue.js 2010-05-18 18:04:00 +0000 |
833 | +++ lib/lp/translations/javascript/importqueue.js 2010-07-16 10:55:11 +0000 |
834 | @@ -122,7 +122,7 @@ |
835 | conf.contentBox = content_box; |
836 | var status_choice = new Y.ChoiceSource(conf); |
837 | status_choice.showError = function(err) { |
838 | - display_error(null, err); |
839 | + Y.lp.app.errors.display_error(null, err); |
840 | }; |
841 | var entry_id = content_box.ancestor(function(node){ |
842 | return node.hasClass('import_entry_row'); |
843 | @@ -187,4 +187,4 @@ |
844 | // "oop" and "event" are required to fix known bugs in YUI, which |
845 | // are apparently fixed in a later version. |
846 | "requires": ["oop", "event", "node", "widget", "plugin", "overlay", |
847 | - "lazr.choiceedit", "lp.client.plugins", "lp.errors"]}); |
848 | + "lazr.choiceedit", "lp.client.plugins", "lp.app.errors"]}); |
849 | |
850 | === modified file 'utilities/lp-deps.py' |
851 | --- utilities/lp-deps.py 2010-07-13 14:14:37 +0000 |
852 | +++ utilities/lp-deps.py 2010-07-16 10:55:11 +0000 |
853 | @@ -20,6 +20,7 @@ |
854 | # JS_DIRSET is a tuple of the dir where the code exists, and the name of the |
855 | # symlink it should be linked as in the icing build directory. |
856 | JS_DIRSET = [ |
857 | + (os.path.join('lib', 'lp', 'app', 'javascript'), 'app'), |
858 | (os.path.join('lib', 'lp', 'bugs', 'javascript'), 'bugs'), |
859 | (os.path.join('lib', 'lp', 'code', 'javascript'), 'code'), |
860 | (os.path.join('lib', 'lp', 'registry', 'javascript'), 'registry'), |
Yay.