Merge lp:~thumper/launchpad/lp-client-cache-move into lp:launchpad
- lp-client-cache-move
- Merge into devel
Proposed by
Tim Penhey
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Tim Penhey | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 12463 | ||||
Proposed branch: | lp:~thumper/launchpad/lp-client-cache-move | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
708 lines (+82/-80) 30 files modified
lib/canonical/launchpad/javascript/client/client.js (+5/-4) lib/canonical/launchpad/rest/me.py (+1/-1) lib/canonical/launchpad/windmill/jstests/launchpad_ajax.js (+7/-7) lib/lp/app/javascript/comment.js (+3/-3) lib/lp/app/javascript/picker.js (+3/-3) lib/lp/app/templates/base-layout-macros.pt (+3/-3) lib/lp/bugs/javascript/bug_tags_entry.js (+2/-2) lib/lp/bugs/javascript/bugtask_index.js (+8/-8) lib/lp/bugs/javascript/bugtask_index_portlets.js (+4/-4) lib/lp/bugs/javascript/subscriber.js (+1/-1) lib/lp/bugs/javascript/tests/test_bug_subscription_widget.js (+12/-12) lib/lp/bugs/javascript/tests/test_me_too.js (+2/-2) lib/lp/bugs/javascript/tests/test_subscriber.js (+3/-2) lib/lp/bugs/templates/bugtask-index.pt (+1/-1) lib/lp/code/javascript/branch.bugspeclinks.js (+2/-2) lib/lp/code/javascript/branch.subscription.js (+3/-3) lib/lp/code/javascript/branchmergeproposal.reviewcomment.js (+1/-1) lib/lp/code/javascript/branchmergeproposal.status.js (+1/-1) lib/lp/code/javascript/requestbuild_overlay.js (+3/-3) lib/lp/code/templates/branch-index.pt (+1/-1) lib/lp/code/templates/branch-related-bugs-specs.pt (+1/-1) lib/lp/code/templates/branchmergeproposal-index.pt (+1/-1) lib/lp/code/templates/sourcepackagerecipe-index.pt (+1/-1) lib/lp/registry/javascript/distroseriesdifferences_details.js (+1/-1) lib/lp/registry/javascript/team.js (+2/-2) lib/lp/registry/templates/distributionsourcepackage-index.pt (+1/-1) lib/lp/registry/templates/object-timeline-graph.pt (+1/-1) lib/lp/soyuz/javascript/lp_dynamic_dom_updater.js (+1/-1) lib/lp/soyuz/javascript/update_archive_build_statuses.js (+4/-4) lib/lp/soyuz/templates/archive-macros.pt (+3/-3) |
||||
To merge this branch: | bzr merge lp:~thumper/launchpad/lp-client-cache-move | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Penhey (community) | Approve | ||
Review via email: mp+51030@code.launchpad.net |
Commit message
[no-qa][incr] [r=thumper][bug=724004] Rename LP.client.cache and LP.client.links to LP.cache and LP.links in preparation of LP.client becoming a YUI module.
Description of the change
Mechanical change using sed (except for the declaration cleanup).
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/javascript/client/client.js' |
2 | --- lib/canonical/launchpad/javascript/client/client.js 2010-11-30 12:53:20 +0000 |
3 | +++ lib/canonical/launchpad/javascript/client/client.js 2011-02-25 03:12:04 +0000 |
4 | @@ -1,9 +1,10 @@ |
5 | |
6 | // An AJAX client that runs against Launchpad's web service. |
7 | -LP = (typeof(LP) != "undefined") ? LP : {}; |
8 | -LP.client = (typeof LP.client != "undefined") ? LP.client : {}; |
9 | -LP.client.links = (typeof LP.links !== "undefined") ? LP.client.links : {}; |
10 | -LP.client.cache = (typeof LP.objects !== "undefined") ? LP.client.cache : {}; |
11 | +var LP = { |
12 | + cache: {}, |
13 | + client: {}, |
14 | + links: {} |
15 | +}; |
16 | |
17 | YUI({ |
18 | bootstrap: false, |
19 | |
20 | === modified file 'lib/canonical/launchpad/rest/me.py' |
21 | --- lib/canonical/launchpad/rest/me.py 2010-11-08 12:52:43 +0000 |
22 | +++ lib/canonical/launchpad/rest/me.py 2011-02-25 03:12:04 +0000 |
23 | @@ -45,7 +45,7 @@ |
24 | def cache_me_link_when_principal_identified(event): |
25 | """Insert the current user into the JSON request cache. |
26 | |
27 | - This ensures that the Javascript variable LP.client.links['me'] |
28 | + This ensures that the Javascript variable LP.links['me'] |
29 | will be set. |
30 | """ |
31 | # XML-RPC requests and other non-browser requests don't have a |
32 | |
33 | === modified file 'lib/canonical/launchpad/windmill/jstests/launchpad_ajax.js' |
34 | --- lib/canonical/launchpad/windmill/jstests/launchpad_ajax.js 2010-07-23 05:41:36 +0000 |
35 | +++ lib/canonical/launchpad/windmill/jstests/launchpad_ajax.js 2011-02-25 03:12:04 +0000 |
36 | @@ -13,8 +13,8 @@ |
37 | {"params": {"xpath": "//div[@id='globalfooter']"}, |
38 | "method": "waits.forElement"}, |
39 | function (test) { |
40 | - jum.assertUndefined(LP.client.links.me); |
41 | - jum.assertUndefined(LP.client.cache.context); |
42 | + jum.assertUndefined(LP.links.me); |
43 | + jum.assertUndefined(LP.cache.context); |
44 | } |
45 | ]); |
46 | |
47 | @@ -28,12 +28,12 @@ |
48 | function (test) { |
49 | // If the user is logged in, the link to their user account |
50 | // will be in the link cache. |
51 | - jum.assertEquals(LP.client.links.me, '/~name16'); |
52 | + jum.assertEquals(LP.links.me, '/~name16'); |
53 | |
54 | // If the view has a context, the context will be in the object |
55 | // cache. |
56 | - jum.assertNotUndefined(LP.client.cache.context); |
57 | - var context = LP.client.cache.context; |
58 | + jum.assertNotUndefined(LP.cache.context); |
59 | + var context = LP.cache.context; |
60 | jum.assertNotEquals(context.self_link.indexOf( |
61 | "/api/devel/firefox/+bug/1"), -1); |
62 | jum.assertNotEquals(context.resource_type_link.indexOf( |
63 | @@ -45,8 +45,8 @@ |
64 | |
65 | // Specific views may add additional objects to the object cache |
66 | // or links to the link cache. |
67 | - var bug = LP.client.cache.bug; |
68 | - jum.assertNotUndefined(LP.client.cache.bug); |
69 | + var bug = LP.cache.bug; |
70 | + jum.assertNotUndefined(LP.cache.bug); |
71 | jum.assertNotEquals(bug.self_link.indexOf("/api/devel/bugs/1"), -1); |
72 | } |
73 | ]); |
74 | |
75 | === modified file 'lib/lp/app/javascript/comment.js' |
76 | --- lib/lp/app/javascript/comment.js 2010-12-15 22:50:52 +0000 |
77 | +++ lib/lp/app/javascript/comment.js 2011-02-25 03:12:04 +0000 |
78 | @@ -111,7 +111,7 @@ |
79 | parameters: {content: this.comment_input.get('value')} |
80 | }; |
81 | this.lp_client.named_post( |
82 | - LP.client.cache.bug.self_link, 'newMessage', config); |
83 | + LP.cache.bug.self_link, 'newMessage', config); |
84 | }, |
85 | /** |
86 | * Retrieve the HTML of the specified message entry. |
87 | @@ -290,7 +290,7 @@ |
88 | config.parameters.parent = this.in_reply_to.get('self_link'); |
89 | } |
90 | this.lp_client.named_post( |
91 | - LP.client.cache.context.self_link, 'createComment', config); |
92 | + LP.cache.context.self_link, 'createComment', config); |
93 | }, |
94 | /** |
95 | * Retrieve the HTML of the specified message entry. |
96 | @@ -410,7 +410,7 @@ |
97 | var target = Y.one('#votes-target'); |
98 | target.set('innerHTML', response.responseText); |
99 | |
100 | - var username = LP.client.links.me.substring(2); |
101 | + var username = LP.links.me.substring(2); |
102 | var new_reviewer = Y.one('#review-' + username); |
103 | if (Y.Lang.isValue(new_reviewer)) { |
104 | var anim = Y.lazr.anim.green_flash({ |
105 | |
106 | === modified file 'lib/lp/app/javascript/picker.js' |
107 | --- lib/lp/app/javascript/picker.js 2011-02-09 16:14:19 +0000 |
108 | +++ lib/lp/app/javascript/picker.js 2011-02-25 03:12:04 +0000 |
109 | @@ -41,7 +41,7 @@ |
110 | var show_search_box = true; |
111 | resource_uri = LP.client.normalize_uri(resource_uri) |
112 | var full_resource_uri = LP.client.get_absolute_uri(resource_uri); |
113 | - var current_context_uri = LP.client.cache['context']['self_link']; |
114 | + var current_context_uri = LP.cache['context']['self_link']; |
115 | var editing_main_context = (full_resource_uri == current_context_uri); |
116 | |
117 | if (config !== undefined) { |
118 | @@ -91,7 +91,7 @@ |
119 | |
120 | if (assign_me_button) { |
121 | if (link !== null |
122 | - && link.get('href').indexOf(LP.client.links.me + '/') != -1) { |
123 | + && link.get('href').indexOf(LP.links.me + '/') != -1) { |
124 | assign_me_button.addClass('yui-picker-hidden'); |
125 | } else { |
126 | assign_me_button.removeClass('yui-picker-hidden'); |
127 | @@ -158,7 +158,7 @@ |
128 | save({ |
129 | image: '/@@/person', |
130 | title: 'Me', |
131 | - api_uri: LP.client.links.me |
132 | + api_uri: LP.links.me |
133 | }); |
134 | }; |
135 | |
136 | |
137 | === modified file 'lib/lp/app/templates/base-layout-macros.pt' |
138 | --- lib/lp/app/templates/base-layout-macros.pt 2011-01-05 21:40:34 +0000 |
139 | +++ lib/lp/app/templates/base-layout-macros.pt 2011-02-25 03:12:04 +0000 |
140 | @@ -163,17 +163,17 @@ |
141 | links cache/links; |
142 | objects cache/objects;"> |
143 | <script tal:repeat="key links" |
144 | - tal:content="string:LP.client.links['${key}'] = |
145 | + tal:content="string:LP.links['${key}'] = |
146 | '${links/?key/fmt:api_url}';"> |
147 | </script> |
148 | <script tal:repeat="key objects" |
149 | - tal:content="string:LP.client.cache['${key}'] = |
150 | + tal:content="string:LP.cache['${key}'] = |
151 | ${objects/?key/webservice:json};"> |
152 | </script> |
153 | </tal:cache> |
154 | |
155 | <script tal:condition="context/webservice:is_entry" |
156 | - tal:content="string:LP.client.cache['context'] = |
157 | + tal:content="string:LP.cache['context'] = |
158 | ${context/webservice:json};"> |
159 | </script> |
160 | </metal:lp-client-cache> |
161 | |
162 | === modified file 'lib/lp/bugs/javascript/bug_tags_entry.js' |
163 | --- lib/lp/bugs/javascript/bug_tags_entry.js 2011-02-21 04:32:26 +0000 |
164 | +++ lib/lp/bugs/javascript/bug_tags_entry.js 2011-02-25 03:12:04 +0000 |
165 | @@ -72,7 +72,7 @@ |
166 | Y.Lang.trim(tag_input.get(VALUE)).split(new RegExp('\\s+'))).filter( |
167 | function(elem) { return elem !== ''; }); |
168 | var bug = new LP.client.Entry( |
169 | - lp_client, LP.client.cache[BUG], LP.client.cache[BUG].self_link); |
170 | + lp_client, LP.cache[BUG], LP.cache[BUG].self_link); |
171 | bug.removeAttr('http_etag'); |
172 | bug.set('tags', tags); |
173 | tags_edit_spinner.setStyle(DISPLAY, INLINE); |
174 | @@ -166,7 +166,7 @@ |
175 | * @method setup_tag_entry |
176 | */ |
177 | namespace.setup_tag_entry = function(available_official_tags) { |
178 | - if (LP.client.links.me === undefined) { return; } |
179 | + if (LP.links.me === undefined) { return; } |
180 | |
181 | available_tags = Y.Array(available_official_tags); |
182 | bug_tags_div = Y.one('#bug-tags'); |
183 | |
184 | === modified file 'lib/lp/bugs/javascript/bugtask_index.js' |
185 | --- lib/lp/bugs/javascript/bugtask_index.js 2011-02-15 18:16:28 +0000 |
186 | +++ lib/lp/bugs/javascript/bugtask_index.js 2011-02-25 03:12:04 +0000 |
187 | @@ -52,7 +52,7 @@ |
188 | } |
189 | // If the user is not logged in, then we need to defer to the |
190 | // default behaviour. |
191 | - if (LP.client.links.me === undefined) { |
192 | + if (LP.links.me === undefined) { |
193 | return; |
194 | } |
195 | |
196 | @@ -167,7 +167,7 @@ |
197 | lp_client = new LP.client.Launchpad(); |
198 | |
199 | if (bug_repr === undefined) { |
200 | - bug_repr = LP.client.cache.bug; |
201 | + bug_repr = LP.cache.bug; |
202 | lp_bug_entry = new LP.client.Entry( |
203 | lp_client, bug_repr, bug_repr.self_link); |
204 | } |
205 | @@ -337,7 +337,7 @@ |
206 | } |
207 | |
208 | if (lp_bug_entry === undefined) { |
209 | - var bug_repr = LP.client.cache.bug; |
210 | + var bug_repr = LP.cache.bug; |
211 | lp_bug_entry = new LP.client.Entry( |
212 | lp_client, bug_repr, bug_repr.self_link); |
213 | } |
214 | @@ -563,8 +563,8 @@ |
215 | return; |
216 | } |
217 | |
218 | - if (Y.Lang.isValue(LP.client.cache.bug) && |
219 | - Y.Lang.isValue(LP.client.cache.bug.duplicate_of_link)) { |
220 | + if (Y.Lang.isValue(LP.cache.bug) && |
221 | + Y.Lang.isValue(LP.cache.bug.duplicate_of_link)) { |
222 | // If the bug is a duplicate, don't set the widget up and |
223 | // canel clicks on the edit links. Users most likely don't |
224 | // want to edit the bugtasks. |
225 | @@ -573,8 +573,8 @@ |
226 | return; |
227 | } |
228 | |
229 | - if ((LP.client.links.me !== undefined) && |
230 | - (LP.client.links.me !== null)) { |
231 | + if ((LP.links.me !== undefined) && |
232 | + (LP.links.me !== null)) { |
233 | if (Y.Lang.isValue(bugtarget_content)) { |
234 | if (conf.target_is_product) { |
235 | var bugtarget_picker = Y.lp.app.picker.addPickerPatcher( |
236 | @@ -911,7 +911,7 @@ |
237 | }; |
238 | |
239 | client.named_post( |
240 | - LP.client.cache.bug.self_link, 'markUserAffected', config); |
241 | + LP.cache.bug.self_link, 'markUserAffected', config); |
242 | } |
243 | }); |
244 | /* |
245 | |
246 | === modified file 'lib/lp/bugs/javascript/bugtask_index_portlets.js' |
247 | --- lib/lp/bugs/javascript/bugtask_index_portlets.js 2011-02-18 08:25:32 +0000 |
248 | +++ lib/lp/bugs/javascript/bugtask_index_portlets.js 2011-02-25 03:12:04 +0000 |
249 | @@ -57,7 +57,7 @@ |
250 | lp_client = new LP.client.Launchpad(); |
251 | |
252 | if (bug_repr === undefined) { |
253 | - bug_repr = LP.client.cache.bug; |
254 | + bug_repr = LP.cache.bug; |
255 | lp_bug_entry = new LP.client.Entry( |
256 | lp_client, bug_repr, bug_repr.self_link); |
257 | } |
258 | @@ -235,7 +235,7 @@ |
259 | link: Y.one('.menu-link-subscription'), |
260 | spinner: Y.one('#sub-unsub-spinner'), |
261 | subscriber: new Y.lp.bugs.subscriber.Subscriber({ |
262 | - uri: LP.client.links.me, |
263 | + uri: LP.links.me, |
264 | subscriber_ids: subscriber_ids |
265 | }) |
266 | }); |
267 | @@ -252,7 +252,7 @@ |
268 | * @method setup_subscription_link_handlers |
269 | */ |
270 | function setup_subscription_link_handlers() { |
271 | - if (LP.client.links.me === undefined) { |
272 | + if (LP.links.me === undefined) { |
273 | return; |
274 | } |
275 | |
276 | @@ -261,7 +261,7 @@ |
277 | link: Y.one('.menu-link-subscription'), |
278 | spinner: Y.one('#sub-unsub-spinner'), |
279 | subscriber: new Y.lp.bugs.subscriber.Subscriber({ |
280 | - uri: LP.client.links.me, |
281 | + uri: LP.links.me, |
282 | subscriber_ids: subscriber_ids |
283 | }) |
284 | }); |
285 | |
286 | === modified file 'lib/lp/bugs/javascript/subscriber.js' |
287 | --- lib/lp/bugs/javascript/subscriber.js 2011-02-04 11:46:09 +0000 |
288 | +++ lib/lp/bugs/javascript/subscriber.js 2011-02-25 03:12:04 +0000 |
289 | @@ -352,7 +352,7 @@ |
290 | this.fire('displaynameload'); |
291 | } else { |
292 | if (window.LP !== undefined && |
293 | - window.LP.client.links.me !== undefined) { |
294 | + window.LP.links.me !== undefined) { |
295 | var client = new LP.client.Launchpad(); |
296 | this.get_display_name_from_api(client); |
297 | } |
298 | |
299 | === modified file 'lib/lp/bugs/javascript/tests/test_bug_subscription_widget.js' |
300 | --- lib/lp/bugs/javascript/tests/test_bug_subscription_widget.js 2011-02-04 15:18:31 +0000 |
301 | +++ lib/lp/bugs/javascript/tests/test_bug_subscription_widget.js 2011-02-25 03:12:04 +0000 |
302 | @@ -77,21 +77,21 @@ |
303 | name: 'bug_subscription_wizard_basics', |
304 | |
305 | setUp: function() { |
306 | - // Monkeypatch LP.client to avoid network traffic and to make |
307 | + // Monkeypatch LP to avoid network traffic and to make |
308 | // some things work as expected. |
309 | window.LP = { |
310 | client: { |
311 | - links: {}, |
312 | // Empty client constructor. |
313 | - Launchpad: function() {}, |
314 | - cache: {} |
315 | - } |
316 | + Launchpad: function() {} |
317 | + }, |
318 | + links: {}, |
319 | + cache: {} |
320 | }; |
321 | LP.client.Launchpad.prototype.named_post = |
322 | function(url, func, config) { |
323 | config.on.success(); |
324 | }; |
325 | - LP.client.cache.bug = { |
326 | + LP.cache.bug = { |
327 | self_link: "http://bugs.example.com/bugs/1234" |
328 | }; |
329 | |
330 | @@ -151,21 +151,21 @@ |
331 | name: 'bug_subscription_wizard_async', |
332 | |
333 | setUp: function() { |
334 | - // Monkeypatch LP.client to avoid network traffic and to make |
335 | + // Monkeypatch LP to avoid network traffic and to make |
336 | // some things work as expected. |
337 | window.LP = { |
338 | client: { |
339 | - links: {}, |
340 | // Empty client constructor. |
341 | - Launchpad: function() {}, |
342 | - cache: {} |
343 | - } |
344 | + Launchpad: function() {} |
345 | + }, |
346 | + links: {}, |
347 | + cache: {} |
348 | }; |
349 | LP.client.Launchpad.prototype.named_post = |
350 | function(url, func, config) { |
351 | config.on.success(); |
352 | }; |
353 | - LP.client.cache.bug = { |
354 | + LP.cache.bug = { |
355 | self_link: "http://bugs.example.com/bugs/1234" |
356 | }; |
357 | |
358 | |
359 | === modified file 'lib/lp/bugs/javascript/tests/test_me_too.js' |
360 | --- lib/lp/bugs/javascript/tests/test_me_too.js 2011-02-03 20:38:02 +0000 |
361 | +++ lib/lp/bugs/javascript/tests/test_me_too.js 2011-02-25 03:12:04 +0000 |
362 | @@ -28,13 +28,13 @@ |
363 | name: 'me_too_choice_edit_basics', |
364 | |
365 | setUp: function() { |
366 | - // Monkeypatch LP.client to avoid network traffic and to make |
367 | + // Monkeypatch LP to avoid network traffic and to make |
368 | // some things work as expected. |
369 | LP.client.Launchpad.prototype.named_post = |
370 | function(url, func, config) { |
371 | config.on.success(); |
372 | }; |
373 | - LP.client.cache.bug = { |
374 | + LP.cache.bug = { |
375 | self_link: "http://bugs.example.com/bugs/1234" |
376 | }; |
377 | // add the in-page HTML |
378 | |
379 | === modified file 'lib/lp/bugs/javascript/tests/test_subscriber.js' |
380 | --- lib/lp/bugs/javascript/tests/test_subscriber.js 2011-02-03 20:38:02 +0000 |
381 | +++ lib/lp/bugs/javascript/tests/test_subscriber.js 2011-02-25 03:12:04 +0000 |
382 | @@ -171,8 +171,9 @@ |
383 | setUp: function() { |
384 | // LP is global. |
385 | window.LP = { |
386 | + cache: {}, |
387 | + links: {}, |
388 | client: { |
389 | - links: {}, |
390 | // Empty client constructor. |
391 | Launchpad: function() {} |
392 | } |
393 | @@ -187,7 +188,7 @@ |
394 | // The API should be consulted when the user is logged in. Set |
395 | // the link to "me" to something other than undefined to |
396 | // indicate that there is a logged-in user. |
397 | - LP.client.links.me = 'not-undefined'; |
398 | + LP.links.me = 'not-undefined'; |
399 | var subscriber = new APIStubSubscriber({}); |
400 | Y.Assert.areEqual( |
401 | 'From API', subscriber.get('display_name'), |
402 | |
403 | === modified file 'lib/lp/bugs/templates/bugtask-index.pt' |
404 | --- lib/lp/bugs/templates/bugtask-index.pt 2011-02-17 01:03:34 +0000 |
405 | +++ lib/lp/bugs/templates/bugtask-index.pt 2011-02-25 03:12:04 +0000 |
406 | @@ -151,7 +151,7 @@ |
407 | // that user doesn't click the trigger and navigates to the |
408 | // non-JS form, we first disable the link. This is awful and |
409 | // must be fixed as soon as YUI3 is fixed. |
410 | - if (LP.client.links['me'] !== undefined) { |
411 | + if (LP.links['me'] !== undefined) { |
412 | Y.one('#edit-tags-trigger').on('click', function(e) { |
413 | e.halt(); |
414 | }); |
415 | |
416 | === modified file 'lib/lp/code/javascript/branch.bugspeclinks.js' |
417 | --- lib/lp/code/javascript/branch.bugspeclinks.js 2010-03-01 18:46:24 +0000 |
418 | +++ lib/lp/code/javascript/branch.bugspeclinks.js 2011-02-25 03:12:04 +0000 |
419 | @@ -108,7 +108,7 @@ |
420 | }; |
421 | set_up_lp_client(); |
422 | lp_client.named_post( |
423 | - LP.client.cache.context.self_link, 'linkBug', config); |
424 | + LP.cache.context.self_link, 'linkBug', config); |
425 | }); |
426 | } |
427 | |
428 | @@ -183,7 +183,7 @@ |
429 | }; |
430 | set_up_lp_client(); |
431 | lp_client.named_post( |
432 | - LP.client.cache.context.self_link, 'unlinkBug', config); |
433 | + LP.cache.context.self_link, 'unlinkBug', config); |
434 | }); |
435 | } |
436 | |
437 | |
438 | === modified file 'lib/lp/code/javascript/branch.subscription.js' |
439 | --- lib/lp/code/javascript/branch.subscription.js 2011-02-04 16:55:45 +0000 |
440 | +++ lib/lp/code/javascript/branch.subscription.js 2011-02-25 03:12:04 +0000 |
441 | @@ -36,7 +36,7 @@ |
442 | * @param client {object} An LPClient instance |
443 | */ |
444 | var setUpNames = function (client) { |
445 | - me = LP.client.links.me; |
446 | + me = LP.links.me; |
447 | user_name = me.substring(2); |
448 | |
449 | // There is no need to set display_name if it exists. |
450 | @@ -79,7 +79,7 @@ |
451 | initializer: function () { |
452 | |
453 | this._lp_client = new LP.client.Launchpad(); |
454 | - this._branch_repr = LP.client.cache.context; |
455 | + this._branch_repr = LP.cache.context; |
456 | setUpNames(this._lp_client); |
457 | |
458 | var form_url = this.get("self_subscribe").get("href") + '/++form++'; |
459 | @@ -158,7 +158,7 @@ |
460 | } |
461 | }; |
462 | |
463 | - lp_client.named_post(LP.client.cache.context.self_link, |
464 | + lp_client.named_post(LP.cache.context.self_link, |
465 | 'subscribe', config); |
466 | }, |
467 | visible: false |
468 | |
469 | === modified file 'lib/lp/code/javascript/branchmergeproposal.reviewcomment.js' |
470 | --- lib/lp/code/javascript/branchmergeproposal.reviewcomment.js 2010-07-15 10:59:22 +0000 |
471 | +++ lib/lp/code/javascript/branchmergeproposal.reviewcomment.js 2011-02-25 03:12:04 +0000 |
472 | @@ -190,7 +190,7 @@ |
473 | reviewer_table.insertBefore(table_row, last_element); |
474 | |
475 | |
476 | - var context = LP.client.cache.context; |
477 | + var context = LP.cache.context; |
478 | if (lp_client === undefined) { |
479 | lp_client = new LP.client.Launchpad(); |
480 | } |
481 | |
482 | === modified file 'lib/lp/code/javascript/branchmergeproposal.status.js' |
483 | --- lib/lp/code/javascript/branchmergeproposal.status.js 2011-02-03 21:14:05 +0000 |
484 | +++ lib/lp/code/javascript/branchmergeproposal.status.js 2011-02-25 03:12:04 +0000 |
485 | @@ -52,7 +52,7 @@ |
486 | status_content.one('img').set('src', '/@@/spinner'); |
487 | lp_client = new LP.client.Launchpad(); |
488 | lp_client.named_post( |
489 | - LP.client.cache.context.self_link, 'setStatus', config); |
490 | + LP.cache.context.self_link, 'setStatus', config); |
491 | |
492 | }); |
493 | status_choice_edit.render(); |
494 | |
495 | === modified file 'lib/lp/code/javascript/requestbuild_overlay.js' |
496 | --- lib/lp/code/javascript/requestbuild_overlay.js 2011-02-21 07:22:18 +0000 |
497 | +++ lib/lp/code/javascript/requestbuild_overlay.js 2011-02-25 03:12:04 +0000 |
498 | @@ -64,7 +64,7 @@ |
499 | e.preventDefault(); |
500 | if (request_build_overlay == null) { |
501 | // Render the form and load the widgets to display |
502 | - var recipe_name = LP.client.cache.context['name']; |
503 | + var recipe_name = LP.cache.context['name']; |
504 | request_build_overlay = new Y.lazr.FormOverlay({ |
505 | headerContent: '<h2>Request builds for ' |
506 | + recipe_name + ' </h2>', |
507 | @@ -115,7 +115,7 @@ |
508 | "Requesting build...", request_daily_build_handle); |
509 | request_daily_build_handle.addClass("unseen"); |
510 | |
511 | - var base_url = LP.client.cache.context.web_link; |
512 | + var base_url = LP.cache.context.web_link; |
513 | var submit_url = base_url+"/+request-daily-build"; |
514 | var current_builds = harvest_current_build_records(); |
515 | |
516 | @@ -237,7 +237,7 @@ |
517 | var spinner_location = Y.one('.yui3-lazr-formoverlay-actions'); |
518 | create_temporary_spinner("Requesting builds...", spinner_location); |
519 | |
520 | - var base_url = LP.client.cache.context.web_link; |
521 | + var base_url = LP.cache.context.web_link; |
522 | var submit_url = base_url+"/+builds"; |
523 | var current_builds = harvest_current_build_records(); |
524 | var y_config = { |
525 | |
526 | === modified file 'lib/lp/code/templates/branch-index.pt' |
527 | --- lib/lp/code/templates/branch-index.pt 2011-02-17 04:08:14 +0000 |
528 | +++ lib/lp/code/templates/branch-index.pt 2011-02-25 03:12:04 +0000 |
529 | @@ -36,7 +36,7 @@ |
530 | 'lp.code.branch.subscription', function(Y) { |
531 | |
532 | Y.on('load', function(e) { |
533 | - var logged_in = LP.client.links['me'] !== undefined; |
534 | + var logged_in = LP.links['me'] !== undefined; |
535 | |
536 | if (logged_in) { |
537 | var subscription_portlet = new Y.lp.code.branch.subscription.SubscriptionWidget({ |
538 | |
539 | === modified file 'lib/lp/code/templates/branch-related-bugs-specs.pt' |
540 | --- lib/lp/code/templates/branch-related-bugs-specs.pt 2011-02-03 05:14:54 +0000 |
541 | +++ lib/lp/code/templates/branch-related-bugs-specs.pt 2011-02-25 03:12:04 +0000 |
542 | @@ -81,7 +81,7 @@ |
543 | } |
544 | |
545 | Y.on('domready', function() { |
546 | - var logged_in = LP.client.links['me'] !== undefined; |
547 | + var logged_in = LP.links['me'] !== undefined; |
548 | |
549 | if (logged_in) { |
550 | Y.lp.code.branch.bugspeclinks.connect_branchlinks(); |
551 | |
552 | === modified file 'lib/lp/code/templates/branchmergeproposal-index.pt' |
553 | --- lib/lp/code/templates/branchmergeproposal-index.pt 2011-01-27 04:30:12 +0000 |
554 | +++ lib/lp/code/templates/branchmergeproposal-index.pt 2011-02-25 03:12:04 +0000 |
555 | @@ -203,7 +203,7 @@ |
556 | 'lp.code.branchmergeproposal.status', 'lp.app.comment', function(Y) { |
557 | |
558 | Y.on('load', function() { |
559 | - var logged_in = LP.client.links['me'] !== undefined; |
560 | + var logged_in = LP.links['me'] !== undefined; |
561 | |
562 | if (logged_in) { |
563 | var comment = new Y.lp.app.comment.CodeReviewComment(); |
564 | |
565 | === modified file 'lib/lp/code/templates/sourcepackagerecipe-index.pt' |
566 | --- lib/lp/code/templates/sourcepackagerecipe-index.pt 2011-02-22 23:07:17 +0000 |
567 | +++ lib/lp/code/templates/sourcepackagerecipe-index.pt 2011-02-25 03:12:04 +0000 |
568 | @@ -146,7 +146,7 @@ |
569 | return; |
570 | } |
571 | Y.on('load', function() { |
572 | - var logged_in = LP.client.links['me'] !== undefined; |
573 | + var logged_in = LP.links['me'] !== undefined; |
574 | if (logged_in) { |
575 | build_now_link = Y.one('#request-daily-build'); |
576 | if( build_now_link != null ) { |
577 | |
578 | === modified file 'lib/lp/registry/javascript/distroseriesdifferences_details.js' |
579 | --- lib/lp/registry/javascript/distroseriesdifferences_details.js 2010-10-06 08:25:10 +0000 |
580 | +++ lib/lp/registry/javascript/distroseriesdifferences_details.js 2011-02-25 03:12:04 +0000 |
581 | @@ -226,7 +226,7 @@ |
582 | args.container.one('div.diff-extra-container').insert( |
583 | response.responseText, 'replace'); |
584 | var api_uri = [ |
585 | - LP.client.cache.context.self_link, |
586 | + LP.cache.context.self_link, |
587 | '+difference', |
588 | source_name |
589 | ].join('/') |
590 | |
591 | === modified file 'lib/lp/registry/javascript/team.js' |
592 | --- lib/lp/registry/javascript/team.js 2011-02-04 16:34:52 +0000 |
593 | +++ lib/lp/registry/javascript/team.js 2011-02-25 03:12:04 +0000 |
594 | @@ -124,13 +124,13 @@ |
595 | // XXX: EdwinGrubbs 2009-12-16 bug=497602 |
596 | // Why do I always have to get absolute URIs out of the URIs |
597 | // in the picker's result/client.links? |
598 | - reviewer: LP.client.get_absolute_uri(LP.client.links.me), |
599 | + reviewer: LP.client.get_absolute_uri(LP.links.me), |
600 | person: LP.client.get_absolute_uri(selected_person.api_uri) |
601 | } |
602 | }; |
603 | |
604 | lp_client.named_post( |
605 | - LP.client.cache.context.self_link, 'addMember', addmember_config); |
606 | + LP.cache.context.self_link, 'addMember', addmember_config); |
607 | }; |
608 | |
609 | }, '0.1', {requires: [ |
610 | |
611 | === modified file 'lib/lp/registry/templates/distributionsourcepackage-index.pt' |
612 | --- lib/lp/registry/templates/distributionsourcepackage-index.pt 2010-11-23 14:18:07 +0000 |
613 | +++ lib/lp/registry/templates/distributionsourcepackage-index.pt 2011-02-25 03:12:04 +0000 |
614 | @@ -182,7 +182,7 @@ |
615 | </tal:rows> |
616 | </table> |
617 | <script |
618 | - tal:content="string:LP.client.cache['archive_context_url'] = '${archive/fmt:url}';"></script> |
619 | + tal:content="string:LP.cache['archive_context_url'] = '${archive/fmt:url}';"></script> |
620 | <metal:js use-macro="archive/@@+macros/expandable-table-js"/> |
621 | |
622 | </div> |
623 | |
624 | === modified file 'lib/lp/registry/templates/object-timeline-graph.pt' |
625 | --- lib/lp/registry/templates/object-timeline-graph.pt 2010-11-22 21:19:28 +0000 |
626 | +++ lib/lp/registry/templates/object-timeline-graph.pt 2011-02-25 03:12:04 +0000 |
627 | @@ -125,7 +125,7 @@ |
628 | |
629 | var client = new LP.client.Launchpad(); |
630 | client.named_get( |
631 | - LP.client.cache['context']['self_link'], |
632 | + LP.cache['context']['self_link'], |
633 | 'get_timeline', get_timeline_config); |
634 | |
635 | var drag_scroll_handler = |
636 | |
637 | === modified file 'lib/lp/soyuz/javascript/lp_dynamic_dom_updater.js' |
638 | --- lib/lp/soyuz/javascript/lp_dynamic_dom_updater.js 2010-08-10 10:26:19 +0000 |
639 | +++ lib/lp/soyuz/javascript/lp_dynamic_dom_updater.js 2011-02-25 03:12:04 +0000 |
640 | @@ -86,7 +86,7 @@ |
641 | * var table = Y.one('table#build-count-table'); |
642 | * var config = { |
643 | * domUpdateFunction: updateArchiveBuildStatusSummary, |
644 | - * uri: LP.client.cache.context.self_link, |
645 | + * uri: LP.cache.context.self_link, |
646 | * api_method_name: 'getBuildCounters' |
647 | * } |
648 | * table.plug(LP.DynamicDomUpdater, config); |
649 | |
650 | === modified file 'lib/lp/soyuz/javascript/update_archive_build_statuses.js' |
651 | --- lib/lp/soyuz/javascript/update_archive_build_statuses.js 2010-08-10 10:40:02 +0000 |
652 | +++ lib/lp/soyuz/javascript/update_archive_build_statuses.js 2011-02-25 03:12:04 +0000 |
653 | @@ -23,7 +23,7 @@ |
654 | */ |
655 | var build_summary_portlet_dynamic_update_config = { |
656 | uri: null, // Note: we have to defer setting the uri until later as |
657 | - // the LP.client.cache is not initialized until the end |
658 | + // the LP.cache is not initialized until the end |
659 | // of the page. |
660 | api_method_name: 'getBuildCounters', |
661 | lp_client: lp_client, |
662 | @@ -85,7 +85,7 @@ |
663 | // update itself: |
664 | var portlet = Y.one('div#build-status-summary'); |
665 | build_summary_portlet_dynamic_update_config.uri = |
666 | - LP.client.cache.context.self_link; |
667 | + LP.cache.context.self_link; |
668 | portlet.plug(Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, |
669 | build_summary_portlet_dynamic_update_config); |
670 | }); |
671 | @@ -95,7 +95,7 @@ |
672 | */ |
673 | var source_package_table_dynamic_update_config = { |
674 | uri: null, // Note: we have to defer setting the uri until later as |
675 | - // the LP.client.cache is not initialized until the end |
676 | + // the LP.cache is not initialized until the end |
677 | // of the page. |
678 | api_method_name: 'getBuildSummariesForSourceIds', |
679 | lp_client: lp_client, |
680 | @@ -275,7 +275,7 @@ |
681 | var table = Y.one('table#packages_list'); |
682 | if (table !== null) { |
683 | source_package_table_dynamic_update_config.uri = |
684 | - LP.client.cache.context.self_link; |
685 | + LP.cache.context.self_link; |
686 | table.plug(Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, |
687 | source_package_table_dynamic_update_config); |
688 | } |
689 | |
690 | === modified file 'lib/lp/soyuz/templates/archive-macros.pt' |
691 | --- lib/lp/soyuz/templates/archive-macros.pt 2010-08-16 10:16:13 +0000 |
692 | +++ lib/lp/soyuz/templates/archive-macros.pt 2011-02-25 03:12:04 +0000 |
693 | @@ -66,12 +66,12 @@ |
694 | |
695 | /* |
696 | * If a page wants to use this outside of an archive context then it |
697 | - * can define LP.client.cache['archive_context'], which should be a |
698 | + * can define LP.cache['archive_context'], which should be a |
699 | * full or relative URL to the context archive page required. |
700 | */ |
701 | var base_url = ( |
702 | - typeof(LP.client.cache['archive_context_url']) != "undefined") |
703 | - ? LP.client.cache['archive_context_url'] |
704 | + typeof(LP.cache['archive_context_url']) != "undefined") |
705 | + ? LP.cache['archive_context_url'] |
706 | : ''; |
707 | if (base_url !== '') { |
708 | base_url += '/' |
Self review.