Merge lp:~salgado/launchpad/use-lps into lp:launchpad/db-devel
- use-lps
- Merge into db-devel
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~salgado/launchpad/use-lps |
Merge into: | lp:launchpad/db-devel |
Diff against target: |
616 lines (+119/-43) 34 files modified
lib/canonical/launchpad/javascript/lp/lp.js (+2/-0) lib/lp/bugs/templates/bug-portlet-subscribers.pt (+1/-1) lib/lp/bugs/templates/bugtarget-filebug-submit-bug.pt (+1/-1) lib/lp/bugs/templates/bugtarget-portlet-bugfilters.pt (+1/-1) lib/lp/bugs/templates/bugtarget-portlet-bugtags.pt (+1/-1) lib/lp/bugs/templates/bugtask-index.pt (+3/-3) lib/lp/bugs/templates/bugtask-tasks-and-nominations-table-row.pt (+1/-1) lib/lp/bugs/templates/bugtasks-and-nominations-table.pt (+1/-1) lib/lp/bugs/templates/official-bug-target-manage-tags.pt (+1/-1) lib/lp/code/templates/branch-import-details.pt (+1/-1) lib/lp/code/templates/branch-index.pt (+1/-1) lib/lp/code/templates/branch-listing.pt (+1/-1) lib/lp/code/templates/branch-portlet-subscribers.pt (+1/-1) lib/lp/code/templates/branch-related-bugs-specs.pt (+1/-1) lib/lp/code/templates/branchmergeproposal-generic-listing.pt (+1/-1) lib/lp/registry/templates/object-timeline-graph.pt (+1/-1) lib/lp/registry/templates/person-macros.pt (+1/-1) lib/lp/registry/templates/product-new.pt (+1/-1) lib/lp/registry/templates/productrelease-add-from-series.pt (+1/-1) lib/lp/registry/templates/teammembership-index.pt (+1/-1) lib/lp/registry/templates/timeline-macros.pt (+1/-1) lib/lp/soyuz/templates/archive-edit-dependencies.pt (+1/-1) lib/lp/soyuz/templates/archive-macros.pt (+1/-1) lib/lp/soyuz/templates/archive-packages.pt (+1/-1) lib/lp/soyuz/templates/archive-subscribers.pt (+1/-1) lib/lp/translations/browser/language.py (+8/-0) lib/lp/translations/stories/standalone/xx-language.txt (+68/-7) lib/lp/translations/templates/language-index.pt (+9/-4) lib/lp/translations/templates/object-templates.pt (+1/-1) lib/lp/translations/templates/pofile-export.pt (+1/-1) lib/lp/translations/templates/pofile-translate.pt (+1/-1) lib/lp/translations/templates/translation-import-queue-macros.pt (+1/-1) lib/lp/translations/templates/translationimportqueueentry-index.pt (+1/-1) lib/lp/translations/templates/translationmessage-translate.pt (+1/-1) |
To merge this branch: | bzr merge lp:~salgado/launchpad/use-lps |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Māris Fogels (community) | Approve | ||
Review via email:
|
Commit message
Description of the change
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Guilherme Salgado (salgado) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Māris Fogels (mars) wrote : | # |
Hi Salgado,
That is an excellent change! Not only does it make your branch smaller, but you also sped up the JavaScript across the entire Launchpad site :)
Did you check the lazr python widgets as well, like the inline editor (lib/canonical/
Maris
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Guilherme Salgado (salgado) wrote : | # |
On Fri, 2009-12-04 at 20:40 +0000, Māris Fogels wrote:
> Review: Needs Information
> Hi Salgado,
>
> That is an excellent change! Not only does it make your branch
> smaller, but you also sped up the JavaScript across the entire
> Launchpad site :)
>
> Did you check the lazr python widgets as well, like the inline editor
> (lib/canonical/
> own sandboxes, too. Tim fixed one, there may have been others.
I originally changed lib/canonical/
but then got errors on firebug saying that LPS wasn't defined there, so
I reverted that part and went just with this.
I'll change them in a separate branch and then we can investigate how to
fix, but I don't want to block this branch on that.
BTW, I ran the full windmill testsuite and there are no failures other
than that one already present in devel.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Māris Fogels (mars) wrote : | # |
That sounds good to me, r=mars
Maris
Preview Diff
1 | === modified file 'lib/canonical/launchpad/javascript/lp/lp.js' |
2 | --- lib/canonical/launchpad/javascript/lp/lp.js 2009-11-24 09:30:01 +0000 |
3 | +++ lib/canonical/launchpad/javascript/lp/lp.js 2009-12-07 12:38:12 +0000 |
4 | @@ -643,7 +643,9 @@ |
5 | // skip when x is 0, as that is the singular |
6 | for (var x = 1; x < nplurals; x++) { |
7 | var to_id = to_id_pattern + x + "_new"; |
8 | + var to_select = to_id_pattern + x + "_new_select"; |
9 | copyInnerHTMLById(from_id, to_id); |
10 | + document.getElementById(to_select).checked = true; |
11 | } |
12 | } |
13 | |
14 | |
15 | === modified file 'lib/lp/bugs/templates/bug-portlet-subscribers.pt' |
16 | --- lib/lp/bugs/templates/bug-portlet-subscribers.pt 2009-11-26 03:13:32 +0000 |
17 | +++ lib/lp/bugs/templates/bug-portlet-subscribers.pt 2009-12-07 12:38:12 +0000 |
18 | @@ -25,7 +25,7 @@ |
19 | <img src="/@@/spinner" /> |
20 | </div> |
21 | <script type="text/javascript"> |
22 | - YUI().use('io-base', 'node', 'bugs.bugtask_index', function(Y) { |
23 | + LPS.use('io-base', 'node', 'bugs.bugtask_index', function(Y) { |
24 | // Must be done inline here to ensure the load event fires. |
25 | // This is a work around for a YUI3 issue with event handling. |
26 | var subscription_link = Y.one('.menu-link-subscription'); |
27 | |
28 | === modified file 'lib/lp/bugs/templates/bugtarget-filebug-submit-bug.pt' |
29 | --- lib/lp/bugs/templates/bugtarget-filebug-submit-bug.pt 2009-10-01 12:09:37 +0000 |
30 | +++ lib/lp/bugs/templates/bugtarget-filebug-submit-bug.pt 2009-12-07 12:38:12 +0000 |
31 | @@ -14,7 +14,7 @@ |
32 | tal:define="lp_js string:${icingroot}/build" |
33 | tal:attributes="src string:${lp_js}/bugs/filebug-dupefinder.js"></script> |
34 | <script type="text/javascript"> |
35 | - YUI().use('base', 'node', 'oop', 'event', 'bugs.dupe_finder', function(Y) { |
36 | + LPS.use('base', 'node', 'oop', 'event', 'bugs.dupe_finder', function(Y) { |
37 | Y.bugs.setup_dupe_finder(); |
38 | }); |
39 | </script> |
40 | |
41 | === modified file 'lib/lp/bugs/templates/bugtarget-portlet-bugfilters.pt' |
42 | --- lib/lp/bugs/templates/bugtarget-portlet-bugfilters.pt 2009-11-04 13:56:17 +0000 |
43 | +++ lib/lp/bugs/templates/bugtarget-portlet-bugfilters.pt 2009-12-07 12:38:12 +0000 |
44 | @@ -12,7 +12,7 @@ |
45 | <img src="/@@/spinner" /> |
46 | </div> |
47 | <script type="text/javascript"> |
48 | - YUI().use('io-base', 'node', function(Y) { |
49 | + LPS.use('io-base', 'node', function(Y) { |
50 | Y.on('domready', function() { |
51 | var portlet = Y.one('#portlet-bugfilters'); |
52 | Y.one('#bugfilters-portlet-spinner').setStyle('display', 'block'); |
53 | |
54 | === modified file 'lib/lp/bugs/templates/bugtarget-portlet-bugtags.pt' |
55 | --- lib/lp/bugs/templates/bugtarget-portlet-bugtags.pt 2009-11-04 13:56:17 +0000 |
56 | +++ lib/lp/bugs/templates/bugtarget-portlet-bugtags.pt 2009-12-07 12:38:12 +0000 |
57 | @@ -9,7 +9,7 @@ |
58 | <a id="tags-content-link" |
59 | tal:attributes="href context/fmt:url/+bugtarget-portlet-tags-content"></a> |
60 | <script type="text/javascript"> |
61 | - YUI().use('io-base', 'node', function(Y) { |
62 | + LPS.use('io-base', 'node', function(Y) { |
63 | Y.on('domready', function() { |
64 | Y.one('#tags-portlet-spinner').setStyle('display', 'block'); |
65 | |
66 | |
67 | === modified file 'lib/lp/bugs/templates/bugtask-index.pt' |
68 | --- lib/lp/bugs/templates/bugtask-index.pt 2009-11-30 17:57:15 +0000 |
69 | +++ lib/lp/bugs/templates/bugtask-index.pt 2009-12-07 12:38:12 +0000 |
70 | @@ -37,7 +37,7 @@ |
71 | </script> |
72 | </tal:devmode> |
73 | <script type="text/javascript"> |
74 | - YUI().use('base', 'node', 'oop', 'event', 'bugs.bugtask_index', |
75 | + LPS.use('base', 'node', 'oop', 'event', 'bugs.bugtask_index', |
76 | 'code.branchmergeproposal.popupdiff', function(Y) { |
77 | Y.bugs.setup_bugtask_index(); |
78 | Y.on('load', function(e) { |
79 | @@ -155,7 +155,7 @@ |
80 | <img src="/@@/spinner" id="tags-edit-spinner" style="display: none" /> |
81 | <a href="+edit" title="Edit tags" id="edit-tags-trigger" class="sprite edit"></a> |
82 | <script type="text/javascript"> |
83 | - YUI().use('event', 'node', 'bugs.bug_tags_entry', function(Y) { |
84 | + LPS.use('event', 'node', 'bugs.bug_tags_entry', function(Y) { |
85 | // XXX intellectronica 2009-04-16 bug #362309: |
86 | // The load event fires very late on bug pages that take a |
87 | // long time to render, but we prefer to use it since the |
88 | @@ -295,7 +295,7 @@ |
89 | button.style.display = 'none'; |
90 | </script> |
91 | <script type="text/javascript"> |
92 | - YUI().use('lp.comment', function(Y) { |
93 | + LPS.use('lp.comment', function(Y) { |
94 | var comment = new Y.lp.Comment(); |
95 | comment.render(); |
96 | }); |
97 | |
98 | === modified file 'lib/lp/bugs/templates/bugtask-tasks-and-nominations-table-row.pt' |
99 | --- lib/lp/bugs/templates/bugtask-tasks-and-nominations-table-row.pt 2009-11-03 15:32:31 +0000 |
100 | +++ lib/lp/bugs/templates/bugtask-tasks-and-nominations-table-row.pt 2009-12-07 12:38:12 +0000 |
101 | @@ -185,7 +185,7 @@ |
102 | class="bugtasks-table-row-init-script" |
103 | tal:condition="not:view/many_bugtasks" |
104 | tal:content="string: |
105 | - YUI().use('event', 'bugs.bugtask_index', function(Y) { |
106 | + LPS.use('event', 'bugs.bugtask_index', function(Y) { |
107 | Y.on('load', |
108 | function(e) { |
109 | Y.bugs.setup_bugtask_row(${view/js_config}); |
110 | |
111 | === modified file 'lib/lp/bugs/templates/bugtasks-and-nominations-table.pt' |
112 | --- lib/lp/bugs/templates/bugtasks-and-nominations-table.pt 2009-09-02 22:13:06 +0000 |
113 | +++ lib/lp/bugs/templates/bugtasks-and-nominations-table.pt 2009-12-07 12:38:12 +0000 |
114 | @@ -88,7 +88,7 @@ |
115 | </span> |
116 | |
117 | <script type="text/javascript" tal:content="string: |
118 | - YUI().use('event', 'bugs.bugtask_index', function(Y) { |
119 | + LPS.use('event', 'bugs.bugtask_index', function(Y) { |
120 | Y.on('load', function(e) { |
121 | Y.bugs.setup_me_too(${view/current_user_affected_js_status}); |
122 | }, window); |
123 | |
124 | === modified file 'lib/lp/bugs/templates/official-bug-target-manage-tags.pt' |
125 | --- lib/lp/bugs/templates/official-bug-target-manage-tags.pt 2009-09-04 17:03:00 +0000 |
126 | +++ lib/lp/bugs/templates/official-bug-target-manage-tags.pt 2009-12-07 12:38:12 +0000 |
127 | @@ -31,7 +31,7 @@ |
128 | </script> |
129 | <script tal:replace="structure view/tags_js_data" /> |
130 | <script type="text/javascript"> |
131 | - YUI().use('event', 'bugs.official_bug_tag_management', function(Y) { |
132 | + LPS.use('event', 'bugs.official_bug_tag_management', function(Y) { |
133 | Y.on('domready', function(e) { |
134 | Y.bugs.setup_official_bug_tag_management(); |
135 | }); |
136 | |
137 | === modified file 'lib/lp/code/templates/branch-import-details.pt' |
138 | --- lib/lp/code/templates/branch-import-details.pt 2009-11-04 13:56:17 +0000 |
139 | +++ lib/lp/code/templates/branch-import-details.pt 2009-12-07 12:38:12 +0000 |
140 | @@ -32,7 +32,7 @@ |
141 | Try again |
142 | </a> |
143 | <script type="text/javascript"> |
144 | - YUI().use('event', 'node', function(Y) { |
145 | + LPS.use('event', 'node', function(Y) { |
146 | Y.on("domready", function () { Y.one('#tryagainlink').setStyle('display', 'inline') }); |
147 | }); |
148 | </script> |
149 | |
150 | === modified file 'lib/lp/code/templates/branch-index.pt' |
151 | --- lib/lp/code/templates/branch-index.pt 2009-11-17 05:07:41 +0000 |
152 | +++ lib/lp/code/templates/branch-index.pt 2009-12-07 12:38:12 +0000 |
153 | @@ -47,7 +47,7 @@ |
154 | </tal:devmode> |
155 | <script type="text/javascript" |
156 | tal:content="string: |
157 | - YUI().use('node', 'event', 'widget', 'plugin', 'overlay', |
158 | + LPS.use('node', 'event', 'widget', 'plugin', 'overlay', |
159 | 'lazr.choiceedit', 'code.branchstatus', |
160 | 'code.branchmergeproposal.popupdiff', |
161 | function(Y) { |
162 | |
163 | === modified file 'lib/lp/code/templates/branch-listing.pt' |
164 | --- lib/lp/code/templates/branch-listing.pt 2009-11-04 13:56:17 +0000 |
165 | +++ lib/lp/code/templates/branch-listing.pt 2009-12-07 12:38:12 +0000 |
166 | @@ -41,7 +41,7 @@ |
167 | } |
168 | registerLaunchpadFunction(hookUpFilterSubmission); |
169 | |
170 | -YUI().use('io-base', 'node', 'json-parse', function(Y) { |
171 | +LPS.use('io-base', 'node', 'json-parse', function(Y) { |
172 | |
173 | function doUpdate(transaction_id, response, args) { |
174 | json_values = Y.JSON.parse(response.responseText); |
175 | |
176 | === modified file 'lib/lp/code/templates/branch-portlet-subscribers.pt' |
177 | --- lib/lp/code/templates/branch-portlet-subscribers.pt 2009-11-04 13:56:17 +0000 |
178 | +++ lib/lp/code/templates/branch-portlet-subscribers.pt 2009-12-07 12:38:12 +0000 |
179 | @@ -41,7 +41,7 @@ |
180 | string:<script id='milestone-script' type='text/javascript'>" /> |
181 | <!-- |
182 | |
183 | - YUI().use('io-base', 'node', 'code.branchsubscription', function(Y) { |
184 | + LPS.use('io-base', 'node', 'code.branchsubscription', function(Y) { |
185 | |
186 | if(Y.UA.ie) { |
187 | Y.one('#subscriber-list').set('innerHTML', |
188 | |
189 | === modified file 'lib/lp/code/templates/branch-related-bugs-specs.pt' |
190 | --- lib/lp/code/templates/branch-related-bugs-specs.pt 2009-09-08 21:42:45 +0000 |
191 | +++ lib/lp/code/templates/branch-related-bugs-specs.pt 2009-12-07 12:38:12 +0000 |
192 | @@ -42,7 +42,7 @@ |
193 | string:<script id='branchlink-script' type='text/javascript'>" /> |
194 | <!-- |
195 | |
196 | - YUI().use('io-base', 'code.branchlinks', function(Y) { |
197 | + LPS.use('io-base', 'code.branchlinks', function(Y) { |
198 | |
199 | if(Y.UA.ie) { |
200 | return; |
201 | |
202 | === modified file 'lib/lp/code/templates/branchmergeproposal-generic-listing.pt' |
203 | --- lib/lp/code/templates/branchmergeproposal-generic-listing.pt 2009-11-04 13:56:17 +0000 |
204 | +++ lib/lp/code/templates/branchmergeproposal-generic-listing.pt 2009-12-07 12:38:12 +0000 |
205 | @@ -24,7 +24,7 @@ |
206 | </form> |
207 | <script type="text/javascript"> |
208 | |
209 | -YUI().use('node', function(Y) { |
210 | +LPS.use('node', function(Y) { |
211 | |
212 | function submit_filter() { |
213 | Y.one('#filter_form').submit(); |
214 | |
215 | === modified file 'lib/lp/registry/templates/object-timeline-graph.pt' |
216 | --- lib/lp/registry/templates/object-timeline-graph.pt 2009-11-24 09:30:01 +0000 |
217 | +++ lib/lp/registry/templates/object-timeline-graph.pt 2009-12-07 12:38:12 +0000 |
218 | @@ -32,7 +32,7 @@ |
219 | include_inactive = false; |
220 | } |
221 | |
222 | - YUI().use('registry.timeline', 'node', function(Y) { |
223 | + LPS.use('registry.timeline', 'node', function(Y) { |
224 | Y.on('domready', function(e) { |
225 | if (Y.UA.ie) { |
226 | return; |
227 | |
228 | === modified file 'lib/lp/registry/templates/person-macros.pt' |
229 | --- lib/lp/registry/templates/person-macros.pt 2009-11-04 13:56:17 +0000 |
230 | +++ lib/lp/registry/templates/person-macros.pt 2009-12-07 12:38:12 +0000 |
231 | @@ -190,7 +190,7 @@ |
232 | condition="private_prefix"> |
233 | <script type="text/javascript" |
234 | tal:content="string: |
235 | - YUI().use('node', 'event', function(Y) { |
236 | + LPS.use('node', 'event', function(Y) { |
237 | // Prepend/remove 'private-' from team name based on visibility |
238 | // setting. User can choose to edit it back out, if they wish. |
239 | function visibility_on_change(e) { |
240 | |
241 | === modified file 'lib/lp/registry/templates/product-new.pt' |
242 | --- lib/lp/registry/templates/product-new.pt 2009-11-04 13:56:17 +0000 |
243 | +++ lib/lp/registry/templates/product-new.pt 2009-12-07 12:38:12 +0000 |
244 | @@ -14,7 +14,7 @@ |
245 | * details widgets until the user states that the project they are |
246 | * registering is not a duplicate. |
247 | */ |
248 | -YUI().use('node', 'lazr.effects', function(Y) { |
249 | +LPS.use('node', 'lazr.effects', function(Y) { |
250 | Y.on('domready', function() { |
251 | /* These two regexps serve slightly different purposes. The first |
252 | * finds the leftmost run of valid url characters for the autofill |
253 | |
254 | === modified file 'lib/lp/registry/templates/productrelease-add-from-series.pt' |
255 | --- lib/lp/registry/templates/productrelease-add-from-series.pt 2009-11-04 13:56:17 +0000 |
256 | +++ lib/lp/registry/templates/productrelease-add-from-series.pt 2009-12-07 12:38:12 +0000 |
257 | @@ -14,7 +14,7 @@ |
258 | <tal:script |
259 | replace="structure |
260 | string:<script id='milestone-script' type='text/javascript'>" /> |
261 | - YUI().use('node', 'lp.milestoneoverlay', function (Y) { |
262 | + LPS.use('node', 'lp.milestoneoverlay', function (Y) { |
263 | |
264 | // This is a value for the SELECT OPTION which is passed with |
265 | // the SELECT's "change" event. It includes some symbols that are not |
266 | |
267 | === modified file 'lib/lp/registry/templates/teammembership-index.pt' |
268 | --- lib/lp/registry/templates/teammembership-index.pt 2009-11-04 13:56:17 +0000 |
269 | +++ lib/lp/registry/templates/teammembership-index.pt 2009-12-07 12:38:12 +0000 |
270 | @@ -20,7 +20,7 @@ |
271 | use-macro="context/@@launchpad_widget_macros/yui2calendar-dependencies" /> |
272 | |
273 | <script type="text/javascript"> |
274 | - YUI().use('node', 'lp.calendar', function(Y) { |
275 | + LPS.use('node', 'lp.calendar', function(Y) { |
276 | // Ensure that when the picker is used the radio button switches |
277 | // from 'Never' to 'On' and the expiry field is enabled. |
278 | Y.on("available", function(e) { |
279 | |
280 | === modified file 'lib/lp/registry/templates/timeline-macros.pt' |
281 | --- lib/lp/registry/templates/timeline-macros.pt 2009-11-04 13:56:17 +0000 |
282 | +++ lib/lp/registry/templates/timeline-macros.pt 2009-12-07 12:38:12 +0000 |
283 | @@ -35,7 +35,7 @@ |
284 | if (auto_resize == 'true') { |
285 | timeline_url += 'resize_frame=timeline-iframe&'; |
286 | } |
287 | - YUI().use('node', function(Y) { |
288 | + LPS.use('node', function(Y) { |
289 | if (Y.UA.ie) { |
290 | return; |
291 | } |
292 | |
293 | === modified file 'lib/lp/soyuz/templates/archive-edit-dependencies.pt' |
294 | --- lib/lp/soyuz/templates/archive-edit-dependencies.pt 2009-11-12 17:26:17 +0000 |
295 | +++ lib/lp/soyuz/templates/archive-edit-dependencies.pt 2009-12-07 12:38:12 +0000 |
296 | @@ -62,7 +62,7 @@ |
297 | </div> <!-- launchpad_form --> |
298 | |
299 | <script type="text/javascript"> |
300 | - YUI().use("node", function(Y) { |
301 | + LPS.use("node", function(Y) { |
302 | |
303 | // Highlight (setting bold font-weight) the label for the |
304 | // selected option in a given NodesList. Assumes the input is |
305 | |
306 | === modified file 'lib/lp/soyuz/templates/archive-macros.pt' |
307 | --- lib/lp/soyuz/templates/archive-macros.pt 2009-11-04 19:59:16 +0000 |
308 | +++ lib/lp/soyuz/templates/archive-macros.pt 2009-12-07 12:38:12 +0000 |
309 | @@ -10,7 +10,7 @@ |
310 | </tal:comment> |
311 | |
312 | <script type="text/javascript"> |
313 | -YUI().use('node', 'io-base', 'lazr.anim', 'soyuz-base', function(Y) { |
314 | +LPS.use('node', 'io-base', 'lazr.anim', 'soyuz-base', function(Y) { |
315 | |
316 | |
317 | /* |
318 | |
319 | === modified file 'lib/lp/soyuz/templates/archive-packages.pt' |
320 | --- lib/lp/soyuz/templates/archive-packages.pt 2009-11-04 13:56:17 +0000 |
321 | +++ lib/lp/soyuz/templates/archive-packages.pt 2009-12-07 12:38:12 +0000 |
322 | @@ -23,7 +23,7 @@ |
323 | </tal:devmode> |
324 | <script type="text/javascript" id="repository-size-update" |
325 | tal:condition="view/archive_url"> |
326 | -YUI().use('io-base', 'lazr.anim', 'node', 'soyuz-base', |
327 | +LPS.use('io-base', 'lazr.anim', 'node', 'soyuz-base', |
328 | 'soyuz.update_archive_build_statuses', function(Y) { |
329 | |
330 | |
331 | |
332 | === modified file 'lib/lp/soyuz/templates/archive-subscribers.pt' |
333 | --- lib/lp/soyuz/templates/archive-subscribers.pt 2009-09-29 07:21:40 +0000 |
334 | +++ lib/lp/soyuz/templates/archive-subscribers.pt 2009-12-07 12:38:12 +0000 |
335 | @@ -98,7 +98,7 @@ |
336 | </form> |
337 | </div><!-- class="portlet" --> |
338 | <script type="text/javascript" id="setup-archivesubscribers-index"> |
339 | - YUI().use('soyuz.archivesubscribers_index', function(Y) { |
340 | + LPS.use('soyuz.archivesubscribers_index', function(Y) { |
341 | Y.soyuz.setup_archivesubscribers_index(); |
342 | }); |
343 | </script> |
344 | |
345 | === modified file 'lib/lp/translations/browser/language.py' |
346 | --- lib/lp/translations/browser/language.py 2009-10-31 11:06:44 +0000 |
347 | +++ lib/lp/translations/browser/language.py 2009-12-07 12:38:12 +0000 |
348 | @@ -29,6 +29,7 @@ |
349 | enabled_with_permission, GetitemNavigation, LaunchpadEditFormView, |
350 | LaunchpadFormView, LaunchpadView, Link, NavigationMenu) |
351 | from lp.translations.utilities.pluralforms import make_friendly_plural_forms |
352 | +from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities |
353 | |
354 | from canonical.widgets import LabeledMultiCheckBoxWidget |
355 | |
356 | @@ -202,6 +203,13 @@ |
357 | |
358 | return pluralforms_list |
359 | |
360 | + @property |
361 | + def add_question_url(self): |
362 | + rosetta = getUtility(ILaunchpadCelebrities).lp_translations |
363 | + return canonical_url( |
364 | + rosetta, |
365 | + view_name='+addquestion', |
366 | + rootsite='answers') |
367 | |
368 | class LanguageAdminView(LaunchpadEditFormView): |
369 | """Handle an admin form submission.""" |
370 | |
371 | === modified file 'lib/lp/translations/stories/standalone/xx-language.txt' |
372 | --- lib/lp/translations/stories/standalone/xx-language.txt 2009-10-31 11:06:44 +0000 |
373 | +++ lib/lp/translations/stories/standalone/xx-language.txt 2009-12-07 12:38:12 +0000 |
374 | @@ -1,6 +1,15 @@ |
375 | + |
376 | + |
377 | +Languages view |
378 | +============== |
379 | + |
380 | Here is the tale of languages. We will see how to create, find and edit |
381 | them. |
382 | |
383 | + |
384 | +Getting there |
385 | +------------- |
386 | + |
387 | Launchpad Translations has a main page. |
388 | |
389 | >>> admin_browser.open('http://translations.launchpad.dev/') |
390 | @@ -11,7 +20,12 @@ |
391 | >>> print admin_browser.url |
392 | http://translations.launchpad.dev/+languages |
393 | |
394 | -Following the link, there is a form to add new languages. |
395 | + |
396 | +Adding new languages |
397 | +-------------------- |
398 | + |
399 | +Following the link from the translations main page, there is a form to |
400 | +add new languages. |
401 | |
402 | >>> admin_browser.getLink('Add new language').click() |
403 | >>> print admin_browser.url |
404 | @@ -65,11 +79,16 @@ |
405 | ... |
406 | LinkNotFoundError |
407 | |
408 | - >>> user_browser.open('http://translations.launchpad.dev/+languages/+add') |
409 | + >>> user_browser.open( |
410 | + ... 'http://translations.launchpad.dev/+languages/+add') |
411 | Traceback (most recent call last): |
412 | ... |
413 | Unauthorized:... |
414 | |
415 | + |
416 | +Searching for a language |
417 | +------------------------ |
418 | + |
419 | From the top languages page, anyone can find languages. |
420 | |
421 | >>> browser.open('http://translations.launchpad.dev/+languages') |
422 | @@ -82,7 +101,11 @@ |
423 | >>> print browser.url |
424 | http://translations.launchpad.dev/+languages/+index?find=Spanish |
425 | |
426 | -And following one of the found languages, we can see a brief information |
427 | + |
428 | +Read language information |
429 | +------------------------- |
430 | + |
431 | +Following one of the found languages, we can see a brief information |
432 | about the selected language. |
433 | |
434 | >>> browser.getLink('Spanish').click() |
435 | @@ -128,14 +151,50 @@ |
436 | ...Uruguay... |
437 | ...Venezuela... |
438 | |
439 | - >>> topcontributors_portlet = find_portlet(browser.contents, 'Top contributors') |
440 | + >>> topcontributors_portlet = find_portlet( |
441 | + ... browser.contents, 'Top contributors') |
442 | >>> print topcontributors_portlet |
443 | <... |
444 | ...Carlos Perelló Marín... |
445 | |
446 | +Our test sample data does not know about plural forms of |
447 | +Abkhazian and about countries where this language is spoken. |
448 | + |
449 | +We will see a note about missing plural forms and a link to Rosetta |
450 | +add question page for informing Rosetta admin about the right plural |
451 | +form. |
452 | + |
453 | + >>> browser.open('http://translations.launchpad.dev/+languages/ab') |
454 | + >>> print extract_text(find_portlet(browser.contents, 'Plural forms' |
455 | + ... ).renderContents()) |
456 | + Plural forms |
457 | + Unfortunately, Launchpad doesn't know the plural |
458 | + form information for this language... |
459 | + |
460 | + >>> print browser.getLink(id='plural_question').url |
461 | + http://answers.launchpad.dev/rosetta/+addquestion |
462 | + |
463 | +We will see a note that Launchpad does not know in which countries |
464 | +this language is spoken and a link to add question page for informing |
465 | +Rosetta admin about the countries where this page is officially spoken. |
466 | + |
467 | + >>> countries_portlet = find_portlet(browser.contents, 'Countries') |
468 | + >>> print countries_portlet |
469 | + <... |
470 | + Abkhazian is not registered as being spoken in any |
471 | + country... |
472 | + |
473 | + >>> print browser.getLink(id='country_question').url |
474 | + http://answers.launchpad.dev/rosetta/+addquestion |
475 | + |
476 | + |
477 | +Edit language information |
478 | +------------------------- |
479 | + |
480 | Finally, there is the edit form to change language basic information. |
481 | |
482 | - >>> user_browser.open('http://translations.launchpad.dev/+languages/es') |
483 | + >>> user_browser.open( |
484 | + ... 'http://translations.launchpad.dev/+languages/es') |
485 | >>> print user_browser.url |
486 | http://translations.launchpad.dev/+languages/es |
487 | |
488 | @@ -146,7 +205,8 @@ |
489 | ... |
490 | LinkNotFoundError |
491 | |
492 | - >>> user_browser.open('http://translations.launchpad.dev/+languages/es/+admin') |
493 | + >>> user_browser.open( |
494 | + ... 'http://translations.launchpad.dev/+languages/es/+admin') |
495 | Traceback (most recent call last): |
496 | ... |
497 | Unauthorized:... |
498 | @@ -155,7 +215,8 @@ |
499 | |
500 | >>> from canonical.launchpad.testing.pages import strip_label |
501 | |
502 | - >>> admin_browser.open('http://translations.launchpad.dev/+languages/es') |
503 | + >>> admin_browser.open( |
504 | + ... 'http://translations.launchpad.dev/+languages/es') |
505 | >>> print admin_browser.url |
506 | http://translations.launchpad.dev/+languages/es |
507 | |
508 | |
509 | === modified file 'lib/lp/translations/templates/language-index.pt' |
510 | --- lib/lp/translations/templates/language-index.pt 2009-09-17 14:45:59 +0000 |
511 | +++ lib/lp/translations/templates/language-index.pt 2009-12-07 12:38:12 +0000 |
512 | @@ -43,8 +43,10 @@ |
513 | <p class="helpwanted"> |
514 | Unfortunately, Launchpad doesn't know the plural form |
515 | information for this language. If you know it, please open a |
516 | - <a href="/rosetta/+addticket">ticket</a> with that information, |
517 | - so we can add it to Launchpad. |
518 | + <a id='plural_question' |
519 | + tal:attributes="href view/add_question_url" |
520 | + >question</a> |
521 | + with that information, so we can add it to Launchpad. |
522 | </p> |
523 | </tal:has_not_pluralforms> |
524 | </div> |
525 | @@ -124,8 +126,11 @@ |
526 | </tal:language> |
527 | is not registered as being spoken in any country. If you know |
528 | about a country that officially speaks this language, please |
529 | - open a <a href="/rosetta/+addticket">ticket</a> with that |
530 | - information, so we can add it to Launchpad. |
531 | + open a |
532 | + <a id='country_question' |
533 | + tal:attributes="href view/add_question_url" |
534 | + >question</a> |
535 | + with that information, so we can add it to Launchpad. |
536 | </p> |
537 | </tal:has_not_countries> |
538 | </div> |
539 | |
540 | === modified file 'lib/lp/translations/templates/object-templates.pt' |
541 | --- lib/lp/translations/templates/object-templates.pt 2009-11-24 19:23:52 +0000 |
542 | +++ lib/lp/translations/templates/object-templates.pt 2009-12-07 12:38:12 +0000 |
543 | @@ -35,7 +35,7 @@ |
544 | } |
545 | </style> |
546 | <script language="JavaScript" type="text/javascript"> |
547 | - YUI().use('node-base', 'event-delegate', function(Y) { |
548 | + LPS.use('node-base', 'event-delegate', function(Y) { |
549 | Y.on('domready', function(e) { |
550 | Y.all('#templates_table .template_links').addClass( |
551 | 'inactive_links'); |
552 | |
553 | === modified file 'lib/lp/translations/templates/pofile-export.pt' |
554 | --- lib/lp/translations/templates/pofile-export.pt 2009-11-10 21:04:19 +0000 |
555 | +++ lib/lp/translations/templates/pofile-export.pt 2009-12-07 12:38:12 +0000 |
556 | @@ -13,7 +13,7 @@ |
557 | } |
558 | </style> |
559 | <script type="text/javascript"> |
560 | - YUI().use('node', 'event', function(Y){ |
561 | + LPS.use('node', 'event', function(Y){ |
562 | Y.on('domready', function(){ |
563 | // The pochanged option is only available for the PO format. |
564 | var formatlist = Y.one('#div_format select'); |
565 | |
566 | === modified file 'lib/lp/translations/templates/pofile-translate.pt' |
567 | --- lib/lp/translations/templates/pofile-translate.pt 2009-11-04 19:59:16 +0000 |
568 | +++ lib/lp/translations/templates/pofile-translate.pt 2009-12-07 12:38:12 +0000 |
569 | @@ -20,7 +20,7 @@ |
570 | <script type="text/javascript"> |
571 | registerLaunchpadFunction(insertAllExpansionButtons); |
572 | |
573 | - YUI().use('node', 'cookie', 'anim', 'lp.pofile', function(Y) { |
574 | + LPS.use('node', 'cookie', 'anim', 'lp.pofile', function(Y) { |
575 | |
576 | var hide_notification = function(node) { |
577 | var hide_anim = new Y.Anim({ |
578 | |
579 | === modified file 'lib/lp/translations/templates/translation-import-queue-macros.pt' |
580 | --- lib/lp/translations/templates/translation-import-queue-macros.pt 2009-11-20 14:15:34 +0000 |
581 | +++ lib/lp/translations/templates/translation-import-queue-macros.pt 2009-12-07 12:38:12 +0000 |
582 | @@ -18,7 +18,7 @@ |
583 | </script> |
584 | |
585 | <script type="text/javascript"> |
586 | - YUI().use( 'translations', 'event', function(Y) { |
587 | + LPS.use( 'translations', 'event', function(Y) { |
588 | Y.on('domready', function(e) { |
589 | Y.translations.initialize_import_queue_page(Y); |
590 | }); |
591 | |
592 | === modified file 'lib/lp/translations/templates/translationimportqueueentry-index.pt' |
593 | --- lib/lp/translations/templates/translationimportqueueentry-index.pt 2009-11-04 13:56:17 +0000 |
594 | +++ lib/lp/translations/templates/translationimportqueueentry-index.pt 2009-12-07 12:38:12 +0000 |
595 | @@ -14,7 +14,7 @@ |
596 | } |
597 | </style> |
598 | <script type="text/javascript"> |
599 | - YUI().use('node', 'lazr.anim', function(Y) { |
600 | + LPS.use('node', 'lazr.anim', function(Y) { |
601 | var fields = {'POT': |
602 | ['field.name', 'field.translation_domain', |
603 | 'field.languagepack'], |
604 | |
605 | === modified file 'lib/lp/translations/templates/translationmessage-translate.pt' |
606 | --- lib/lp/translations/templates/translationmessage-translate.pt 2009-09-17 07:28:30 +0000 |
607 | +++ lib/lp/translations/templates/translationmessage-translate.pt 2009-12-07 12:38:12 +0000 |
608 | @@ -18,7 +18,7 @@ |
609 | tal:define="lp_js string:${icingroot}/build" |
610 | tal:attributes="src string:${lp_js}/translations/pofile.js"></script> |
611 | <script type="text/javascript"> |
612 | - YUI().use('node', 'lp.pofile', function(Y) { |
613 | + LPS.use('node', 'lp.pofile', function(Y) { |
614 | Y.on('domready', Y.lp.pofile.setupSuggestionDismissal); |
615 | }); |
616 | </script> |
This will make my combo-loader branch much smaller as I'll only have to macros. pt.
pass the YUI config in one place -- base-template-
reviewer mars