Merge lp:~deryck/launchpad/bugs-js-names-and-path-move into lp:launchpad
- bugs-js-names-and-path-move
- Merge into devel
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Māris Fogels | ||||||||
Approved revision: | no longer in the source branch. | ||||||||
Merged at revision: | 11027 | ||||||||
Proposed branch: | lp:~deryck/launchpad/bugs-js-names-and-path-move | ||||||||
Merge into: | lp:launchpad | ||||||||
Diff against target: |
992 lines (+185/-152) 19 files modified
lib/lp/app/templates/base-layout-macros.pt (+14/-0) lib/lp/bugs/javascript/bug_tags_entry.js (+12/-12) lib/lp/bugs/javascript/bugtask_index.js (+40/-43) lib/lp/bugs/javascript/filebug_dupefinder.js (+7/-7) lib/lp/bugs/javascript/official_bug_tags.js (+5/-5) lib/lp/bugs/javascript/subscriber.js (+6/-5) lib/lp/bugs/javascript/tests/test_me_too.html (+17/-10) lib/lp/bugs/javascript/tests/test_me_too.js (+9/-3) lib/lp/bugs/javascript/tests/test_subscriber.html (+14/-12) lib/lp/bugs/javascript/tests/test_subscriber.js (+19/-12) lib/lp/bugs/templates/bug-portlet-subscribers.pt (+3/-3) lib/lp/bugs/templates/bugtarget-filebug-search.pt (+3/-2) lib/lp/bugs/templates/bugtarget-filebug-submit-bug.pt (+3/-2) lib/lp/bugs/templates/bugtask-index.pt (+5/-30) lib/lp/bugs/templates/bugtask-tasks-and-nominations-table-row.pt (+2/-2) lib/lp/bugs/templates/bugtasks-and-nominations-table.pt (+2/-2) lib/lp/bugs/templates/official-bug-target-manage-tags.pt (+2/-2) lib/lp/bugs/windmill/tests/test_yuitests.py (+21/-0) utilities/lp-deps.py (+1/-0) |
||||||||
To merge this branch: | bzr merge lp:~deryck/launchpad/bugs-js-names-and-path-move | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Māris Fogels (community) | Approve | ||
Review via email: mp+27646@code.launchpad.net |
Commit message
Move bugs JavaScript files to lp.bugs.javascript, fix up namespaces, and get js unit tests running via Windmill.
Description of the change
This branch moves the bugs JavaScript code into lp.bugs and also
updates the namespaces for bugs JavaScript modules. These issues
are bug 561586 and bug 513265. Most of this work is a pretty
straight forward move of files and updating the files to
correctly follow the namespacing and documentation rules in our
JavaScript style guide.
I did a couple of minor fixes not directly required by the style
guide, namely making sure the file names matched the module names
and moving linked files out of bugtask-index.pt and into
base-layout-
make lint output is a bit odd, but running ./bin/jslint manually
against the files confirms I'm lint free.
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
utilities/
== JSLint notices ==
jslint: 7 files to lint.
Traceback (most recent call last):
File "/home/
lazr.
File "/home/
sys.
File "/home/
fh = open(filename, 'r')
IOError: [Errno 2] No such file or directory: u'/home/
jslint: No problem found in '/home/
jslint: No problem found in '/home/
jslint: No problem found in '/home/
jslint: No problem found in '/home/
/home/deryck/
Deryck Hodge (deryck) wrote : | # |
Thanks for the test_yuitests.py suggestion, Maris. This is now done. I'm very excited about this, so thanks for telling me. I didn't realize we could hook up the js unit tests yet, but I knew there were talks about making this possible.
Cheers,
deryck
Preview Diff
1 | === modified file 'lib/lp/app/templates/base-layout-macros.pt' |
2 | --- lib/lp/app/templates/base-layout-macros.pt 2010-06-10 16:32:14 +0000 |
3 | +++ lib/lp/app/templates/base-layout-macros.pt 2010-06-17 14:36:35 +0000 |
4 | @@ -227,6 +227,20 @@ |
5 | tal:attributes="src string:${lp_js}/translations/languages.js"></script> |
6 | <script type="text/javascript" |
7 | tal:attributes="src string:${lp_js}/translations/pofile.js"></script> |
8 | + <script type="text/javascript" |
9 | + tal:attributes="src string:${lp_js}/bugs/filebug_dupefinder.js"> |
10 | + </script> |
11 | + <script type="text/javascript" |
12 | + tal:attributes="src string:${lp_js}/bugs/bug_tags_entry.js"> |
13 | + </script> |
14 | + <script type="text/javascript" |
15 | + tal:attributes="src string:${lp_js}/bugs/official_bug_tags.js"> |
16 | + </script> |
17 | + <script type="text/javascript" |
18 | + tal:attributes="src string:${lp_js}/bugs/subscriber.js"></script> |
19 | + <script type="text/javascript" |
20 | + tal:attributes="src string:${lp_js}/bugs/bugtask_index.js"> |
21 | + </script> |
22 | |
23 | </tal:devmode> |
24 | <tal:production condition="not:devmode"> |
25 | |
26 | === renamed directory 'lib/canonical/launchpad/javascript/bugs' => 'lib/lp/bugs/javascript' |
27 | === modified file 'lib/lp/bugs/javascript/bug_tags_entry.js' |
28 | --- lib/canonical/launchpad/javascript/bugs/bug_tags_entry.js 2009-11-24 09:30:01 +0000 |
29 | +++ lib/lp/bugs/javascript/bug_tags_entry.js 2010-06-17 14:36:35 +0000 |
30 | @@ -3,13 +3,13 @@ |
31 | * |
32 | * Inline bug tags entry with auto suggestion. |
33 | * |
34 | - * @module BugTagsEntry |
35 | - * @requires base, node, substitute |
36 | + * @module bugs |
37 | + * @submodule bug_tags_entry |
38 | */ |
39 | |
40 | -YUI.add('bugs.bug_tags_entry', function(Y) { |
41 | +YUI.add('lp.bugs.bug_tags_entry', function(Y) { |
42 | |
43 | -var bugs = Y.namespace('bugs'); |
44 | +var namespace = Y.namespace('lp.bugs.bug_tags_entry'); |
45 | |
46 | var bug_tags_div; |
47 | var edit_tags_trigger; |
48 | @@ -64,7 +64,7 @@ |
49 | var lp_client = new LP.client.Launchpad(); |
50 | var tags = Y.Array( |
51 | Y.Lang.trim(tag_input.get(VALUE)).split(new RegExp('\\s+'))).filter( |
52 | - function(elem) { return elem != ''; }); |
53 | + function(elem) { return elem !== ''; }); |
54 | var bug = new LP.client.Entry( |
55 | lp_client, LP.client.cache[BUG], LP.client.cache[BUG].self_link); |
56 | bug.removeAttr('http_etag'); |
57 | @@ -102,7 +102,7 @@ |
58 | edit_tags_trigger.setStyle(DISPLAY, INLINE); |
59 | tags_edit_spinner.setStyle(DISPLAY, NONE); |
60 | Y.lazr.anim.green_flash({ node: tag_list_span }).run(); |
61 | - if (Y.Lang.trim(tags_html) == '') { |
62 | + if (Y.Lang.trim(tags_html) === '') { |
63 | Y.one('#bug-tags').removeClass(TAGS_SHOW); |
64 | Y.one('#bug-tags').addClass(TAGS_HIDE); |
65 | Y.one('#add-bug-tags').removeClass(TAGS_HIDE); |
66 | @@ -128,9 +128,9 @@ |
67 | cancel_button.setStyle(DISPLAY, NONE); |
68 | edit_tags_trigger.setStyle(DISPLAY, INLINE); |
69 | tags_edit_spinner.setStyle(DISPLAY, NONE); |
70 | - autocomplete.hide() |
71 | + autocomplete.hide(); |
72 | Y.lazr.anim.red_flash({ node: tag_list_span }).run(); |
73 | - if (Y.Lang.trim(tag_list_span.get('innerHTML')) == '') { |
74 | + if (Y.Lang.trim(tag_list_span.get('innerHTML')) === '') { |
75 | Y.one('#bug-tags').removeClass(TAGS_SHOW); |
76 | Y.one('#bug-tags').addClass(TAGS_HIDE); |
77 | Y.one('#add-bug-tags').removeClass(TAGS_HIDE); |
78 | @@ -159,8 +159,8 @@ |
79 | * |
80 | * @method setup_tag_entry |
81 | */ |
82 | -bugs.setup_tag_entry = function(available_official_tags) { |
83 | - if (LP.client.links['me'] === undefined) { return; } |
84 | +namespace.setup_tag_entry = function(available_official_tags) { |
85 | + if (LP.client.links.me === undefined) { return; } |
86 | |
87 | available_tags = Y.Array(available_official_tags); |
88 | bug_tags_div = Y.one('#bug-tags'); |
89 | @@ -213,7 +213,7 @@ |
90 | // widget is set up, since the AutoComplete isn't needed to edit the |
91 | // tags inline. |
92 | add_tags_trigger.addClass('js-action'); |
93 | - edit_tags_trigger.addClass('js-action') |
94 | + edit_tags_trigger.addClass('js-action'); |
95 | |
96 | autocomplete = new Y.lazr.AutoComplete({ |
97 | input: '#tag-input', |
98 | @@ -224,7 +224,7 @@ |
99 | |
100 | autocomplete.on('queryChange', function(e) { |
101 | var val = "null"; |
102 | - if (e.newVal != null) { |
103 | + if (e.newVal !== null) { |
104 | val = "'" + e.newVal.text + "', " + e.newVal.offset; |
105 | } |
106 | }); |
107 | |
108 | === renamed file 'lib/canonical/launchpad/javascript/bugs/bugtask-index.js' => 'lib/lp/bugs/javascript/bugtask_index.js' |
109 | --- lib/canonical/launchpad/javascript/bugs/bugtask-index.js 2010-05-25 16:45:26 +0000 |
110 | +++ lib/lp/bugs/javascript/bugtask_index.js 2010-06-17 14:36:35 +0000 |
111 | @@ -3,13 +3,13 @@ |
112 | * |
113 | * Form overlay widgets and subscriber handling for bug pages. |
114 | * |
115 | - * @module BugtaskIndex |
116 | - * @requires base, node, lazr.formoverlay, lazr.anim |
117 | + * @module bugs |
118 | + * @submodule bugtask_index |
119 | */ |
120 | |
121 | -YUI.add('bugs.bugtask_index', function(Y) { |
122 | +YUI.add('lp.bugs.bugtask_index', function(Y) { |
123 | |
124 | -var bugs = Y.namespace('bugs'); |
125 | +var namespace = Y.namespace('lp.bugs.bugtask_index'); |
126 | |
127 | // lazr.FormOverlay objects. |
128 | var duplicate_form_overlay; |
129 | @@ -52,18 +52,18 @@ |
130 | */ |
131 | var PortletTarget = function() {}; |
132 | Y.augment(PortletTarget, Y.Event.Target); |
133 | -Y.bugs.portlet = new PortletTarget(); |
134 | -Y.bugs.portlet.subscribe('bugs:portletloaded', function() { |
135 | +namespace.portlet = new PortletTarget(); |
136 | +namespace.portlet.subscribe('bugs:portletloaded', function() { |
137 | load_subscriber_ids(); |
138 | }); |
139 | -Y.bugs.portlet.subscribe('bugs:dupeportletloaded', function() { |
140 | +namespace.portlet.subscribe('bugs:dupeportletloaded', function() { |
141 | setup_unsubscribe_icon_handlers(); |
142 | }); |
143 | /* |
144 | * If the subscribers portlet fails to load, clear any |
145 | * click handlers, so the normal subscribe page can be reached. |
146 | */ |
147 | -Y.bugs.portlet.subscribe('bugs:portletloadfailed', function(handlers) { |
148 | +namespace.portlet.subscribe('bugs:portletloadfailed', function(handlers) { |
149 | if (Y.Lang.isArray(handlers)) { |
150 | var click_handler = handlers[0]; |
151 | click_handler.detach(); |
152 | @@ -73,14 +73,14 @@ |
153 | * be sure to try to handle any unsub icons that may |
154 | * exist for others. |
155 | */ |
156 | -Y.bugs.portlet.subscribe('bugs:dupeportletloadfailed', function(handlers) { |
157 | +namespace.portlet.subscribe('bugs:dupeportletloadfailed', function(handlers) { |
158 | setup_unsubscribe_icon_handlers(); |
159 | }); |
160 | |
161 | /* If loading the subscriber IDs JSON has succeeded, set up the |
162 | * subscription link handlers and load the subscribers from dupes. |
163 | */ |
164 | -Y.bugs.portlet.subscribe('bugs:portletsubscriberidsloaded', function() { |
165 | +namespace.portlet.subscribe('bugs:portletsubscriberidsloaded', function() { |
166 | setup_subscription_link_handlers(); |
167 | load_subscribers_from_duplicates(); |
168 | }); |
169 | @@ -89,7 +89,7 @@ |
170 | * subscribers from duplicates but we don't set up the subscription link |
171 | * handlers. |
172 | */ |
173 | -Y.bugs.portlet.subscribe('bugs:portletsubscriberidsfailed', function() { |
174 | +namespace.portlet.subscribe('bugs:portletsubscriberidsfailed', function() { |
175 | load_subscribers_from_duplicates(); |
176 | }); |
177 | |
178 | @@ -100,7 +100,7 @@ |
179 | * before the subscribe work can be done, so fire a custom event |
180 | * bugs:nameloaded and do the work here when the event fires. |
181 | */ |
182 | -Y.bugs.portlet.subscribe('bugs:nameloaded', function(subscription) { |
183 | +namespace.portlet.subscribe('bugs:nameloaded', function(subscription) { |
184 | var error_handler = new LP.client.ErrorHandler(); |
185 | error_handler.clearProgressUI = function() { |
186 | var temp_link = Y.one('#temp-username'); |
187 | @@ -138,7 +138,7 @@ |
188 | lp_client.named_post(bug_repr.self_link, 'subscribe', config); |
189 | }); |
190 | |
191 | -Y.bugs.setup_bugtask_index = function() { |
192 | +namespace.setup_bugtask_index = function() { |
193 | /* |
194 | * Check the page for links related to overlay forms and request the HTML |
195 | * for these forms. |
196 | @@ -243,7 +243,7 @@ |
197 | * Initialize click handler for the subscribe someone else link. |
198 | * |
199 | * @method setup_subscribe_someone_else_handler |
200 | - * @param subscription {Object} A Y.lp.Subscription object. |
201 | + * @param subscription {Object} A Y.lp.bugs.subscriber.Subscription object. |
202 | */ |
203 | function setup_subscribe_someone_else_handler(subscription) { |
204 | var config = { |
205 | @@ -269,10 +269,10 @@ |
206 | } |
207 | |
208 | setup_client_and_bug(); |
209 | - var subscription = new Y.lp.Subscription({ |
210 | + var subscription = new Y.lp.bugs.subscriber.Subscription({ |
211 | link: Y.one('.menu-link-subscription'), |
212 | spinner: Y.one('#sub-unsub-spinner'), |
213 | - subscriber: new Y.lp.Subscriber({ |
214 | + subscriber: new Y.lp.bugs.subscriber.Subscriber({ |
215 | uri: LP.client.links.me, |
216 | subscriber_ids: subscriber_ids |
217 | }) |
218 | @@ -314,13 +314,13 @@ |
219 | * Set click handlers for unsubscribe remove icons. |
220 | * |
221 | * @method setup_unsubscribe_icon_handlers |
222 | - * @param subscription {Object} A Y.lp.Subscription object. |
223 | + * @param subscription {Object} A Y.lp.bugs.subscriber.Subscription object. |
224 | */ |
225 | function setup_unsubscribe_icon_handlers() { |
226 | - var subscription = new Y.lp.Subscription({ |
227 | + var subscription = new Y.lp.bugs.subscriber.Subscription({ |
228 | link: Y.get('.menu-link-subscription'), |
229 | spinner: Y.get('#sub-unsub-spinner'), |
230 | - subscriber: new Y.lp.Subscriber({ |
231 | + subscriber: new Y.lp.bugs.subscriber.Subscriber({ |
232 | uri: LP.client.links.me, |
233 | subscriber_ids: subscriber_ids |
234 | }) |
235 | @@ -723,7 +723,7 @@ |
236 | * Build the HTML for a user link for the subscribers list. |
237 | * |
238 | * @method build_user_link_html |
239 | - * @param subscription {Object} A Y.lp.Subscription object. |
240 | + * @param subscription {Object} A Y.lp.bugs.subscriber.Subscription object. |
241 | * @return html {String} The HTML used for creating a subscriber link. |
242 | */ |
243 | function build_user_link_html(subscription) { |
244 | @@ -983,7 +983,7 @@ |
245 | |
246 | // Fire a custom event to know it's safe to begin |
247 | // any actual subscribing work. |
248 | - Y.bugs.portlet.fire('bugs:nameloaded', subscription); |
249 | + namespace.portlet.fire('bugs:nameloaded', subscription); |
250 | } |
251 | |
252 | /* |
253 | @@ -1049,14 +1049,14 @@ |
254 | * |
255 | * @method unsubscribe_user_via_icon |
256 | * @param icon {Node} The remove icon that was clicked. |
257 | - * @param subscription {Object} A Y.lp.Subscription object. |
258 | + * @param subscription {Object} A Y.lp.bugs.subscriber.Subscription object. |
259 | */ |
260 | function unsubscribe_user_via_icon(icon, subscription) { |
261 | icon.set('src', '/@@/spinner'); |
262 | var icon_parent = icon.get('parentNode'); |
263 | |
264 | var user_uri = get_user_uri_from_icon(icon); |
265 | - var person = new Y.lp.Subscriber({ |
266 | + var person = new Y.lp.bugs.subscriber.Subscriber({ |
267 | uri: user_uri, |
268 | subscriber_ids: subscriber_ids |
269 | }); |
270 | @@ -1149,7 +1149,7 @@ |
271 | * Subscribe the current user via the LP API. |
272 | * |
273 | * @method subscribe_current_user |
274 | - * @param subscription {Object} A Y.lp.Subscription object. |
275 | + * @param subscription {Object} A Y.lp.bugs.subscriber.Subscription object. |
276 | */ |
277 | function subscribe_current_user(subscription) { |
278 | subscription.enable_spinner('Subscribing...'); |
279 | @@ -1206,7 +1206,7 @@ |
280 | * Unsubscribe the current user via the LP API. |
281 | * |
282 | * @method unsubscribe_current_user |
283 | - * @param subscription {Object} A Y.lp.Subscription object. |
284 | + * @param subscription {Object} A Y.lp.bugs.subscriber.Subscription object. |
285 | */ |
286 | function unsubscribe_current_user(subscription) { |
287 | subscription.enable_spinner('Unsubscribing...'); |
288 | @@ -1275,7 +1275,7 @@ |
289 | * |
290 | * @method setup_bugtasks_row |
291 | */ |
292 | -bugs.setup_bugtask_row = function(conf) { |
293 | +namespace.setup_bugtask_row = function(conf) { |
294 | if (Y.UA.ie) { |
295 | return; |
296 | } |
297 | @@ -1484,7 +1484,7 @@ |
298 | * |
299 | * @method setup_me_too |
300 | */ |
301 | -bugs.setup_me_too = function(user_is_affected, others_affected_count) { |
302 | +namespace.setup_me_too = function(user_is_affected, others_affected_count) { |
303 | // IE (7 & 8 tested) is stupid, stupid, stupid. |
304 | if (Y.UA.ie) { |
305 | return; |
306 | @@ -1552,7 +1552,7 @@ |
307 | }; |
308 | |
309 | // Put this in the bugs namespace so it can be accessed for testing. |
310 | -bugs._MeTooChoiceSource = MeTooChoiceSource; |
311 | +namespace._MeTooChoiceSource = MeTooChoiceSource; |
312 | |
313 | Y.extend(MeTooChoiceSource, Y.ChoiceSource, { |
314 | initializer: function() { |
315 | @@ -1659,7 +1659,7 @@ |
316 | * cannot be used. |
317 | * |
318 | * @method check_can_be_unsubscribed |
319 | - * @param subscription {Object} A Y.lp.Subscription object. |
320 | + * @param subscription {Object} A Y.lp.bugs.subscriber.Subscription object. |
321 | */ |
322 | function check_can_be_unsubscribed(subscription) { |
323 | var error_handler = new LP.client.ErrorHandler(); |
324 | @@ -1724,7 +1724,7 @@ |
325 | * @result {Object} The object representing a person returned by the API. |
326 | */ |
327 | function subscribe_someone_else(result, subscription) { |
328 | - var person = new Y.lp.Subscriber({ |
329 | + var person = new Y.lp.bugs.subscriber.Subscriber({ |
330 | uri: result.api_uri, |
331 | display_name: result.title, |
332 | subscriber_ids: subscriber_ids |
333 | @@ -1778,7 +1778,7 @@ |
334 | 'display', 'none'); |
335 | // Fire a custom event to signal failure, so that |
336 | // any remaining unsub icons can be hooked up. |
337 | - Y.bugs.portlet.fire('bugs:dupeportletloadfailed'); |
338 | + namespace.portlet.fire('bugs:dupeportletloadfailed'); |
339 | } |
340 | |
341 | function on_success(transactionid, response, args) { |
342 | @@ -1793,7 +1793,7 @@ |
343 | |
344 | // Fire a custom portlet loaded event to notify when |
345 | // it's safe to setup dupe subscriber link callbacks. |
346 | - Y.bugs.portlet.fire('bugs:dupeportletloaded'); |
347 | + namespace.portlet.fire('bugs:dupeportletloaded'); |
348 | } |
349 | |
350 | var config = {on: {success: on_success, |
351 | @@ -1804,7 +1804,7 @@ |
352 | Y.io(url, config); |
353 | } |
354 | |
355 | -Y.bugs.load_subscribers_portlet = function( |
356 | +namespace.load_subscribers_portlet = function( |
357 | subscription_link, subscription_link_handler) { |
358 | if (Y.UA.ie) { |
359 | return null; |
360 | @@ -1817,8 +1817,8 @@ |
361 | // Fire a custom event to notify that the initial click |
362 | // handler on subscription_link set above should be |
363 | // cleared. |
364 | - if (Y.bugs) { |
365 | - Y.bugs.portlet.fire( |
366 | + if (namespace) { |
367 | + namespace.portlet.fire( |
368 | 'bugs:portletloadfailed', subscription_link_handler); |
369 | } |
370 | } |
371 | @@ -1831,7 +1831,7 @@ |
372 | |
373 | // Fire a custom portlet loaded event to notify when |
374 | // it's safe to setup subscriber link callbacks. |
375 | - Y.bugs.portlet.fire('bugs:portletloaded'); |
376 | + namespace.portlet.fire('bugs:portletloaded'); |
377 | } |
378 | |
379 | var config = {on: {success: setup_portlet, |
380 | @@ -1846,24 +1846,21 @@ |
381 | function on_success(transactionid, response, args) { |
382 | try { |
383 | subscriber_ids = Y.JSON.parse(response.responseText); |
384 | - Y.log("Loaded subscriber IDs."); |
385 | |
386 | // Fire a custom event to trigger the setting-up of the |
387 | // subscription handlers. |
388 | - Y.bugs.portlet.fire('bugs:portletsubscriberidsloaded'); |
389 | + namespace.portlet.fire('bugs:portletsubscriberidsloaded'); |
390 | } catch (e) { |
391 | - Y.log("Unable to load subscriber ids.", "error"); |
392 | - |
393 | // Fire an event to signal failure. This ensures that the |
394 | // subscribers-from-dupes still get loaded into the portlet. |
395 | - Y.bugs.portlet.fire('bugs:portletsubscriberidsfailed'); |
396 | + namespace.portlet.fire('bugs:portletsubscriberidsfailed'); |
397 | } |
398 | } |
399 | |
400 | function on_failure() { |
401 | // Fire an event to signal failure. This ensures that the |
402 | // subscribers-from-dupes still get loaded into the portlet. |
403 | - Y.bugs.portlet.fire('bugs:portletsubscriberidsfailed'); |
404 | + namespace.portlet.fire('bugs:portletsubscriberidsfailed'); |
405 | } |
406 | |
407 | var config = {on: {success: on_success, |
408 | @@ -1877,4 +1874,4 @@ |
409 | "substitute", "widget-position-ext", "lazr.formoverlay", |
410 | "lazr.anim", "lazr.base", "lazr.overlay", |
411 | "lazr.choiceedit", "lp.picker", "lp.client.plugins", |
412 | - "lp.subscriber", "lp.errors"]}); |
413 | + "lp.bugs.subscriber", "lp.errors"]}); |
414 | |
415 | === renamed file 'lib/canonical/launchpad/javascript/bugs/filebug-dupefinder.js' => 'lib/lp/bugs/javascript/filebug_dupefinder.js' |
416 | --- lib/canonical/launchpad/javascript/bugs/filebug-dupefinder.js 2009-12-11 11:09:35 +0000 |
417 | +++ lib/lp/bugs/javascript/filebug_dupefinder.js 2010-06-17 14:36:35 +0000 |
418 | @@ -3,10 +3,10 @@ |
419 | * |
420 | * Handling of form overlay widgets for bug pages. |
421 | * |
422 | - * @module DupeFinder |
423 | - * @requires base, node |
424 | + * @module bugs |
425 | + * @submodule filebug_dupefinder |
426 | */ |
427 | -YUI.add('bugs.dupe_finder', function(Y) { |
428 | +YUI.add('lp.bugs.filebug_dupefinder', function(Y) { |
429 | |
430 | var BLOCK = 'block', |
431 | DISPLAY = 'display', |
432 | @@ -19,7 +19,7 @@ |
433 | SRC = 'src', |
434 | UNSEEN = 'unseen'; |
435 | |
436 | -var bugs = Y.namespace('bugs'); |
437 | +var namespace = Y.namespace('lp.bugs.filebug_dupefinder'); |
438 | |
439 | /* |
440 | * The NodeList of possible duplicates. |
441 | @@ -170,7 +170,7 @@ |
442 | if (bug_already_reported_expanders.size() > 0) { |
443 | // If there are duplicates shown, set up the JavaScript of |
444 | // the duplicates that have been returned. |
445 | - Y.bugs.setup_dupes(); |
446 | + Y.lp.bugs.filebug_dupefinder.setup_dupes(); |
447 | } else { |
448 | // Otherwise, show the bug reporting form. |
449 | show_bug_reporting_form(); |
450 | @@ -370,7 +370,7 @@ |
451 | }); |
452 | } |
453 | |
454 | -Y.bugs.setup_dupes = function() { |
455 | +namespace.setup_dupes = function() { |
456 | bug_already_reported_expanders = Y.all( |
457 | 'img.bug-already-reported-expander'); |
458 | bug_reporting_form = Y.one('#bug_reporting_form'); |
459 | @@ -465,7 +465,7 @@ |
460 | }); |
461 | }; |
462 | |
463 | -Y.bugs.setup_dupe_finder = function() { |
464 | +namespace.setup_dupe_finder = function() { |
465 | Y.log("In setup_dupe_finder"); |
466 | Y.on('domready', function() { |
467 | config = {on: {success: set_up_dupe_finder, |
468 | |
469 | === renamed file 'lib/canonical/launchpad/javascript/bugs/offical_bug_tags.js' => 'lib/lp/bugs/javascript/official_bug_tags.js' |
470 | --- lib/canonical/launchpad/javascript/bugs/offical_bug_tags.js 2009-12-22 14:11:11 +0000 |
471 | +++ lib/lp/bugs/javascript/official_bug_tags.js 2010-06-17 14:36:35 +0000 |
472 | @@ -3,13 +3,13 @@ |
473 | * |
474 | * Official bug tags management user interface. |
475 | * |
476 | - * @module OfficialBugTagManagement |
477 | - * @requires base, node, substitute |
478 | + * @module bugs |
479 | + * @submodule official_bug_tags |
480 | */ |
481 | |
482 | -YUI.add('bugs.official_bug_tag_management', function(Y) { |
483 | +YUI.add('lp.bugs.official_bug_tags', function(Y) { |
484 | |
485 | -var bugs = Y.namespace('bugs'); |
486 | +var namespace = Y.namespace('lp.bugs.official_bug_tags'); |
487 | |
488 | /* |
489 | * official_tags and other_tags hold the lists of tags currently in use. |
490 | @@ -370,7 +370,7 @@ |
491 | * |
492 | * @method setup_official_bug_tag_management |
493 | */ |
494 | -bugs.setup_official_bug_tag_management = function() { |
495 | +namespace.setup_official_bug_tag_management = function() { |
496 | official_tags = get_official_bug_tags(official_bug_tags); |
497 | other_tags = get_other_bug_tags(used_bug_tags); |
498 | |
499 | |
500 | === modified file 'lib/lp/bugs/javascript/subscriber.js' |
501 | --- lib/canonical/launchpad/javascript/bugs/subscriber.js 2009-12-08 12:00:49 +0000 |
502 | +++ lib/lp/bugs/javascript/subscriber.js 2010-06-17 14:36:35 +0000 |
503 | @@ -2,12 +2,13 @@ |
504 | * |
505 | * Objects for subscription handling. |
506 | * |
507 | - * @module lp.subscriber |
508 | + * @module bugs |
509 | + * @submodule subscriber |
510 | */ |
511 | |
512 | -YUI.add('lp.subscriber', function(Y) { |
513 | +YUI.add('lp.bugs.subscriber', function(Y) { |
514 | |
515 | -Y.namespace('lp'); |
516 | +var namespace = Y.namespace('lp.bugs.subscriber'); |
517 | |
518 | /** |
519 | * A Subscription object which represents the subscription |
520 | @@ -176,7 +177,7 @@ |
521 | } |
522 | }); |
523 | |
524 | -Y.lp.Subscription = Subscription; |
525 | +namespace.Subscription = Subscription; |
526 | |
527 | /** A Subscriber object which can represent the subscribing person or |
528 | * the person being subscribed. |
529 | @@ -365,6 +366,6 @@ |
530 | |
531 | }); |
532 | |
533 | -Y.lp.Subscriber = Subscriber; |
534 | +namespace.Subscriber = Subscriber; |
535 | |
536 | }, "0.1", {"requires": ["base", "node"]}); |
537 | |
538 | === modified file 'lib/lp/bugs/javascript/tests/test_me_too.html' |
539 | --- lib/canonical/launchpad/javascript/bugs/tests/test_me_too.html 2010-02-27 16:11:06 +0000 |
540 | +++ lib/lp/bugs/javascript/tests/test_me_too.html 2010-06-17 14:36:35 +0000 |
541 | @@ -4,25 +4,32 @@ |
542 | <title>Status Editor</title> |
543 | |
544 | <!-- YUI 3.0 Setup --> |
545 | - <script type="text/javascript" src="../../../../../../lazr-js/build/yui/yui/yui.js"></script> |
546 | - <link rel="stylesheet" href="../../../../../../lazr-js/build/yui/cssreset/reset.css"/> |
547 | - <link rel="stylesheet" href="../../../../../../lazr-js/build/yui/cssfonts/fonts.css"/> |
548 | - <link rel="stylesheet" href="../../../../../../lazr-js/build/yui/cssbase/base.css"/> |
549 | + <script type="text/javascript" src="../../../../canonical/launchpad/icing/yui/yui/yui.js"></script> |
550 | + <link rel="stylesheet" href="../../../../canonical/launchpad/icing/yui/cssreset/reset.css"/> |
551 | + <link rel="stylesheet" href="../../../../canonical/launchpad/icing/yui/cssfonts/fonts.css"/> |
552 | + <link rel="stylesheet" href="../../../../canonical/launchpad/icing/yui/cssbase/base.css"/> |
553 | |
554 | <!-- Dependency --> |
555 | - <script type="text/javascript" src="../../../../../../lazr-js/build/lazr.js"></script> |
556 | - <script type="text/javascript" src="../../../../../../lazr-js/build/overlay/overlay.js"></script> |
557 | - <script type="text/javascript" src="../../../../../../lazr-js/build/choiceedit/choiceedit.js"></script> |
558 | - <script type="text/javascript" src="../../../javascript/client/client.js"></script> |
559 | + <script type="text/javascript" |
560 | + src="../../../../canonical/launchpad/icing/lazr/build/lazr.js"></script> |
561 | + <script type="text/javascript" |
562 | + src="../../../../canonical/launchpad/icing/lazr/build/overlay/overlay.js"> |
563 | + </script> |
564 | + <script type="text/javascript" |
565 | + src="../../../../canonical/launchpad/icing/lazr/build/choiceedit/choiceedit.js"> |
566 | + </script> |
567 | + <script type="text/javascript" |
568 | + src="../../../../canonical/launchpad/javascript/client/client.js"></script> |
569 | |
570 | <!-- The module under test --> |
571 | - <script type="text/javascript" src="../bugtask-index.js"></script> |
572 | + <script type="text/javascript" src="../bugtask_index.js"></script> |
573 | |
574 | <!-- The test suite --> |
575 | <script type="text/javascript" src="test_me_too.js"></script> |
576 | |
577 | <!-- Test layout --> |
578 | - <link rel="stylesheet" href="../../test.css" /> |
579 | + <link rel="stylesheet" |
580 | + href="../../../../canonical/launchpad/javascript/test.css" /> |
581 | <style type="text/css"> |
582 | /* CSS classes specific to this test */ |
583 | .unseen { display: none; } |
584 | |
585 | === modified file 'lib/lp/bugs/javascript/tests/test_me_too.js' |
586 | --- lib/canonical/launchpad/javascript/bugs/tests/test_me_too.js 2010-02-27 18:53:21 +0000 |
587 | +++ lib/lp/bugs/javascript/tests/test_me_too.js 2010-06-17 14:36:35 +0000 |
588 | @@ -1,10 +1,10 @@ |
589 | /* Copyright (c) 2008, Canonical Ltd. All rights reserved. */ |
590 | |
591 | YUI({ |
592 | - base: '../../../../../../lazr-js/build/yui/', |
593 | + base: '../../../../canonical/launchpad/icing/yui/', |
594 | filter: 'raw', |
595 | combine: false |
596 | - }).use('event', 'bugs.bugtask_index', 'node', 'test', 'widget-stack', 'console', |
597 | + }).use('event', 'lp.bugs.bugtask_index', 'node', 'test', 'widget-stack', 'console', |
598 | function(Y) { |
599 | |
600 | // Local aliases |
601 | @@ -74,7 +74,7 @@ |
602 | contentBox: me_too_content, value: null, |
603 | elementToFlash: me_too_content, others_affected_count: 5 |
604 | }; |
605 | - this.choice_edit = new Y.bugs._MeTooChoiceSource(this.config); |
606 | + this.choice_edit = new Y.lp.bugs.bugtask_index._MeTooChoiceSource(this.config); |
607 | this.choice_edit.render(); |
608 | }, |
609 | |
610 | @@ -210,6 +210,12 @@ |
611 | |
612 | })); |
613 | |
614 | +var handle_complete = function(data) { |
615 | + status_node = Y.Node.create( |
616 | + '<p id="complete">Test status: complete</p>'); |
617 | + Y.get('body').appendChild(status_node); |
618 | + }; |
619 | +Y.Test.Runner.on('complete', handle_complete); |
620 | Y.Test.Runner.add(suite); |
621 | |
622 | var yconsole = new Y.Console({ |
623 | |
624 | === renamed file 'lib/canonical/launchpad/javascript/bugs/tests/subscriber.html' => 'lib/lp/bugs/javascript/tests/test_subscriber.html' |
625 | --- lib/canonical/launchpad/javascript/bugs/tests/subscriber.html 2010-02-27 18:57:38 +0000 |
626 | +++ lib/lp/bugs/javascript/tests/test_subscriber.html 2010-06-17 14:36:35 +0000 |
627 | @@ -4,17 +4,17 @@ |
628 | |
629 | <!-- YUI 3.0 Setup --> |
630 | <script type="text/javascript" |
631 | - src="../../../../../../lazr-js/build/yui/yui/yui.js"></script> |
632 | + src="../../../../canonical/launchpad/icing/yui/yui/yui.js"></script> |
633 | <script type="text/javascript" |
634 | - src="../../../../../../lazr-js/build/lazr.js"></script> |
635 | - <link rel="stylesheet" |
636 | - href="../../../../../../lazr-js/build/yui/cssreset/reset.css"/> |
637 | - <link rel="stylesheet" |
638 | - href="../../../../../../lazr-js/build/yui/cssfonts/fonts.css"/> |
639 | - <link rel="stylesheet" |
640 | - href="../../../../../../lazr-js/build/yui/cssbase/base.css"/> |
641 | - <link rel="stylesheet" |
642 | - href="../../test.css" /> |
643 | + src="../../../../canonical/launchpad/icing/lazr/build/lazr.js"></script> |
644 | + <link rel="stylesheet" |
645 | + href="../../../../canonical/launchpad/icing/yui/cssreset/reset.css"/> |
646 | + <link rel="stylesheet" |
647 | + href="../../../../canonical/launchpad/icing/yui/cssfonts/fonts.css"/> |
648 | + <link rel="stylesheet" |
649 | + href="../../../../canonical/launchpad/icing/yui/cssbase/base.css"/> |
650 | + <link rel="stylesheet" |
651 | + href="../../../../canonical/launchpad/javascript/test.css" /> |
652 | |
653 | <!-- The module under test --> |
654 | <script type="text/javascript" |
655 | @@ -59,7 +59,8 @@ |
656 | <a href="+subscribe" |
657 | class="subscribed-true dup-subscribed-false" |
658 | id="unsubscribe-tester" title="Unsubscribe JS Test User"> |
659 | - <img class="unsub-icon" src="../../../images/remove.png" |
660 | + <img class="unsub-icon" |
661 | + src="../../../../canonical/launchpad/images/remove.png" |
662 | id="unsubscribe-icon-tester"> |
663 | </a> |
664 | </div> |
665 | @@ -74,7 +75,8 @@ |
666 | <a href="+subscribe" |
667 | class="subscribed-true dup-subscribed-false" |
668 | id="unsubscribe-some-team" title="Unsubscribe Some Team"> |
669 | - <img class="unsub-icon" src="../../../images/remove.png" |
670 | + <img class="unsub-icon" |
671 | + src="../../../../canonical/launchpad/images/remove.png" |
672 | id="unsubscribe-icon-some-team"> |
673 | </a> |
674 | </div> |
675 | |
676 | === modified file 'lib/lp/bugs/javascript/tests/test_subscriber.js' |
677 | --- lib/canonical/launchpad/javascript/bugs/tests/test_subscriber.js 2010-02-27 18:57:38 +0000 |
678 | +++ lib/lp/bugs/javascript/tests/test_subscriber.js 2010-06-17 14:36:35 +0000 |
679 | @@ -1,9 +1,9 @@ |
680 | YUI({ |
681 | - base: '../../../../../../lazr-js/build/yui/', |
682 | + base: '../../../../canonical/launchpad/icing/yui/', |
683 | filter: 'raw', combine: false |
684 | - }).use('test', 'console', 'lp.subscriber', function(Y) { |
685 | + }).use('test', 'console', 'lp.bugs.subscriber', function(Y) { |
686 | |
687 | -var suite = new Y.Test.Suite("lp.subscriber Tests"); |
688 | +var suite = new Y.Test.Suite("lp.bugs.subscriber Tests"); |
689 | |
690 | /* |
691 | * Test that all the parts of the user name |
692 | @@ -16,7 +16,7 @@ |
693 | this.config = { |
694 | uri: '/~deryck' |
695 | }; |
696 | - this.subscriber = new Y.lp.Subscriber(this.config); |
697 | + this.subscriber = new Y.lp.bugs.subscriber.Subscriber(this.config); |
698 | }, |
699 | |
700 | tearDown: function() { |
701 | @@ -63,7 +63,7 @@ |
702 | uri: '/~foo+bar', |
703 | subscriber_ids: {'foo+bar': 'subscriber-16'} |
704 | }; |
705 | - this.subscriber = new Y.lp.Subscriber(this.config); |
706 | + this.subscriber = new Y.lp.bugs.subscriber.Subscriber(this.config); |
707 | }, |
708 | |
709 | tearDown: function() { |
710 | @@ -104,7 +104,7 @@ |
711 | uri: '/~tester', |
712 | user_node: node |
713 | }; |
714 | - this.subscriber = new Y.lp.Subscriber(this.config); |
715 | + this.subscriber = new Y.lp.bugs.subscriber.Subscriber(this.config); |
716 | }, |
717 | |
718 | tearDown: function() { |
719 | @@ -131,7 +131,7 @@ |
720 | this.config = { |
721 | uri: '/~tester' |
722 | }; |
723 | - this.subscriber = new Y.lp.Subscriber(this.config); |
724 | + this.subscriber = new Y.lp.bugs.subscriber.Subscriber(this.config); |
725 | }, |
726 | |
727 | tearDown: function() { |
728 | @@ -153,7 +153,7 @@ |
729 | function APIStubSubscriber(config) { |
730 | APIStubSubscriber.superclass.constructor.apply(this, arguments); |
731 | } |
732 | -Y.extend(APIStubSubscriber, Y.lp.Subscriber, { |
733 | +Y.extend(APIStubSubscriber, Y.lp.bugs.subscriber.Subscriber, { |
734 | get_display_name_from_api: function(client) { |
735 | this.set('display_name', 'From API'); |
736 | this.set_truncated_display_name(); |
737 | @@ -212,7 +212,7 @@ |
738 | test_display_name_load_event: function() { |
739 | var test = this; |
740 | var event_fired = false; |
741 | - var subscriber = new Y.lp.Subscriber(); |
742 | + var subscriber = new Y.lp.bugs.subscriber.Subscriber(); |
743 | subscriber.on('displaynameload', function(e) { |
744 | Y.assert(true); |
745 | }); |
746 | @@ -234,7 +234,8 @@ |
747 | is_direct: true, |
748 | is_team: true |
749 | }; |
750 | - this.subscription = new Y.lp.Subscription(this.config); |
751 | + this.subscription = new Y.lp.bugs.subscriber.Subscription( |
752 | + this.config); |
753 | }, |
754 | |
755 | tearDown: function() { |
756 | @@ -273,7 +274,7 @@ |
757 | }, |
758 | |
759 | test_already_subscribed: function() { |
760 | - var person = new Y.lp.Subscriber({uri: '/~tester'}); |
761 | + var person = new Y.lp.bugs.subscriber.Subscriber({uri: '/~tester'}); |
762 | this.subscription.set('person', person); |
763 | Y.Assert.isTrue( |
764 | this.subscription.is_already_subscribed(), |
765 | @@ -281,7 +282,7 @@ |
766 | }, |
767 | |
768 | test_is_current_user_subscribing: function() { |
769 | - var person = new Y.lp.Subscriber({uri: '/~tester'}); |
770 | + var person = new Y.lp.bugs.subscriber.Subscriber({uri: '/~tester'}); |
771 | this.subscription.set('person', person); |
772 | var subscriber = this.subscription.get('person'); |
773 | this.subscription.set('subscriber', subscriber); |
774 | @@ -292,6 +293,12 @@ |
775 | })); |
776 | |
777 | |
778 | +var handle_complete = function(data) { |
779 | + status_node = Y.Node.create( |
780 | + '<p id="complete">Test status: complete</p>'); |
781 | + Y.get('body').appendChild(status_node); |
782 | + }; |
783 | +Y.Test.Runner.on('complete', handle_complete); |
784 | Y.Test.Runner.add(suite); |
785 | |
786 | var console = new Y.Console({newestOnTop: false}); |
787 | |
788 | === modified file 'lib/lp/bugs/templates/bug-portlet-subscribers.pt' |
789 | --- lib/lp/bugs/templates/bug-portlet-subscribers.pt 2009-12-03 18:33:22 +0000 |
790 | +++ lib/lp/bugs/templates/bug-portlet-subscribers.pt 2010-06-17 14:36:35 +0000 |
791 | @@ -25,7 +25,7 @@ |
792 | <img src="/@@/spinner" /> |
793 | </div> |
794 | <script type="text/javascript"> |
795 | - LPS.use('io-base', 'node', 'bugs.bugtask_index', function(Y) { |
796 | + LPS.use('io-base', 'node', 'lp.bugs.bugtask_index', function(Y) { |
797 | // Must be done inline here to ensure the load event fires. |
798 | // This is a work around for a YUI3 issue with event handling. |
799 | var subscription_link = Y.one('.menu-link-subscription'); |
800 | @@ -37,8 +37,8 @@ |
801 | } |
802 | |
803 | Y.on('domready', function() { |
804 | - if (Y.bugs) { |
805 | - Y.bugs.load_subscribers_portlet( |
806 | + if (Y.lp.bugs.bugtask_index) { |
807 | + Y.lp.bugs.bugtask_index.load_subscribers_portlet( |
808 | subscription_link, subscription_link_handler); |
809 | } |
810 | }); |
811 | |
812 | === modified file 'lib/lp/bugs/templates/bugtarget-filebug-search.pt' |
813 | --- lib/lp/bugs/templates/bugtarget-filebug-search.pt 2010-02-22 11:25:15 +0000 |
814 | +++ lib/lp/bugs/templates/bugtarget-filebug-search.pt 2010-06-17 14:36:35 +0000 |
815 | @@ -16,8 +16,9 @@ |
816 | |
817 | <script type="text/javascript"> |
818 | LPS.use( |
819 | - 'base', 'node', 'oop', 'event', 'bugs.dupe_finder', function(Y) { |
820 | - Y.bugs.setup_dupe_finder(); |
821 | + 'base', 'node', 'oop', 'event', 'lp.bugs.filebug_dupefinder', |
822 | + function(Y) { |
823 | + Y.lp.bugs.filebug_dupefinder.setup_dupe_finder(); |
824 | }); |
825 | </script> |
826 | <meta http-equiv="refresh" content="10" |
827 | |
828 | === modified file 'lib/lp/bugs/templates/bugtarget-filebug-submit-bug.pt' |
829 | --- lib/lp/bugs/templates/bugtarget-filebug-submit-bug.pt 2009-12-08 11:08:20 +0000 |
830 | +++ lib/lp/bugs/templates/bugtarget-filebug-submit-bug.pt 2010-06-17 14:36:35 +0000 |
831 | @@ -14,9 +14,10 @@ |
832 | tal:define="lp_js string:${icingroot}/build" |
833 | tal:attributes="src string:${lp_js}/bugs/filebug-dupefinder.js"></script> |
834 | <script type="text/javascript"> |
835 | - LPS.use('base', 'node', 'oop', 'event', 'bugs.dupe_finder', function(Y) { |
836 | + LPS.use('base', 'node', 'oop', 'event', 'lp.bugs.filebug_dupefinder', |
837 | + function(Y) { |
838 | Y.on('domready', function() { |
839 | - Y.bugs.setup_dupes(); |
840 | + Y.lp.bugs.filebug_dupefinder.setup_dupes(); |
841 | }); |
842 | }); |
843 | </script> |
844 | |
845 | === modified file 'lib/lp/bugs/templates/bugtask-index.pt' |
846 | --- lib/lp/bugs/templates/bugtask-index.pt 2010-04-29 13:49:18 +0000 |
847 | +++ lib/lp/bugs/templates/bugtask-index.pt 2010-06-17 14:36:35 +0000 |
848 | @@ -10,36 +10,10 @@ |
849 | <script type='text/javascript' tal:content="string:var yui_base='${yui}';" /> |
850 | <script type='text/javascript' id='available-official-tags-js' |
851 | tal:content="view/available_official_tags_js" /> |
852 | - <tal:devmode condition="devmode"> |
853 | - <script type="text/javascript" |
854 | - tal:define="lp_js string:${icingroot}/build" |
855 | - tal:attributes="src string:${lp_js}/bugs/subscriber.js"> |
856 | - </script> |
857 | - <script type="text/javascript" |
858 | - tal:define="lp_js string:${icingroot}/build" |
859 | - tal:attributes="src string:${lp_js}/bugs/bugtask-index.js"> |
860 | - </script> |
861 | - <script type="text/javascript" |
862 | - tal:define="lp_js string:${icingroot}/build" |
863 | - tal:attributes="src string:${lp_js}/bugs/bug_tags_entry.js"> |
864 | - </script> |
865 | - <script type="text/javascript" |
866 | - tal:define="lp_js string:${icingroot}/build" |
867 | - tal:attributes="src string:${lp_js}/lp/comment.js"> |
868 | - </script> |
869 | - <script type="text/javascript" |
870 | - tal:define="lp_js string:${icingroot}/build" |
871 | - tal:attributes="src string:${lp_js}/lp/errors.js"> |
872 | - </script> |
873 | - <script type="text/javascript" |
874 | - tal:define="lp_js string:${icingroot}/build" |
875 | - tal:attributes="src string:${lp_js}/code/popupdiff.js"> |
876 | - </script> |
877 | - </tal:devmode> |
878 | <script type="text/javascript"> |
879 | - LPS.use('base', 'node', 'oop', 'event', 'bugs.bugtask_index', |
880 | + LPS.use('base', 'node', 'oop', 'event', 'lp.bugs.bugtask_index', |
881 | 'lp.code.branchmergeproposal.diff', function(Y) { |
882 | - Y.bugs.setup_bugtask_index(); |
883 | + Y.lp.bugs.bugtask_index.setup_bugtask_index(); |
884 | Y.on('load', function(e) { |
885 | Y.lp.code.branchmergeproposal.diff.connect_diff_links(); |
886 | }, window); |
887 | @@ -157,7 +131,7 @@ |
888 | <img src="/@@/spinner" id="tags-edit-spinner" style="display: none" /> |
889 | <a href="+edit" title="Edit tags" id="edit-tags-trigger" class="sprite edit"></a> |
890 | <script type="text/javascript"> |
891 | - LPS.use('event', 'node', 'bugs.bug_tags_entry', function(Y) { |
892 | + LPS.use('event', 'node', 'lp.bugs.bug_tags_entry', function(Y) { |
893 | // XXX intellectronica 2009-04-16 bug #362309: |
894 | // The load event fires very late on bug pages that take a |
895 | // long time to render, but we prefer to use it since the |
896 | @@ -172,7 +146,8 @@ |
897 | } |
898 | Y.on('load', |
899 | function(e) { |
900 | - Y.bugs.setup_tag_entry(available_official_tags); |
901 | + Y.lp.bugs.bug_tags_entry.setup_tag_entry( |
902 | + available_official_tags); |
903 | }, |
904 | window); |
905 | }); |
906 | |
907 | === modified file 'lib/lp/bugs/templates/bugtask-tasks-and-nominations-table-row.pt' |
908 | --- lib/lp/bugs/templates/bugtask-tasks-and-nominations-table-row.pt 2010-05-21 13:44:43 +0000 |
909 | +++ lib/lp/bugs/templates/bugtask-tasks-and-nominations-table-row.pt 2010-06-17 14:36:35 +0000 |
910 | @@ -191,10 +191,10 @@ |
911 | class="bugtasks-table-row-init-script" |
912 | tal:condition="not:view/many_bugtasks" |
913 | tal:content="string: |
914 | - LPS.use('event', 'bugs.bugtask_index', function(Y) { |
915 | + LPS.use('event', 'lp.bugs.bugtask_index', function(Y) { |
916 | Y.on('load', |
917 | function(e) { |
918 | - Y.bugs.setup_bugtask_row(${view/js_config}); |
919 | + Y.lp.bugs.bugtask_index.setup_bugtask_row(${view/js_config}); |
920 | }, |
921 | window); |
922 | }); |
923 | |
924 | === modified file 'lib/lp/bugs/templates/bugtasks-and-nominations-table.pt' |
925 | --- lib/lp/bugs/templates/bugtasks-and-nominations-table.pt 2010-01-22 04:26:47 +0000 |
926 | +++ lib/lp/bugs/templates/bugtasks-and-nominations-table.pt 2010-06-17 14:36:35 +0000 |
927 | @@ -37,9 +37,9 @@ |
928 | </a> |
929 | </span> |
930 | <script type="text/javascript" tal:content="string: |
931 | - LPS.use('event', 'bugs.bugtask_index', function(Y) { |
932 | + LPS.use('event', 'lp.bugs.bugtask_index', function(Y) { |
933 | Y.on('load', function(e) { |
934 | - Y.bugs.setup_me_too( |
935 | + Y.lp.bugs.bugtask_index.setup_me_too( |
936 | ${view/current_user_affected_js_status}, |
937 | ${view/other_users_affected_count}); |
938 | }, window); |
939 | |
940 | === modified file 'lib/lp/bugs/templates/official-bug-target-manage-tags.pt' |
941 | --- lib/lp/bugs/templates/official-bug-target-manage-tags.pt 2009-12-11 14:15:01 +0000 |
942 | +++ lib/lp/bugs/templates/official-bug-target-manage-tags.pt 2010-06-17 14:36:35 +0000 |
943 | @@ -27,9 +27,9 @@ |
944 | </script> |
945 | <script tal:replace="structure view/tags_js_data" /> |
946 | <script type="text/javascript"> |
947 | - LPS.use('event', 'bugs.official_bug_tag_management', function(Y) { |
948 | + LPS.use('event', 'lp.bugs.official_bug_tags', function(Y) { |
949 | Y.on('domready', function(e) { |
950 | - Y.bugs.setup_official_bug_tag_management(); |
951 | + Y.lp.bugs.official_bug_tags.setup_official_bug_tag_management(); |
952 | }); |
953 | }); |
954 | </script> |
955 | |
956 | === added file 'lib/lp/bugs/windmill/tests/test_yuitests.py' |
957 | --- lib/lp/bugs/windmill/tests/test_yuitests.py 1970-01-01 00:00:00 +0000 |
958 | +++ lib/lp/bugs/windmill/tests/test_yuitests.py 2010-06-17 14:36:35 +0000 |
959 | @@ -0,0 +1,21 @@ |
960 | +# Copyright 2010 Canonical Ltd. This software is licensed under the |
961 | +# GNU Affero General Public License version 3 (see the file LICENSE). |
962 | + |
963 | +"""Run YUI.test tests.""" |
964 | + |
965 | +__metaclass__ = type |
966 | +__all__ = [] |
967 | + |
968 | +from lp.testing import build_yui_unittest_suite, YUIUnitTestCase |
969 | +from lp.bugs.windmill.testing import BugsWindmillLayer |
970 | + |
971 | + |
972 | +class BugsYUIUnitTestCase(YUIUnitTestCase): |
973 | + |
974 | + layer = BugsWindmillLayer |
975 | + suite_name = 'BugsYUIUnitTests' |
976 | + |
977 | + |
978 | +def test_suite(): |
979 | + app_testing_path = 'lp/bugs/javascript/tests' |
980 | + return build_yui_unittest_suite(app_testing_path, BugsYUIUnitTestCase) |
981 | |
982 | === modified file 'utilities/lp-deps.py' |
983 | --- utilities/lp-deps.py 2010-06-14 13:33:06 +0000 |
984 | +++ utilities/lp-deps.py 2010-06-17 14:36:35 +0000 |
985 | @@ -23,6 +23,7 @@ |
986 | (os.path.join('lib', 'lp', 'code', 'javascript'), 'code'), |
987 | (os.path.join('lib', 'lp', 'registry', 'javascript'), 'registry'), |
988 | (os.path.join('lib', 'lp', 'translations', 'javascript'), 'translations'), |
989 | + (os.path.join('lib', 'lp', 'bugs', 'javascript'), 'bugs'), |
990 | ] |
991 | ICING_ROOT = os.path.join(TOP, 'lib', 'canonical', 'launchpad', 'icing') |
992 | ICING_BUILD = os.path.join(ICING_ROOT, 'build') |
Hi Deryck,
This change looks great. r=mars.
If you want to make testing simpler, consider adding a 'test_yuitests.py' module similar to what is found in lib/lp/ code/windmill/ tests. It will automate the running of the YUITest unit test suite under windmill.
Maris