Merge lp:~mars/launchpad/yui-3final-upgrade into lp:launchpad/db-devel
- yui-3final-upgrade
- Merge into db-devel
Status: | Merged |
---|---|
Approved by: | Francis J. Lacoste |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp:~mars/launchpad/yui-3final-upgrade |
Merge into: | lp:launchpad/db-devel |
Diff against target: |
3382 lines (+631/-613) 56 files modified
Makefile (+9/-3) lib/canonical/launchpad/javascript/bugs/bug_tags_entry.js (+27/-28) lib/canonical/launchpad/javascript/bugs/bugtask-index.js (+104/-104) lib/canonical/launchpad/javascript/bugs/filebug-dupefinder.js (+26/-37) lib/canonical/launchpad/javascript/bugs/offical_bug_tags.js (+27/-27) lib/canonical/launchpad/javascript/bugs/subscriber.js (+10/-12) lib/canonical/launchpad/javascript/bugs/tests/test_me_too.js (+6/-6) lib/canonical/launchpad/javascript/bugs/tests/test_subscriber.js (+2/-2) lib/canonical/launchpad/javascript/client/client.js (+13/-8) lib/canonical/launchpad/javascript/code/branchlinks.js (+18/-21) lib/canonical/launchpad/javascript/code/branchstatus.js (+3/-3) lib/canonical/launchpad/javascript/code/branchsubscription.js (+13/-13) lib/canonical/launchpad/javascript/code/codereview.js (+7/-7) lib/canonical/launchpad/javascript/lp/calendar.js (+3/-3) lib/canonical/launchpad/javascript/lp/comment.js (+9/-9) lib/canonical/launchpad/javascript/lp/lp.js (+123/-125) lib/canonical/launchpad/javascript/lp/mapping.js (+5/-5) lib/canonical/launchpad/javascript/lp/picker.js (+4/-4) lib/canonical/launchpad/javascript/lp/tests/test_lp_collapsibles.js (+35/-35) lib/canonical/launchpad/javascript/registry/milestone_table.js (+1/-1) lib/canonical/launchpad/javascript/registry/milestoneoverlay.js (+2/-2) lib/canonical/launchpad/javascript/registry/tests/test_milestone_table.js (+4/-4) lib/canonical/launchpad/javascript/registry/tests/timeline.js (+14/-14) lib/canonical/launchpad/javascript/soyuz/archivesubscribers_index.js (+5/-5) lib/canonical/launchpad/javascript/soyuz/lp_dynamic_dom_updater.js (+2/-2) lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.js (+7/-7) lib/canonical/launchpad/javascript/soyuz/update_archive_build_statuses.js (+18/-20) lib/canonical/launchpad/javascript/translations/translations.js (+1/-1) lib/lp/app/templates/base-layout-macros.pt (+34/-4) lib/lp/app/templates/base-layout.pt (+1/-1) lib/lp/bugs/templates/bug-portlet-subscribers.pt (+1/-1) lib/lp/bugs/templates/bugtarget-portlet-bugfilters.pt (+4/-4) lib/lp/bugs/templates/bugtarget-portlet-bugtags.pt (+4/-4) lib/lp/bugs/templates/bugtask-index.pt (+1/-1) lib/lp/code/templates/branch-import-details.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/branchmergeproposal-generic-listing.pt (+2/-2) lib/lp/registry/templates/distributionsourcepackage-index.pt (+2/-2) lib/lp/registry/templates/object-timeline-graph.pt (+2/-2) lib/lp/registry/templates/person-macros.pt (+1/-1) lib/lp/registry/templates/product-new.pt (+13/-13) lib/lp/registry/templates/productrelease-add-from-series.pt (+2/-2) lib/lp/registry/templates/teammembership-index.pt (+3/-3) lib/lp/registry/templates/timeline-macros.pt (+2/-2) lib/lp/soyuz/templates/archive-edit-dependencies.pt (+19/-26) lib/lp/soyuz/templates/archive-index.pt (+2/-2) lib/lp/soyuz/templates/archive-macros.pt (+3/-3) lib/lp/soyuz/templates/archive-packages.pt (+1/-1) lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py (+11/-8) lib/lp/translations/templates/object-templates.pt (+10/-12) lib/lp/translations/templates/pofile-export.pt (+3/-3) lib/lp/translations/templates/pofile-translate.pt (+3/-3) lib/lp/translations/templates/translationimportqueueentry-index.pt (+1/-1) setup.py (+2/-0) versions.cfg (+3/-1) |
To merge this branch: | bzr merge lp:~mars/launchpad/yui-3final-upgrade |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Francis J. Lacoste (community) | code | Approve | |
Review via email: mp+14838@code.launchpad.net |
Commit message
Description of the change
Māris Fogels (mars) wrote : | # |
Francis J. Lacoste (flacoste) wrote : | # |
On November 13, 2009, Māris Fogels wrote:
> Māris Fogels has proposed merging lp:~mars/launchpad/yui-3final-upgrade
> into lp:launchpad.
>
> Requested reviews:
> Canonical Launchpad Engineering (launchpad)
>
>
> Hi,
>
> This branch upgrades Launchpad's JavaScript from YUI 3 PR2 to YUI 3.0.0
> final.
>
> The branch has a few windmill errors, so it should not be merged quite yet.
> However, the diff is large, so it is probably in everyone's best interest
> to review it before it grows more.
>
> There are some changes to the underlying build system that need to be
> reverted before submission, such as the changes to setup.py, buildout.cfg,
> etc.
>
status approved
review approve code
Thanks a lot for this branch! It contains a lot of nice clean-ups and even a
bug fix!
Here are the few comments I have and we already discussed those live. So feel
free to land on db-devel once these are handled. We should do QA on staging
Monday and Tuesday, and if most of the things seem to work, let's land it on
devel Wednesday.
Cheers
--
Francis J. Lacoste
<email address hidden>
1 | 0 | > === modified file 'Makefile' | 0 | > === modified file 'Makefile' |
2 | 1 | 1 | ||
3 | 2 | > + # We absolutely do not want to include the testing module and its | 2 | > + # We absolutely do not want to include the testing module and its |
4 | 3 | > + # jsTestDriver test harness hacks. They fiddle with built-in functions! | 3 | > + # jsTestDriver test harness hacks. They fiddle with built-in functions! |
5 | 4 | > + ${SHHH} bin/jsbuild $(JSFLAGS) -b $(LAZR_BUILT_JS_ROOT) -x testing/ | 4 | > + ${SHHH} bin/jsbuild $(JSFLAGS) -b $(LAZR_BUILT_JS_ROOT) -x testing/ |
6 | 5 | 5 | ||
7 | 6 | Please update this comment to make it obvious that this is excluded | 6 | Please update this comment to make it obvious that this is excluded |
8 | 7 | from the _production roll-ups_. | 7 | from the _production roll-ups_. |
9 | 8 | 8 | ||
10 | 9 | Also, once landed investigate if the jsTestDriver infrastructure can | 9 | Also, once landed investigate if the jsTestDriver infrastructure can |
11 | 10 | still be used from within Launchpad to run unit tests. If that's not | 10 | still be used from within Launchpad to run unit tests. If that's not |
12 | 11 | the case, file a bug to fix it soon. | 11 | the case, file a bug to fix it soon. |
13 | 12 | 12 | ||
14 | 13 | > === modified file 'buildout.cfg' | 13 | > === modified file 'buildout.cfg' |
15 | 14 | > --- buildout.cfg 2009-10-26 13:49:11 +0000 | 14 | > --- buildout.cfg 2009-10-26 13:49:11 +0000 |
16 | 15 | > +++ buildout.cfg 2009-11-13 15:45:29 +0000 | 15 | > +++ buildout.cfg 2009-11-13 15:45:29 +0000 |
17 | 16 | > @@ -16,7 +16,7 @@ | 16 | > @@ -16,7 +16,7 @@ |
18 | 17 | > # dependencies *other* than those in our download-cache. Once you have the | 17 | > # dependencies *other* than those in our download-cache. Once you have the |
19 | 18 | > # desired software, reenable this option (and check in the new software to | 18 | > # desired software, reenable this option (and check in the new software to |
20 | 19 | > # lp:lp-source-dependencies if this is going to be reviewed/merged/deployed.) | 19 | > # lp:lp-source-dependencies if this is going to be reviewed/merged/deployed.) |
21 | 20 | > -install-from-cache = true | 20 | > -install-from-cache = true |
22 | 21 | > +#install-from-cache = true | 21 | > +#install-from-cache = true |
23 | 22 | > | 22 | > |
24 | 23 | > # This also will need to be temporarily disabled or changed for package | 23 | > # This also will need to be temporarily disabled or changed for package |
25 | 24 | > # upgrades. Newly-added packages should also add their desired version number | 24 | > # upgrades. Newly-added packages should also add their desired version number |
26 | 25 | 25 | ||
27 | 26 | This should be reverted. | 26 | This should be reverted. |
28 | 27 | 27 | ||
29 | 28 | > === modified file 'lib/canonical/launchpad/javascript/bugs/bugtask-index.js' | 28 | > === modified file 'lib/canonical/launchpad/javascript/bugs/bugtask-index.js' |
30 | 29 | > + update_dupe_link.on('click', function(e){ | 29 | > + update_dupe_link.on('click', function(e){ |
31 | 30 | > // Only go ahead if we have received the form content by the | 30 | > // Only go ahead if we have received the form content by the |
32 | 31 | > // time the user clicks: | 31 | > // time the user clicks: |
33 | 32 | > if (duplicate_form_overlay){ | 32 | > if (duplicate_form_overlay){ |
34 | 33 | 33 | ||
35 | 34 | Missing a space between function(e) and { | 34 | Missing a space between function(e) and { |
36 | 35 | 35 | ||
37 | 36 | 36 | ||
38 | 37 | > === modified file 'versions.cfg' | 37 | > === modified file 'versions.cfg' |
39 | 38 | > --- versions.cfg 2009-11-10 14:41:33 +0000 | 38 | > --- versions.cfg 2009-11-10 14:41:33 +0000 |
40 | 39 | > +++ versions.cfg 2009-11-13 15:45:29 +0000 | 39 | > +++ versions.cfg 2009-11-13 15:45:29 +0000 |
41 | 40 | > @@ -32,8 +32,9 @@ | 40 | > @@ -32,8 +32,9 @@ |
42 | 41 | > lazr.restful = 0.9.17 | 41 | > lazr.restful = 0.9.17 |
43 | 42 | > lazr.restfulclient = 0.9.10 | 42 | > lazr.restfulclient = 0.9.10 |
44 | 43 | > lazr.smtptest = 1.1 | 43 | > lazr.smtptest = 1.1 |
45 | 44 | > +lazr.testing = 0.1.1 | 44 | > +lazr.testing = 0.1.1 |
46 | 45 | > lazr.uri = 1.0.2 | 45 | > lazr.uri = 1.0.2 |
47 | 46 | > -lazr-js = 0.9.1 | 46 | > -lazr-js = 0.9.1 |
48 | 47 | > +lazr-js = 0.9DEV | 47 | > +lazr-js = 0.9DEV |
49 | 48 | > martian = 0.11 | 48 | > martian = 0.11 |
50 | 49 | > mechanize = 0.1.7b | 49 | > mechanize = 0.1.7b |
51 | 50 | > mocker = 0.10.1 | 50 | > mocker = 0.10.1 |
52 | 51 | > | 51 | > |
53 | 52 | 52 | ||
54 | 53 | We'll need to add a sdist matching the correct larzr-js revision that we want | 53 | We'll need to add a sdist matching the correct larzr-js revision that we want |
55 | 54 | to use. | 54 | to use. |
Preview Diff
1 | === modified file 'Makefile' | |||
2 | --- Makefile 2009-11-17 13:14:18 +0000 | |||
3 | +++ Makefile 2009-11-18 13:45:26 +0000 | |||
4 | @@ -17,6 +17,7 @@ | |||
5 | 17 | 17 | ||
6 | 18 | LPCONFIG=development | 18 | LPCONFIG=development |
7 | 19 | 19 | ||
8 | 20 | JSFLAGS= | ||
9 | 20 | LP_BUILT_JS_ROOT=lib/canonical/launchpad/icing/build | 21 | LP_BUILT_JS_ROOT=lib/canonical/launchpad/icing/build |
10 | 21 | LAZR_BUILT_JS_ROOT=lazr-js/build | 22 | LAZR_BUILT_JS_ROOT=lazr-js/build |
11 | 22 | 23 | ||
12 | @@ -124,12 +125,17 @@ | |||
13 | 124 | build: $(BZR_VERSION_INFO) compile apidoc jsbuild | 125 | build: $(BZR_VERSION_INFO) compile apidoc jsbuild |
14 | 125 | 126 | ||
15 | 126 | jsbuild_lazr: | 127 | jsbuild_lazr: |
17 | 127 | ${SHHH} bin/jsbuild -b lazr-js/build | 128 | # We absolutely do not want to include the lazr.testing module and its |
18 | 129 | # jsTestDriver test harness modifications in the lazr.js and launchpad.js | ||
19 | 130 | # roll-up files. They fiddle with built-in functions! See Bug 482340. | ||
20 | 131 | ${SHHH} bin/jsbuild $(JSFLAGS) -b $(LAZR_BUILT_JS_ROOT) -x testing/ | ||
21 | 128 | 132 | ||
22 | 129 | jsbuild: jsbuild_lazr | 133 | jsbuild: jsbuild_lazr |
23 | 130 | ${SHHH} bin/jsbuild \ | 134 | ${SHHH} bin/jsbuild \ |
26 | 131 | -n launchpad -s lib/canonical/launchpad/javascript \ | 135 | $(JSFLAGS) \ |
27 | 132 | -b lib/canonical/launchpad/icing/build \ | 136 | -n launchpad \ |
28 | 137 | -s lib/canonical/launchpad/javascript \ | ||
29 | 138 | -b $(LP_BUILT_JS_ROOT) \ | ||
30 | 133 | lib/canonical/launchpad/icing/MochiKit.js \ | 139 | lib/canonical/launchpad/icing/MochiKit.js \ |
31 | 134 | $(shell $(HERE)/utilities/yui-deps.py) \ | 140 | $(shell $(HERE)/utilities/yui-deps.py) \ |
32 | 135 | lib/canonical/launchpad/icing/lazr/build/lazr.js | 141 | lib/canonical/launchpad/icing/lazr/build/lazr.js |
33 | 136 | 142 | ||
34 | === added symlink 'lib/canonical/launchpad/icing/lazr' | |||
35 | === target is u'../../../../lazr-js' | |||
36 | === removed symlink 'lib/canonical/launchpad/icing/lazr' | |||
37 | === target was u'../../../../lazr-js' | |||
38 | === added symlink 'lib/canonical/launchpad/icing/yui' | |||
39 | === target is u'../../../../lazr-js/build/yui' | |||
40 | === removed symlink 'lib/canonical/launchpad/icing/yui' | |||
41 | === target was u'../../../../lazr-js/build/yui' | |||
42 | === modified file 'lib/canonical/launchpad/javascript/bugs/bug_tags_entry.js' | |||
43 | --- lib/canonical/launchpad/javascript/bugs/bug_tags_entry.js 2009-07-17 18:46:25 +0000 | |||
44 | +++ lib/canonical/launchpad/javascript/bugs/bug_tags_entry.js 2009-11-18 13:45:26 +0000 | |||
45 | @@ -42,12 +42,11 @@ | |||
46 | 42 | */ | 42 | */ |
47 | 43 | var populate_tags_input = function() { | 43 | var populate_tags_input = function() { |
48 | 44 | var tags = []; | 44 | var tags = []; |
55 | 45 | var anchors = tag_list_span.queryAll(A); | 45 | |
56 | 46 | if (anchors != null) { | 46 | tag_list_span.all(A).each(function(anchor) { |
57 | 47 | tag_list_span.queryAll(A).each(function(a) { | 47 | tags.push(anchor.get(INNER_HTML)); |
58 | 48 | tags.push(a.get(INNER_HTML)); | 48 | }); |
59 | 49 | }); | 49 | |
54 | 50 | } | ||
60 | 51 | tag_input.set(VALUE, tags.join(' ') + ' '); | 50 | tag_input.set(VALUE, tags.join(' ') + ' '); |
61 | 52 | }; | 51 | }; |
62 | 53 | 52 | ||
63 | @@ -68,7 +67,7 @@ | |||
64 | 68 | function(elem) { return elem != ''; }); | 67 | function(elem) { return elem != ''; }); |
65 | 69 | var bug = new LP.client.Entry( | 68 | var bug = new LP.client.Entry( |
66 | 70 | lp_client, LP.client.cache[BUG], LP.client.cache[BUG].self_link); | 69 | lp_client, LP.client.cache[BUG], LP.client.cache[BUG].self_link); |
68 | 71 | bug.removeAtt('http_etag'); | 70 | bug.removeAttr('http_etag'); |
69 | 72 | bug.set('tags', tags); | 71 | bug.set('tags', tags); |
70 | 73 | tags_edit_spinner.setStyle(DISPLAY, INLINE); | 72 | tags_edit_spinner.setStyle(DISPLAY, INLINE); |
71 | 74 | ok_button.setStyle(DISPLAY, NONE); | 73 | ok_button.setStyle(DISPLAY, NONE); |
72 | @@ -104,10 +103,10 @@ | |||
73 | 104 | tags_edit_spinner.setStyle(DISPLAY, NONE); | 103 | tags_edit_spinner.setStyle(DISPLAY, NONE); |
74 | 105 | Y.lazr.anim.green_flash({ node: tag_list_span }).run(); | 104 | Y.lazr.anim.green_flash({ node: tag_list_span }).run(); |
75 | 106 | if (Y.Lang.trim(tags_html) == '') { | 105 | if (Y.Lang.trim(tags_html) == '') { |
80 | 107 | Y.get('#bug-tags').removeClass(TAGS_SHOW); | 106 | Y.one('#bug-tags').removeClass(TAGS_SHOW); |
81 | 108 | Y.get('#bug-tags').addClass(TAGS_HIDE); | 107 | Y.one('#bug-tags').addClass(TAGS_HIDE); |
82 | 109 | Y.get('#add-bug-tags').removeClass(TAGS_HIDE); | 108 | Y.one('#add-bug-tags').removeClass(TAGS_HIDE); |
83 | 110 | Y.get('#add-bug-tags').addClass(TAGS_SHOW); | 109 | Y.one('#add-bug-tags').addClass(TAGS_SHOW); |
84 | 111 | } | 110 | } |
85 | 112 | }, | 111 | }, |
86 | 113 | failure: function(id, request) { | 112 | failure: function(id, request) { |
87 | @@ -132,10 +131,10 @@ | |||
88 | 132 | autocomplete.hide() | 131 | autocomplete.hide() |
89 | 133 | Y.lazr.anim.red_flash({ node: tag_list_span }).run(); | 132 | Y.lazr.anim.red_flash({ node: tag_list_span }).run(); |
90 | 134 | if (Y.Lang.trim(tag_list_span.get('innerHTML')) == '') { | 133 | if (Y.Lang.trim(tag_list_span.get('innerHTML')) == '') { |
95 | 135 | Y.get('#bug-tags').removeClass(TAGS_SHOW); | 134 | Y.one('#bug-tags').removeClass(TAGS_SHOW); |
96 | 136 | Y.get('#bug-tags').addClass(TAGS_HIDE); | 135 | Y.one('#bug-tags').addClass(TAGS_HIDE); |
97 | 137 | Y.get('#add-bug-tags').removeClass(TAGS_HIDE); | 136 | Y.one('#add-bug-tags').removeClass(TAGS_HIDE); |
98 | 138 | Y.get('#add-bug-tags').addClass(TAGS_SHOW); | 137 | Y.one('#add-bug-tags').addClass(TAGS_SHOW); |
99 | 139 | } | 138 | } |
100 | 140 | }; | 139 | }; |
101 | 141 | 140 | ||
102 | @@ -164,15 +163,15 @@ | |||
103 | 164 | if (LP.client.links['me'] === undefined) { return; } | 163 | if (LP.client.links['me'] === undefined) { return; } |
104 | 165 | 164 | ||
105 | 166 | available_tags = Y.Array(available_official_tags); | 165 | available_tags = Y.Array(available_official_tags); |
115 | 167 | bug_tags_div = Y.get('#bug-tags'); | 166 | bug_tags_div = Y.one('#bug-tags'); |
116 | 168 | edit_tags_trigger = bug_tags_div.query('#edit-tags-trigger'); | 167 | edit_tags_trigger = bug_tags_div.one('#edit-tags-trigger'); |
117 | 169 | add_tags_trigger = Y.get('#add-tags-trigger'); | 168 | add_tags_trigger = Y.one('#add-tags-trigger'); |
118 | 170 | tag_list_span = bug_tags_div.query('#tag-list'); | 169 | tag_list_span = bug_tags_div.one('#tag-list'); |
119 | 171 | tag_input = bug_tags_div.query('#tag-input'); | 170 | tag_input = bug_tags_div.one('#tag-input'); |
120 | 172 | ok_button = bug_tags_div.query('#edit-tags-ok'); | 171 | ok_button = bug_tags_div.one('#edit-tags-ok'); |
121 | 173 | cancel_button = bug_tags_div.query('#edit-tags-cancel'); | 172 | cancel_button = bug_tags_div.one('#edit-tags-cancel'); |
122 | 174 | tags_edit_spinner = bug_tags_div.query('#tags-edit-spinner'); | 173 | tags_edit_spinner = bug_tags_div.one('#tags-edit-spinner'); |
123 | 175 | tags_form = bug_tags_div.query('#tags-form'); | 174 | tags_form = bug_tags_div.one('#tags-form'); |
124 | 176 | 175 | ||
125 | 177 | edit_tags_trigger.on('click', function(e) { | 176 | edit_tags_trigger.on('click', function(e) { |
126 | 178 | e.halt(); | 177 | e.halt(); |
127 | @@ -181,10 +180,10 @@ | |||
128 | 181 | 180 | ||
129 | 182 | add_tags_trigger.on('click', function(e) { | 181 | add_tags_trigger.on('click', function(e) { |
130 | 183 | e.halt(); | 182 | e.halt(); |
135 | 184 | Y.get('#bug-tags').removeClass(TAGS_HIDE); | 183 | Y.one('#bug-tags').removeClass(TAGS_HIDE); |
136 | 185 | Y.get('#bug-tags').addClass(TAGS_SHOW); | 184 | Y.one('#bug-tags').addClass(TAGS_SHOW); |
137 | 186 | Y.get('#add-bug-tags').removeClass(TAGS_SHOW); | 185 | Y.one('#add-bug-tags').removeClass(TAGS_SHOW); |
138 | 187 | Y.get('#add-bug-tags').addClass(TAGS_HIDE); | 186 | Y.one('#add-bug-tags').addClass(TAGS_HIDE); |
139 | 188 | edit(); | 187 | edit(); |
140 | 189 | }); | 188 | }); |
141 | 190 | 189 | ||
142 | 191 | 190 | ||
143 | === modified file 'lib/canonical/launchpad/javascript/bugs/bugtask-index.js' | |||
144 | --- lib/canonical/launchpad/javascript/bugs/bugtask-index.js 2009-11-14 21:14:40 +0000 | |||
145 | +++ lib/canonical/launchpad/javascript/bugs/bugtask-index.js 2009-11-18 13:45:26 +0000 | |||
146 | @@ -85,21 +85,21 @@ | |||
147 | 85 | Y.bugs.portlet.subscribe('bugs:nameloaded', function(subscription) { | 85 | Y.bugs.portlet.subscribe('bugs:nameloaded', function(subscription) { |
148 | 86 | var error_handler = new LP.client.ErrorHandler(); | 86 | var error_handler = new LP.client.ErrorHandler(); |
149 | 87 | error_handler.clearProgressUI = function() { | 87 | error_handler.clearProgressUI = function() { |
151 | 88 | var temp_link = Y.get('#temp-username'); | 88 | var temp_link = Y.one('#temp-username'); |
152 | 89 | if (temp_link) { | 89 | if (temp_link) { |
153 | 90 | var temp_parent = temp_link.get('parentNode'); | 90 | var temp_parent = temp_link.get('parentNode'); |
154 | 91 | temp_parent.removeChild(temp_link); | 91 | temp_parent.removeChild(temp_link); |
155 | 92 | } | 92 | } |
156 | 93 | }; | 93 | }; |
157 | 94 | error_handler.showError = function(error_msg) { | 94 | error_handler.showError = function(error_msg) { |
159 | 95 | Y.lp.display_error(Y.get('.menu-link-addsubscriber'), error_msg); | 95 | Y.lp.display_error(Y.one('.menu-link-addsubscriber'), error_msg); |
160 | 96 | }; | 96 | }; |
161 | 97 | 97 | ||
162 | 98 | var config = { | 98 | var config = { |
163 | 99 | on: { | 99 | on: { |
164 | 100 | success: function() { | 100 | success: function() { |
167 | 101 | var temp_link = Y.get('#temp-username'); | 101 | var temp_link = Y.one('#temp-username'); |
168 | 102 | var temp_spinner = Y.get('#temp-name-spinner'); | 102 | var temp_spinner = Y.one('#temp-name-spinner'); |
169 | 103 | temp_link.removeChild(temp_spinner); | 103 | temp_link.removeChild(temp_spinner); |
170 | 104 | var anim = Y.lazr.anim.green_flash({ node: temp_link }); | 104 | var anim = Y.lazr.anim.green_flash({ node: temp_link }); |
171 | 105 | anim.on('end', function() { | 105 | anim.on('end', function() { |
172 | @@ -136,17 +136,14 @@ | |||
173 | 136 | 136 | ||
174 | 137 | setup_client_and_bug(); | 137 | setup_client_and_bug(); |
175 | 138 | 138 | ||
185 | 139 | // First look for 'Mark as duplicate' links. | 139 | // Look for the 'Mark as duplicate' links or the |
186 | 140 | var update_dupe_links = Y.all('.menu-link-mark-dupe'); | 140 | // 'change duplicate bug' link. |
187 | 141 | 141 | var update_dupe_link = Y.one( | |
188 | 142 | // If there are none, check for any 'change duplicate bug' links. | 142 | '.menu-link-mark-dupe, #change_duplicate_bug'); |
189 | 143 | if (!update_dupe_links){ | 143 | |
190 | 144 | update_dupe_links = Y.all('#change_duplicate_bug'); | 144 | if (update_dupe_link) { |
182 | 145 | } | ||
183 | 146 | |||
184 | 147 | if (update_dupe_links) { | ||
191 | 148 | // First things first, pre-load the mark-dupe form. | 145 | // First things first, pre-load the mark-dupe form. |
193 | 149 | update_dupe_url = update_dupe_links.item(0).getAttribute('href'); | 146 | update_dupe_url = update_dupe_link.get('href'); |
194 | 150 | var mark_dupe_form_url = update_dupe_url + '/++form++'; | 147 | var mark_dupe_form_url = update_dupe_url + '/++form++'; |
195 | 151 | 148 | ||
196 | 152 | duplicate_form_overlay = new Y.lazr.FormOverlay({ | 149 | duplicate_form_overlay = new Y.lazr.FormOverlay({ |
197 | @@ -165,7 +162,7 @@ | |||
198 | 165 | 162 | ||
199 | 166 | // Add an on-click handler to any links found that displays | 163 | // Add an on-click handler to any links found that displays |
200 | 167 | // the form overlay. | 164 | // the form overlay. |
202 | 168 | update_dupe_links.on('click', function(e){ | 165 | update_dupe_link.on('click', function(e) { |
203 | 169 | // Only go ahead if we have received the form content by the | 166 | // Only go ahead if we have received the form content by the |
204 | 170 | // time the user clicks: | 167 | // time the user clicks: |
205 | 171 | if (duplicate_form_overlay){ | 168 | if (duplicate_form_overlay){ |
206 | @@ -174,17 +171,17 @@ | |||
207 | 174 | } | 171 | } |
208 | 175 | }); | 172 | }); |
209 | 176 | // Add a class denoting them as js-action links. | 173 | // Add a class denoting them as js-action links. |
211 | 177 | update_dupe_links.addClass('js-action'); | 174 | update_dupe_link.addClass('js-action'); |
212 | 178 | } | 175 | } |
213 | 179 | 176 | ||
215 | 180 | privacy_link = Y.get('#privacy-link'); | 177 | privacy_link = Y.one('#privacy-link'); |
216 | 181 | 178 | ||
217 | 182 | if (privacy_link) { | 179 | if (privacy_link) { |
218 | 183 | var privacy_link_url = privacy_link.getAttribute('href') + '/++form++'; | 180 | var privacy_link_url = privacy_link.getAttribute('href') + '/++form++'; |
220 | 184 | var privacy_div = Y.get('#privacy-text'); | 181 | var privacy_div = Y.one('#privacy-text'); |
221 | 185 | var privacy_html = privacy_link.get('innerHTML') + ' '; | 182 | var privacy_html = privacy_link.get('innerHTML') + ' '; |
222 | 186 | privacy_div.set('innerHTML', privacy_html); | 183 | privacy_div.set('innerHTML', privacy_html); |
224 | 187 | var privacy_text = Y.get('#privacy-text'); | 184 | var privacy_text = Y.one('#privacy-text'); |
225 | 188 | privacy_link = Y.Node.create( | 185 | privacy_link = Y.Node.create( |
226 | 189 | '<a id="privacy-link" class="sprite edit" title="[edit]">' + | 186 | '<a id="privacy-link" class="sprite edit" title="[edit]">' + |
227 | 190 | '<span class="invisible-link">edit</span></a>'); | 187 | '<span class="invisible-link">edit</span></a>'); |
228 | @@ -210,7 +207,7 @@ | |||
229 | 210 | e.preventDefault(); | 207 | e.preventDefault(); |
230 | 211 | privacy_form_overlay.show(); | 208 | privacy_form_overlay.show(); |
231 | 212 | // XXX Abel Deuring 2009-04-23, bug 365462 | 209 | // XXX Abel Deuring 2009-04-23, bug 365462 |
233 | 213 | // Y.get('#field.private') returns null. | 210 | // Y.one('#field.private') returns null. |
234 | 214 | // Seems that YUI does not like IDs containing a '.' | 211 | // Seems that YUI does not like IDs containing a '.' |
235 | 215 | document.getElementById('field.private').focus(); | 212 | document.getElementById('field.private').focus(); |
236 | 216 | } | 213 | } |
237 | @@ -230,7 +227,7 @@ | |||
238 | 230 | * @param e {Object} The event object. | 227 | * @param e {Object} The event object. |
239 | 231 | */ | 228 | */ |
240 | 232 | function clear_picker(e) { | 229 | function clear_picker(e) { |
242 | 233 | var input = Y.get('.yui-picker-search-box input'); | 230 | var input = Y.one('.yui-picker-search-box input'); |
243 | 234 | input.set('value', ''); | 231 | input.set('value', ''); |
244 | 235 | this.set('error', ''); | 232 | this.set('error', ''); |
245 | 236 | this.set('results', [{}]); | 233 | this.set('results', [{}]); |
246 | @@ -258,7 +255,7 @@ | |||
247 | 258 | picker.on('save', clear_picker, picker); | 255 | picker.on('save', clear_picker, picker); |
248 | 259 | picker.on('cancel', clear_picker, picker); | 256 | picker.on('cancel', clear_picker, picker); |
249 | 260 | 257 | ||
251 | 261 | var subscription_link_someone_else = Y.get('.menu-link-addsubscriber'); | 258 | var subscription_link_someone_else = Y.one('.menu-link-addsubscriber'); |
252 | 262 | subscription_link_someone_else.on('click', function(e) { | 259 | subscription_link_someone_else.on('click', function(e) { |
253 | 263 | e.halt(); | 260 | e.halt(); |
254 | 264 | picker.show(); | 261 | picker.show(); |
255 | @@ -278,8 +275,8 @@ | |||
256 | 278 | 275 | ||
257 | 279 | setup_client_and_bug(); | 276 | setup_client_and_bug(); |
258 | 280 | var subscription = new Y.lp.Subscription({ | 277 | var subscription = new Y.lp.Subscription({ |
261 | 281 | link: Y.get('.menu-link-subscription'), | 278 | link: Y.one('.menu-link-subscription'), |
262 | 282 | spinner: Y.get('#sub-unsub-spinner'), | 279 | spinner: Y.one('#sub-unsub-spinner'), |
263 | 283 | subscriber: new Y.lp.Subscriber({ | 280 | subscriber: new Y.lp.Subscriber({ |
264 | 284 | uri: LP.client.links.me, | 281 | uri: LP.client.links.me, |
265 | 285 | subscriber_ids: subscriber_ids | 282 | subscriber_ids: subscriber_ids |
266 | @@ -333,13 +330,11 @@ | |||
267 | 333 | subscriber_ids: subscriber_ids | 330 | subscriber_ids: subscriber_ids |
268 | 334 | }) | 331 | }) |
269 | 335 | }); | 332 | }); |
277 | 336 | var unsubscribe_icons = Y.all('.unsub-icon'); | 333 | |
278 | 337 | if (unsubscribe_icons) { | 334 | Y.on('click', function(e) { |
279 | 338 | unsubscribe_icons.on('click', function(e) { | 335 | e.halt(); |
280 | 339 | e.halt(); | 336 | unsubscribe_user_via_icon(e.target, subscription); |
281 | 340 | unsubscribe_user_via_icon(e.target, subscription); | 337 | }, '.unsub-icon'); |
275 | 341 | }); | ||
276 | 342 | } | ||
282 | 343 | } | 338 | } |
283 | 344 | 339 | ||
284 | 345 | /* | 340 | /* |
285 | @@ -371,13 +366,13 @@ | |||
286 | 371 | // subscribing can be done inline. Named operations | 366 | // subscribing can be done inline. Named operations |
287 | 372 | // don't return new objects, making the cached bug's | 367 | // don't return new objects, making the cached bug's |
288 | 373 | // etag invalid as well. | 368 | // etag invalid as well. |
290 | 374 | lp_bug_entry.removeAtt('http_etag'); | 369 | lp_bug_entry.removeAttr('http_etag'); |
291 | 375 | 370 | ||
292 | 376 | // Hide the formoverlay: | 371 | // Hide the formoverlay: |
293 | 377 | duplicate_form_overlay.hide(); | 372 | duplicate_form_overlay.hide(); |
294 | 378 | 373 | ||
295 | 379 | // Add the spinner... | 374 | // Add the spinner... |
297 | 380 | var dupe_span = Y.get('#mark-duplicate-text'); | 375 | var dupe_span = Y.one('#mark-duplicate-text'); |
298 | 381 | dupe_span.addClass('update-in-progress-message'); | 376 | dupe_span.addClass('update-in-progress-message'); |
299 | 382 | 377 | ||
300 | 383 | // Set the new duplicate link on the bug entry. | 378 | // Set the new duplicate link on the bug entry. |
301 | @@ -403,22 +398,22 @@ | |||
302 | 403 | 'Duplicate of <a>bug #</a> ', | 398 | 'Duplicate of <a>bug #</a> ', |
303 | 404 | '<a class="menu-link-mark-dupe js-action sprite edit">', | 399 | '<a class="menu-link-mark-dupe js-action sprite edit">', |
304 | 405 | '<span class="invisible-link">edit</span></a>'].join("")); | 400 | '<span class="invisible-link">edit</span></a>'].join("")); |
306 | 406 | dupe_span.queryAll('a').item(0) | 401 | dupe_span.all('a').item(0) |
307 | 407 | .set('href', '/bugs/' + new_dup_id) | 402 | .set('href', '/bugs/' + new_dup_id) |
308 | 408 | .appendChild(document.createTextNode(new_dup_id)); | 403 | .appendChild(document.createTextNode(new_dup_id)); |
310 | 409 | dupe_span.queryAll('a').item(1) | 404 | dupe_span.all('a').item(1) |
311 | 410 | .set('href', update_dupe_url); | 405 | .set('href', update_dupe_url); |
312 | 411 | show_comment_on_duplicate_warning(); | 406 | show_comment_on_duplicate_warning(); |
313 | 412 | } else { | 407 | } else { |
314 | 413 | dupe_span.set('innerHTML', [ | 408 | dupe_span.set('innerHTML', [ |
315 | 414 | '<a class="menu-link-mark-dupe js-action ', | 409 | '<a class="menu-link-mark-dupe js-action ', |
316 | 415 | 'sprite bug-dupe">Mark as duplicate</a>'].join("")); | 410 | 'sprite bug-dupe">Mark as duplicate</a>'].join("")); |
318 | 416 | dupe_span.query('a').set('href', update_dupe_url); | 411 | dupe_span.one('a').set('href', update_dupe_url); |
319 | 417 | hide_comment_on_duplicate_warning(); | 412 | hide_comment_on_duplicate_warning(); |
320 | 418 | } | 413 | } |
321 | 419 | Y.lazr.anim.green_flash({node: dupe_span}).run(); | 414 | Y.lazr.anim.green_flash({node: dupe_span}).run(); |
322 | 420 | // ensure the new link is hooked up correctly: | 415 | // ensure the new link is hooked up correctly: |
324 | 421 | dupe_span.query('a.menu-link-mark-dupe').on( | 416 | dupe_span.one('a.menu-link-mark-dupe').on( |
325 | 422 | 'click', function(e){ | 417 | 'click', function(e){ |
326 | 423 | e.preventDefault(); | 418 | e.preventDefault(); |
327 | 424 | duplicate_form_overlay.show(); | 419 | duplicate_form_overlay.show(); |
328 | @@ -454,9 +449,9 @@ | |||
329 | 454 | * @method show_comment_on_duplicate_warning | 449 | * @method show_comment_on_duplicate_warning |
330 | 455 | */ | 450 | */ |
331 | 456 | var show_comment_on_duplicate_warning = function() { | 451 | var show_comment_on_duplicate_warning = function() { |
333 | 457 | var duplicate_warning = Y.get('#warning-comment-on-duplicate'); | 452 | var duplicate_warning = Y.one('#warning-comment-on-duplicate'); |
334 | 458 | if (duplicate_warning === null) { | 453 | if (duplicate_warning === null) { |
336 | 459 | var container = Y.get('#add-comment-form'); | 454 | var container = Y.one('#add-comment-form'); |
337 | 460 | var first_node = container.get('firstChild'); | 455 | var first_node = container.get('firstChild'); |
338 | 461 | duplicate_warning = Y.Node.create( | 456 | duplicate_warning = Y.Node.create( |
339 | 462 | ['<div class="warning message" id="warning-comment-on-duplicate">', | 457 | ['<div class="warning message" id="warning-comment-on-duplicate">', |
340 | @@ -474,7 +469,7 @@ | |||
341 | 474 | * @method hide_comment_on_duplicate_warning | 469 | * @method hide_comment_on_duplicate_warning |
342 | 475 | */ | 470 | */ |
343 | 476 | var hide_comment_on_duplicate_warning = function() { | 471 | var hide_comment_on_duplicate_warning = function() { |
345 | 477 | var duplicate_warning = Y.get('#warning-comment-on-duplicate'); | 472 | var duplicate_warning = Y.one('#warning-comment-on-duplicate'); |
346 | 478 | if (duplicate_warning !== null) { | 473 | if (duplicate_warning !== null) { |
347 | 479 | duplicate_warning.ancestor().removeChild(duplicate_warning); | 474 | duplicate_warning.ancestor().removeChild(duplicate_warning); |
348 | 480 | } | 475 | } |
349 | @@ -492,12 +487,12 @@ | |||
350 | 492 | // subscribing can be done inline. Named operations | 487 | // subscribing can be done inline. Named operations |
351 | 493 | // don't return new objects, making the cached bug's | 488 | // don't return new objects, making the cached bug's |
352 | 494 | // etag invalid as well. | 489 | // etag invalid as well. |
354 | 495 | lp_bug_entry.removeAtt('http_etag'); | 490 | lp_bug_entry.removeAttr('http_etag'); |
355 | 496 | 491 | ||
356 | 497 | privacy_form_overlay.hide(); | 492 | privacy_form_overlay.hide(); |
357 | 498 | 493 | ||
360 | 499 | var privacy_text = Y.get('#privacy-text'); | 494 | var privacy_text = Y.one('#privacy-text'); |
361 | 500 | var privacy_div = Y.get('#privacy'); | 495 | var privacy_div = Y.one('#privacy'); |
362 | 501 | privacy_link.setStyle('display', 'none'); | 496 | privacy_link.setStyle('display', 'none'); |
363 | 502 | privacy_spinner.setStyle('display', 'inline'); | 497 | privacy_spinner.setStyle('display', 'inline'); |
364 | 503 | 498 | ||
365 | @@ -550,7 +545,7 @@ | |||
366 | 550 | privacy_text.appendChild(privacy_link); | 545 | privacy_text.appendChild(privacy_link); |
367 | 551 | privacy_text.appendChild(privacy_spinner); | 546 | privacy_text.appendChild(privacy_spinner); |
368 | 552 | 547 | ||
370 | 553 | var security_message = Y.get('#security-message'); | 548 | var security_message = Y.one('#security-message'); |
371 | 554 | if (security_related) { | 549 | if (security_related) { |
372 | 555 | if (security_message === null) { | 550 | if (security_message === null) { |
373 | 556 | var security_message_html = [ | 551 | var security_message_html = [ |
374 | @@ -591,7 +586,7 @@ | |||
375 | 591 | link_branch_link.toggleClass('update-in-progress-message'); | 586 | link_branch_link.toggleClass('update-in-progress-message'); |
376 | 592 | }; | 587 | }; |
377 | 593 | error_handler.showError = function(error_msg) { | 588 | error_handler.showError = function(error_msg) { |
379 | 594 | display_error(Y.get('.menu-link-addsubscriber'), error_msg); | 589 | display_error(Y.one('.menu-link-addsubscriber'), error_msg); |
380 | 595 | }; | 590 | }; |
381 | 596 | 591 | ||
382 | 597 | function get_branch_and_link_to_bug(data) { | 592 | function get_branch_and_link_to_bug(data) { |
383 | @@ -609,7 +604,7 @@ | |||
384 | 609 | } | 604 | } |
385 | 610 | 605 | ||
386 | 611 | // Set up the picker itself. | 606 | // Set up the picker itself. |
388 | 612 | link_branch_link = Y.get('.menu-link-addbranch'); | 607 | link_branch_link = Y.one('.menu-link-addbranch'); |
389 | 613 | if (Y.Lang.isValue(link_branch_link)) { | 608 | if (Y.Lang.isValue(link_branch_link)) { |
390 | 614 | var config = { | 609 | var config = { |
391 | 615 | header: 'Link a related branch', | 610 | header: 'Link a related branch', |
392 | @@ -642,7 +637,7 @@ | |||
393 | 642 | link_branch_link.toggleClass('update-in-progress-message'); | 637 | link_branch_link.toggleClass('update-in-progress-message'); |
394 | 643 | }; | 638 | }; |
395 | 644 | error_handler.showError = function(error_msg) { | 639 | error_handler.showError = function(error_msg) { |
397 | 645 | display_error(Y.get('.menu-link-addsubscriber'), error_msg); | 640 | display_error(Y.one('.menu-link-addsubscriber'), error_msg); |
398 | 646 | }; | 641 | }; |
399 | 647 | 642 | ||
400 | 648 | // Call linkBranch() on the bug. | 643 | // Call linkBranch() on the bug. |
401 | @@ -683,21 +678,21 @@ | |||
402 | 683 | function add_branch_to_linked_branches(branch_html) { | 678 | function add_branch_to_linked_branches(branch_html) { |
403 | 684 | var anim; | 679 | var anim; |
404 | 685 | var bug_branch_node = Y.Node.create(branch_html); | 680 | var bug_branch_node = Y.Node.create(branch_html); |
406 | 686 | var bug_branch_list = Y.get('#bug-branches'); | 681 | var bug_branch_list = Y.one('#bug-branches'); |
407 | 687 | if (!Y.Lang.isValue(bug_branch_list)) { | 682 | if (!Y.Lang.isValue(bug_branch_list)) { |
408 | 688 | bug_branch_list = Y.Node.create( | 683 | bug_branch_list = Y.Node.create( |
409 | 689 | '<div id="bug-branches">' + | 684 | '<div id="bug-branches">' + |
410 | 690 | ' <h2>Related branches</h2>' + | 685 | ' <h2>Related branches</h2>' + |
411 | 691 | '</div>'); | 686 | '</div>'); |
412 | 692 | 687 | ||
414 | 693 | var bug_branch_container = Y.get('#bug-branches-container'); | 688 | var bug_branch_container = Y.one('#bug-branches-container'); |
415 | 694 | bug_branch_container.appendChild(bug_branch_list); | 689 | bug_branch_container.appendChild(bug_branch_list); |
416 | 695 | anim = Y.lazr.anim.green_flash({node: bug_branch_list}); | 690 | anim = Y.lazr.anim.green_flash({node: bug_branch_list}); |
417 | 696 | } else { | 691 | } else { |
418 | 697 | anim = Y.lazr.anim.green_flash({node: bug_branch_node}); | 692 | anim = Y.lazr.anim.green_flash({node: bug_branch_node}); |
419 | 698 | } | 693 | } |
420 | 699 | 694 | ||
422 | 700 | var existing_bug_branch_node = bug_branch_list.query( | 695 | var existing_bug_branch_node = bug_branch_list.one( |
423 | 701 | '#' + bug_branch_node.getAttribute('id')); | 696 | '#' + bug_branch_node.getAttribute('id')); |
424 | 702 | if (!Y.Lang.isValue(existing_bug_branch_node)) { | 697 | if (!Y.Lang.isValue(existing_bug_branch_node)) { |
425 | 703 | // Only add the bug branch to the page if it isn't there | 698 | // Only add the bug branch to the page if it isn't there |
426 | @@ -723,7 +718,7 @@ | |||
427 | 723 | // This should be parent_div.firstChild, but because of #text | 718 | // This should be parent_div.firstChild, but because of #text |
428 | 724 | // and cross-browser issues, using the YUI query syntax is | 719 | // and cross-browser issues, using the YUI query syntax is |
429 | 725 | // safer here. | 720 | // safer here. |
431 | 726 | var user_uri = parent_div.query('a').getAttribute('href'); | 721 | var user_uri = parent_div.one('a').getAttribute('href'); |
432 | 727 | 722 | ||
433 | 728 | // Strip the domain off. We just want a path. | 723 | // Strip the domain off. We just want a path. |
434 | 729 | var host_start = user_uri.indexOf('//'); | 724 | var host_start = user_uri.indexOf('//'); |
435 | @@ -769,7 +764,7 @@ | |||
436 | 769 | var html = Y.Node.create('<div><a></a></div>'); | 764 | var html = Y.Node.create('<div><a></a></div>'); |
437 | 770 | html.addClass(terms.css_name); | 765 | html.addClass(terms.css_name); |
438 | 771 | 766 | ||
440 | 772 | html.query('a') | 767 | html.one('a') |
441 | 773 | .set('href', '/~' + terms.name) | 768 | .set('href', '/~' + terms.name) |
442 | 774 | .set('name', terms.full_name) | 769 | .set('name', terms.full_name) |
443 | 775 | .set('title', 'Subscribed ' + terms.subscribed_by); | 770 | .set('title', 'Subscribed ' + terms.subscribed_by); |
444 | @@ -781,7 +776,7 @@ | |||
445 | 781 | span = '<span class="sprite person"></span>'; | 776 | span = '<span class="sprite person"></span>'; |
446 | 782 | } | 777 | } |
447 | 783 | 778 | ||
449 | 784 | html.query('a') | 779 | html.one('a') |
450 | 785 | .appendChild(Y.Node.create(span)) | 780 | .appendChild(Y.Node.create(span)) |
451 | 786 | .appendChild(document.createTextNode(terms.display_name)); | 781 | .appendChild(document.createTextNode(terms.display_name)); |
452 | 787 | 782 | ||
453 | @@ -793,7 +788,7 @@ | |||
454 | 793 | icon_html | 788 | icon_html |
455 | 794 | .set('id', 'unsubscribe-' + terms.css_name) | 789 | .set('id', 'unsubscribe-' + terms.css_name) |
456 | 795 | .set('title', 'Unsubscribe ' + terms.full_name); | 790 | .set('title', 'Unsubscribe ' + terms.full_name); |
458 | 796 | icon_html.query('img') | 791 | icon_html.one('img') |
459 | 797 | .set('id', 'unsubscribe-icon-' + terms.css_name); | 792 | .set('id', 'unsubscribe-icon-' + terms.css_name); |
460 | 798 | html.appendChild(icon_html); | 793 | html.appendChild(icon_html); |
461 | 799 | } | 794 | } |
462 | @@ -834,15 +829,14 @@ | |||
463 | 834 | 829 | ||
464 | 835 | // Use the list of subscribers pulled from the DOM to have sortable | 830 | // Use the list of subscribers pulled from the DOM to have sortable |
465 | 836 | // lists of unsubscribable vs. not unsubscribale person links. | 831 | // lists of unsubscribable vs. not unsubscribale person links. |
469 | 837 | var subscribers = Y.get('#subscribers-links'); | 832 | var all_subscribers = Y.all('#subscribers-links div'); |
470 | 838 | var all_subscribers = subscribers.queryAll('div'); | 833 | if (all_subscribers.size() > 0) { |
468 | 839 | if (Y.Lang.isValue(all_subscribers)) { | ||
471 | 840 | all_subscribers.each(function(sub_link) { | 834 | all_subscribers.each(function(sub_link) { |
472 | 841 | if (sub_link.getAttribute('id') != 'temp-username') { | 835 | if (sub_link.getAttribute('id') != 'temp-username') { |
473 | 842 | // User's displayname is found via the link's "name" attribute. | 836 | // User's displayname is found via the link's "name" attribute. |
475 | 843 | var sub_link_name = sub_link.query('a').getAttribute('name'); | 837 | var sub_link_name = sub_link.one('a').getAttribute('name'); |
476 | 844 | nodes_by_name[sub_link_name] = sub_link; | 838 | nodes_by_name[sub_link_name] = sub_link; |
478 | 845 | if (sub_link.query('img.unsub-icon')) { | 839 | if (sub_link.one('img.unsub-icon')) { |
479 | 846 | unsubscribables.push(sub_link_name); | 840 | unsubscribables.push(sub_link_name); |
480 | 847 | } else { | 841 | } else { |
481 | 848 | not_unsubscribables.push(sub_link_name); | 842 | not_unsubscribables.push(sub_link_name); |
482 | @@ -915,7 +909,7 @@ | |||
483 | 915 | function add_user_name_link(subscription) { | 909 | function add_user_name_link(subscription) { |
484 | 916 | var person = subscription.get('person'); | 910 | var person = subscription.get('person'); |
485 | 917 | var link_node = build_user_link_html(subscription); | 911 | var link_node = build_user_link_html(subscription); |
487 | 918 | var subscribers = Y.get('#subscribers-links'); | 912 | var subscribers = Y.one('#subscribers-links'); |
488 | 919 | if (subscription.is_current_user_subscribing()) { | 913 | if (subscription.is_current_user_subscribing()) { |
489 | 920 | // If this is the current user, then top post the name and be done. | 914 | // If this is the current user, then top post the name and be done. |
490 | 921 | subscribers.insertBefore(link_node, subscribers.get('firstChild')); | 915 | subscribers.insertBefore(link_node, subscribers.get('firstChild')); |
491 | @@ -925,7 +919,7 @@ | |||
492 | 925 | subscribers.insertBefore(link_node, next); | 919 | subscribers.insertBefore(link_node, next); |
493 | 926 | } else { | 920 | } else { |
494 | 927 | // Handle the case of the displayed "None". | 921 | // Handle the case of the displayed "None". |
496 | 928 | var none_subscribers = Y.get('#none-subscribers'); | 922 | var none_subscribers = Y.one('#none-subscribers'); |
497 | 929 | if (none_subscribers) { | 923 | if (none_subscribers) { |
498 | 930 | var none_parent = none_subscribers.get('parentNode'); | 924 | var none_parent = none_subscribers.get('parentNode'); |
499 | 931 | none_parent.removeChild(none_subscribers); | 925 | none_parent.removeChild(none_subscribers); |
500 | @@ -936,7 +930,7 @@ | |||
501 | 936 | 930 | ||
502 | 937 | // Set the click handler if adding a remove icon. | 931 | // Set the click handler if adding a remove icon. |
503 | 938 | if (subscription.can_be_unsubscribed_by_user()) { | 932 | if (subscription.can_be_unsubscribed_by_user()) { |
505 | 939 | var remove_icon = Y.get('#unsubscribe-icon-' + person.get('css_name')); | 933 | var remove_icon = Y.one('#unsubscribe-icon-' + person.get('css_name')); |
506 | 940 | remove_icon.on('click', function(e) { | 934 | remove_icon.on('click', function(e) { |
507 | 941 | e.halt(); | 935 | e.halt(); |
508 | 942 | unsubscribe_user_via_icon(e.target, subscription); | 936 | unsubscribe_user_via_icon(e.target, subscription); |
509 | @@ -974,18 +968,18 @@ | |||
510 | 974 | ' <span>Other Display Name</span>', | 968 | ' <span>Other Display Name</span>', |
511 | 975 | ' <img id="temp-name-spinner" src="/@@/spinner" alt="" ', | 969 | ' <img id="temp-name-spinner" src="/@@/spinner" alt="" ', |
512 | 976 | ' style="position:absolute;right:8px" /></div>'].join('')); | 970 | ' style="position:absolute;right:8px" /></div>'].join('')); |
514 | 977 | link_node.query('img').set('src', img_src); | 971 | link_node.one('img').set('src', img_src); |
515 | 978 | link_node.replaceChild( | 972 | link_node.replaceChild( |
516 | 979 | document.createTextNode(display_name), | 973 | document.createTextNode(display_name), |
518 | 980 | link_node.query('span')); | 974 | link_node.one('span')); |
519 | 981 | 975 | ||
521 | 982 | var subscribers = Y.get('#subscribers-links'); | 976 | var subscribers = Y.one('#subscribers-links'); |
522 | 983 | var next = get_next_subscriber_node(subscription); | 977 | var next = get_next_subscriber_node(subscription); |
523 | 984 | if (next) { | 978 | if (next) { |
524 | 985 | subscribers.insertBefore(link_node, next); | 979 | subscribers.insertBefore(link_node, next); |
525 | 986 | } else { | 980 | } else { |
526 | 987 | // Handle the case of the displayed "None". | 981 | // Handle the case of the displayed "None". |
528 | 988 | var none_subscribers = Y.get('#none-subscribers'); | 982 | var none_subscribers = Y.one('#none-subscribers'); |
529 | 989 | if (none_subscribers) { | 983 | if (none_subscribers) { |
530 | 990 | var none_parent = none_subscribers.get('parentNode'); | 984 | var none_parent = none_subscribers.get('parentNode'); |
531 | 991 | none_parent.removeChild(none_subscribers); | 985 | none_parent.removeChild(none_subscribers); |
532 | @@ -1005,19 +999,19 @@ | |||
533 | 1005 | * @method set_none_for_empty_subscribers | 999 | * @method set_none_for_empty_subscribers |
534 | 1006 | */ | 1000 | */ |
535 | 1007 | function set_none_for_empty_subscribers() { | 1001 | function set_none_for_empty_subscribers() { |
537 | 1008 | var subscriber_list = Y.get('#subscribers-links'); | 1002 | var subscriber_list = Y.one('#subscribers-links'); |
538 | 1009 | // Assume if subscriber_list has no child divs | 1003 | // Assume if subscriber_list has no child divs |
539 | 1010 | // then the list of subscribers is empty. | 1004 | // then the list of subscribers is empty. |
542 | 1011 | if (!Y.Lang.isValue(subscriber_list.query('div')) && | 1005 | if (!Y.Lang.isValue(subscriber_list.one('div')) && |
543 | 1012 | !Y.Lang.isValue(Y.get('#none-subscribers'))) { | 1006 | !Y.Lang.isValue(Y.one('#none-subscribers'))) { |
544 | 1013 | var none_div = Y.Node.create('<div id="none-subscribers">None</div>'); | 1007 | var none_div = Y.Node.create('<div id="none-subscribers">None</div>'); |
545 | 1014 | subscriber_list.appendChild(none_div); | 1008 | subscriber_list.appendChild(none_div); |
546 | 1015 | } | 1009 | } |
547 | 1016 | 1010 | ||
548 | 1017 | // Clear the empty duplicate subscribers list if it exists. | 1011 | // Clear the empty duplicate subscribers list if it exists. |
550 | 1018 | var dup_list = Y.get('#subscribers-from-duplicates'); | 1012 | var dup_list = Y.one('#subscribers-from-duplicates'); |
551 | 1019 | if (Y.Lang.isValue(dup_list) && | 1013 | if (Y.Lang.isValue(dup_list) && |
553 | 1020 | !Y.Lang.isValue(dup_list.query('div'))) { | 1014 | !Y.Lang.isValue(dup_list.one('div'))) { |
554 | 1021 | var parent = dup_list.get('parentNode'); | 1015 | var parent = dup_list.get('parentNode'); |
555 | 1022 | parent.removeChild(dup_list); | 1016 | parent.removeChild(dup_list); |
556 | 1023 | } | 1017 | } |
557 | @@ -1088,7 +1082,7 @@ | |||
558 | 1088 | error_handler.clearProgressUI = function () { | 1082 | error_handler.clearProgressUI = function () { |
559 | 1089 | icon.set('src', '/@@/remove'); | 1083 | icon.set('src', '/@@/remove'); |
560 | 1090 | // Grab the icon again to reset to click handler. | 1084 | // Grab the icon again to reset to click handler. |
562 | 1091 | var unsubscribe_icon = Y.get( | 1085 | var unsubscribe_icon = Y.one( |
563 | 1092 | '#unsubscribe-icon-' + person.get('css_name')); | 1086 | '#unsubscribe-icon-' + person.get('css_name')); |
564 | 1093 | unsubscribe_icon.on('click', function(e) { | 1087 | unsubscribe_icon.on('click', function(e) { |
565 | 1094 | e.halt(); | 1088 | e.halt(); |
566 | @@ -1097,7 +1091,7 @@ | |||
567 | 1097 | 1091 | ||
568 | 1098 | }; | 1092 | }; |
569 | 1099 | error_handler.showError = function (error_msg) { | 1093 | error_handler.showError = function (error_msg) { |
571 | 1100 | var flash_node = Y.get('.' + person.get('css_name')); | 1094 | var flash_node = Y.one('.' + person.get('css_name')); |
572 | 1101 | Y.lp.display_error(flash_node, error_msg); | 1095 | Y.lp.display_error(flash_node, error_msg); |
573 | 1102 | 1096 | ||
574 | 1103 | }; | 1097 | }; |
575 | @@ -1111,7 +1105,7 @@ | |||
576 | 1111 | anim.on('end', function(e) { | 1105 | anim.on('end', function(e) { |
577 | 1112 | remove_user_name_link(icon_parent_div); | 1106 | remove_user_name_link(icon_parent_div); |
578 | 1113 | set_none_for_empty_subscribers(); | 1107 | set_none_for_empty_subscribers(); |
580 | 1114 | var person_link = Y.get('.' + person.get('css_name')); | 1108 | var person_link = Y.one('.' + person.get('css_name')); |
581 | 1115 | if (Y.Lang.isNull(person_link) && | 1109 | if (Y.Lang.isNull(person_link) && |
582 | 1116 | subscription.is_current_user_subscribing()) { | 1110 | subscription.is_current_user_subscribing()) { |
583 | 1117 | // Current user has been completely unsubscribed. | 1111 | // Current user has been completely unsubscribed. |
584 | @@ -1190,7 +1184,7 @@ | |||
585 | 1190 | } | 1184 | } |
586 | 1191 | 1185 | ||
587 | 1192 | // Handle the case where the subscriber's list displays "None". | 1186 | // Handle the case where the subscriber's list displays "None". |
589 | 1193 | var empty_subscribers = Y.get("#none-subscribers"); | 1187 | var empty_subscribers = Y.one("#none-subscribers"); |
590 | 1194 | if (empty_subscribers) { | 1188 | if (empty_subscribers) { |
591 | 1195 | var parent = empty_subscribers.get('parentNode'); | 1189 | var parent = empty_subscribers.get('parentNode'); |
592 | 1196 | parent.removeChild(empty_subscribers); | 1190 | parent.removeChild(empty_subscribers); |
593 | @@ -1198,7 +1192,7 @@ | |||
594 | 1198 | 1192 | ||
595 | 1199 | add_user_name_link(subscription); | 1193 | add_user_name_link(subscription); |
596 | 1200 | 1194 | ||
598 | 1201 | var flash_node = Y.get('.' + subscriber.get('css_name')); | 1195 | var flash_node = Y.one('.' + subscriber.get('css_name')); |
599 | 1202 | var anim = Y.lazr.anim.green_flash({ node: flash_node }); | 1196 | var anim = Y.lazr.anim.green_flash({ node: flash_node }); |
600 | 1203 | anim.run(); | 1197 | anim.run(); |
601 | 1204 | }, | 1198 | }, |
602 | @@ -1258,7 +1252,7 @@ | |||
603 | 1258 | subscription.set('has_dupes', false); | 1252 | subscription.set('has_dupes', false); |
604 | 1259 | } | 1253 | } |
605 | 1260 | 1254 | ||
607 | 1261 | var flash_node = Y.get('.' + subscriber.get('css_name')); | 1255 | var flash_node = Y.one('.' + subscriber.get('css_name')); |
608 | 1262 | var anim = Y.lazr.anim.green_flash({ node: flash_node }); | 1256 | var anim = Y.lazr.anim.green_flash({ node: flash_node }); |
609 | 1263 | anim.on('end', function(e) { | 1257 | anim.on('end', function(e) { |
610 | 1264 | remove_user_name_link(flash_node); | 1258 | remove_user_name_link(flash_node); |
611 | @@ -1291,12 +1285,18 @@ | |||
612 | 1291 | return; | 1285 | return; |
613 | 1292 | } | 1286 | } |
614 | 1293 | 1287 | ||
621 | 1294 | var tr = Y.get('#' + conf.row_id); | 1288 | var tr = Y.one('#' + conf.row_id); |
622 | 1295 | var bugtarget_content = Y.get('#bugtarget-picker-' + conf.row_id); | 1289 | var bugtarget_content = Y.one('#bugtarget-picker-' + conf.row_id); |
623 | 1296 | var status_content = tr.query('.status-content'); | 1290 | var status_content = tr.one('.status-content'); |
624 | 1297 | var importance_content = tr.query('.importance-content'); | 1291 | var importance_content = tr.one('.importance-content'); |
625 | 1298 | var assignee_content = Y.get('#assignee-picker-' + conf.row_id); | 1292 | var assignee_content = Y.one('#assignee-picker-' + conf.row_id); |
626 | 1299 | var milestone_content = tr.query('.milestone-content'); | 1293 | var milestone_content = tr.one('.milestone-content'); |
627 | 1294 | |||
628 | 1295 | if (status_content === null) { | ||
629 | 1296 | // Not all table rows have status widgets. If this is one of those | ||
630 | 1297 | // rows, then bail. | ||
631 | 1298 | return; | ||
632 | 1299 | } | ||
633 | 1300 | 1300 | ||
634 | 1301 | if (Y.Lang.isValue(LP.client.cache.bug) && | 1301 | if (Y.Lang.isValue(LP.client.cache.bug) && |
635 | 1302 | Y.Lang.isValue(LP.client.cache.bug.duplicate_of_link)) { | 1302 | Y.Lang.isValue(LP.client.cache.bug.duplicate_of_link)) { |
636 | @@ -1316,7 +1316,7 @@ | |||
637 | 1316 | Y.DOM.create( | 1316 | Y.DOM.create( |
638 | 1317 | '<a href="+editstatus" ' + | 1317 | '<a href="+editstatus" ' + |
639 | 1318 | ' class="sprite edit yui-activator-act" />'), | 1318 | ' class="sprite edit yui-activator-act" />'), |
641 | 1319 | bugtarget_content.query('.yui-activator-act')); | 1319 | bugtarget_content.one('.yui-activator-act')); |
642 | 1320 | } else { | 1320 | } else { |
643 | 1321 | var bugtarget_picker = Y.lp.picker.addPickerPatcher( | 1321 | var bugtarget_picker = Y.lp.picker.addPickerPatcher( |
644 | 1322 | 'Product', | 1322 | 'Product', |
645 | @@ -1354,7 +1354,7 @@ | |||
646 | 1354 | }); | 1354 | }); |
647 | 1355 | // Set the inline form control's value, so that submitting | 1355 | // Set the inline form control's value, so that submitting |
648 | 1356 | // it won't override the value we just set. | 1356 | // it won't override the value we just set. |
650 | 1357 | Y.get(document.getElementById(conf.prefix + '.status')).set( | 1357 | Y.one(document.getElementById(conf.prefix + '.status')).set( |
651 | 1358 | 'value', status_choice_edit.get('value')); | 1358 | 'value', status_choice_edit.get('value')); |
652 | 1359 | }); | 1359 | }); |
653 | 1360 | status_choice_edit.plug({ | 1360 | status_choice_edit.plug({ |
654 | @@ -1386,7 +1386,7 @@ | |||
655 | 1386 | }); | 1386 | }); |
656 | 1387 | // Set the inline form control's value, so that submitting | 1387 | // Set the inline form control's value, so that submitting |
657 | 1388 | // it won't override the value we just set. | 1388 | // it won't override the value we just set. |
659 | 1389 | Y.get(document.getElementById(conf.prefix + '.importance')).set( | 1389 | Y.one(document.getElementById(conf.prefix + '.importance')).set( |
660 | 1390 | 'value', importance_choice_edit.get('value')); | 1390 | 'value', importance_choice_edit.get('value')); |
661 | 1391 | }); | 1391 | }); |
662 | 1392 | importance_choice_edit.plug({ | 1392 | importance_choice_edit.plug({ |
663 | @@ -1422,18 +1422,18 @@ | |||
664 | 1422 | // to have a more established way of getting the web URL of | 1422 | // to have a more established way of getting the web URL of |
665 | 1423 | // an API object. Once such a solution is available we should | 1423 | // an API object. Once such a solution is available we should |
666 | 1424 | // fix this. | 1424 | // fix this. |
668 | 1425 | milestone_content.query('.value').setAttribute( | 1425 | milestone_content.one('.value').setAttribute( |
669 | 1426 | 'href', new_value.replace('/api/beta', '')); | 1426 | 'href', new_value.replace('/api/beta', '')); |
670 | 1427 | } | 1427 | } |
671 | 1428 | // Set the inline form control's value, so that submitting | 1428 | // Set the inline form control's value, so that submitting |
672 | 1429 | // it won't override the value we just set. | 1429 | // it won't override the value we just set. |
674 | 1430 | var inline_combo = Y.get( | 1430 | var inline_combo = Y.one( |
675 | 1431 | document.getElementById(conf.prefix + '.milestone')); | 1431 | document.getElementById(conf.prefix + '.milestone')); |
676 | 1432 | if (Y.Lang.isValue(inline_combo)) { | 1432 | if (Y.Lang.isValue(inline_combo)) { |
677 | 1433 | inline_combo.set('value', null); | 1433 | inline_combo.set('value', null); |
678 | 1434 | Y.Array.each(milestone_choice_edit.get('items'), function(item) { | 1434 | Y.Array.each(milestone_choice_edit.get('items'), function(item) { |
679 | 1435 | if (item.value == milestone_choice_edit.get('value')) { | 1435 | if (item.value == milestone_choice_edit.get('value')) { |
681 | 1436 | inline_combo.queryAll('option').each(function(opt) { | 1436 | inline_combo.all('option').each(function(opt) { |
682 | 1437 | if (opt.get('innerHTML') == item.name) { | 1437 | if (opt.get('innerHTML') == item.name) { |
683 | 1438 | opt.set('selected', true); | 1438 | opt.set('selected', true); |
684 | 1439 | } | 1439 | } |
685 | @@ -1444,11 +1444,11 @@ | |||
686 | 1444 | // Force redrawing the UI | 1444 | // Force redrawing the UI |
687 | 1445 | milestone_choice_edit._uiClearWaiting(); | 1445 | milestone_choice_edit._uiClearWaiting(); |
688 | 1446 | }); | 1446 | }); |
690 | 1447 | milestone_content.query('.nulltext').on( | 1447 | milestone_content.one('.nulltext').on( |
691 | 1448 | 'mousedown', | 1448 | 'mousedown', |
692 | 1449 | milestone_choice_edit._onMouseDown, | 1449 | milestone_choice_edit._onMouseDown, |
693 | 1450 | milestone_choice_edit); | 1450 | milestone_choice_edit); |
695 | 1451 | milestone_choice_edit.render(); | 1451 | milestone_choice_edit.render(); |
696 | 1452 | } | 1452 | } |
697 | 1453 | if (Y.Lang.isValue(assignee_content)) { | 1453 | if (Y.Lang.isValue(assignee_content)) { |
698 | 1454 | var assignee_picker = Y.lp.picker.addPickerPatcher( | 1454 | var assignee_picker = Y.lp.picker.addPickerPatcher( |
699 | @@ -1480,7 +1480,7 @@ | |||
700 | 1480 | if (Y.UA.ie) { | 1480 | if (Y.UA.ie) { |
701 | 1481 | return; | 1481 | return; |
702 | 1482 | } | 1482 | } |
704 | 1483 | var me_too_content = Y.get('#affectsmetoo'); | 1483 | var me_too_content = Y.one('#affectsmetoo'); |
705 | 1484 | var me_too_edit = new MeTooChoiceSource({ | 1484 | var me_too_edit = new MeTooChoiceSource({ |
706 | 1485 | contentBox: me_too_content, value: user_is_affected, | 1485 | contentBox: me_too_content, value: user_is_affected, |
707 | 1486 | elementToFlash: me_too_content, | 1486 | elementToFlash: me_too_content, |
708 | @@ -1541,7 +1541,7 @@ | |||
709 | 1541 | * affected by the current bug. Should be automatically calculated | 1541 | * affected by the current bug. Should be automatically calculated |
710 | 1542 | * by HTML_PARSER. | 1542 | * by HTML_PARSER. |
711 | 1543 | * | 1543 | * |
713 | 1544 | * Setter function returns Y.get(parameter) so that you can pass | 1544 | * Setter function returns Y.one(parameter) so that you can pass |
714 | 1545 | * either a Node (as expected) or a selector. | 1545 | * either a Node (as expected) or a selector. |
715 | 1546 | * | 1546 | * |
716 | 1547 | * @attribute value_location | 1547 | * @attribute value_location |
717 | @@ -1550,7 +1550,7 @@ | |||
718 | 1550 | flame_icon: { | 1550 | flame_icon: { |
719 | 1551 | value: null, | 1551 | value: null, |
720 | 1552 | set: function(v) { | 1552 | set: function(v) { |
722 | 1553 | return Y.get(v); | 1553 | return Y.one(v); |
723 | 1554 | } | 1554 | } |
724 | 1555 | } | 1555 | } |
725 | 1556 | }; | 1556 | }; |
726 | @@ -1589,8 +1589,8 @@ | |||
727 | 1589 | // Force the ChoiceSource to be rendered inline. | 1589 | // Force the ChoiceSource to be rendered inline. |
728 | 1590 | this.get('boundingBox').setStyle('display', 'inline'); | 1590 | this.get('boundingBox').setStyle('display', 'inline'); |
729 | 1591 | // Hide the static content and show the dynamic content. | 1591 | // Hide the static content and show the dynamic content. |
732 | 1592 | this.get('contentBox').query('.static').addClass('unseen'); | 1592 | this.get('contentBox').one('.static').addClass('unseen'); |
733 | 1593 | this.get('contentBox').query('.dynamic').removeClass('unseen'); | 1593 | this.get('contentBox').one('.dynamic').removeClass('unseen'); |
734 | 1594 | }, | 1594 | }, |
735 | 1595 | 1595 | ||
736 | 1596 | _saveData: function() { | 1596 | _saveData: function() { |
737 | @@ -1634,7 +1634,7 @@ | |||
738 | 1634 | function check_can_be_unsubscribed(subscription) { | 1634 | function check_can_be_unsubscribed(subscription) { |
739 | 1635 | var error_handler = new LP.client.ErrorHandler(); | 1635 | var error_handler = new LP.client.ErrorHandler(); |
740 | 1636 | error_handler.showError = function (error_msg) { | 1636 | error_handler.showError = function (error_msg) { |
742 | 1637 | Y.lp.display_error(Y.get('.menu-link-addsubscriber'), error_msg); | 1637 | Y.lp.display_error(Y.one('.menu-link-addsubscriber'), error_msg); |
743 | 1638 | }; | 1638 | }; |
744 | 1639 | 1639 | ||
745 | 1640 | var config = { | 1640 | var config = { |
746 | @@ -1703,7 +1703,7 @@ | |||
747 | 1703 | 1703 | ||
748 | 1704 | var error_handler = new LP.client.ErrorHandler(); | 1704 | var error_handler = new LP.client.ErrorHandler(); |
749 | 1705 | error_handler.showError = function(error_msg) { | 1705 | error_handler.showError = function(error_msg) { |
751 | 1706 | Y.lp.display_error(Y.get('.menu-link-addsubscriber'), error_msg); | 1706 | Y.lp.display_error(Y.one('.menu-link-addsubscriber'), error_msg); |
752 | 1707 | }; | 1707 | }; |
753 | 1708 | 1708 | ||
754 | 1709 | if (subscription.is_already_subscribed()) { | 1709 | if (subscription.is_already_subscribed()) { |
755 | @@ -1722,9 +1722,9 @@ | |||
756 | 1722 | * @method setup_add_attachment | 1722 | * @method setup_add_attachment |
757 | 1723 | */ | 1723 | */ |
758 | 1724 | function setup_add_attachment() { | 1724 | function setup_add_attachment() { |
760 | 1725 | var attachment_link = Y.get('.menu-link-addcomment'); | 1725 | var attachment_link = Y.one('.menu-link-addcomment'); |
761 | 1726 | attachment_link.on('click', function(e) { | 1726 | attachment_link.on('click', function(e) { |
763 | 1727 | var comment_input = Y.get('[id="field.comment"]'); | 1727 | var comment_input = Y.one('[id="field.comment"]'); |
764 | 1728 | if (comment_input.get('value') !== '') { | 1728 | if (comment_input.get('value') !== '') { |
765 | 1729 | var current_url = attachment_link.getAttribute('href'); | 1729 | var current_url = attachment_link.getAttribute('href'); |
766 | 1730 | var attachment_url = current_url + '?field.comment=' + | 1730 | var attachment_url = current_url + '?field.comment=' + |
767 | @@ -1779,10 +1779,10 @@ | |||
768 | 1779 | return null; | 1779 | return null; |
769 | 1780 | } | 1780 | } |
770 | 1781 | 1781 | ||
772 | 1782 | Y.get('#subscribers-portlet-spinner').setStyle('display', 'block'); | 1782 | Y.one('#subscribers-portlet-spinner').setStyle('display', 'block'); |
773 | 1783 | 1783 | ||
774 | 1784 | function hide_spinner() { | 1784 | function hide_spinner() { |
776 | 1785 | Y.get('#subscribers-portlet-spinner').setStyle('display', 'none'); | 1785 | Y.one('#subscribers-portlet-spinner').setStyle('display', 'none'); |
777 | 1786 | // Fire a custom event to notify that the initial click | 1786 | // Fire a custom event to notify that the initial click |
778 | 1787 | // handler on subscription_link set above should be | 1787 | // handler on subscription_link set above should be |
779 | 1788 | // cleared. | 1788 | // cleared. |
780 | @@ -1794,7 +1794,7 @@ | |||
781 | 1794 | 1794 | ||
782 | 1795 | function on_success(transactionid, response, args) { | 1795 | function on_success(transactionid, response, args) { |
783 | 1796 | hide_spinner(); | 1796 | hide_spinner(); |
785 | 1797 | var portlet = Y.get('#portlet-subscribers'); | 1797 | var portlet = Y.one('#portlet-subscribers'); |
786 | 1798 | portlet.set('innerHTML', | 1798 | portlet.set('innerHTML', |
787 | 1799 | portlet.get('innerHTML') + response.responseText); | 1799 | portlet.get('innerHTML') + response.responseText); |
788 | 1800 | 1800 | ||
789 | @@ -1805,7 +1805,7 @@ | |||
790 | 1805 | 1805 | ||
791 | 1806 | var config = {on: {success: on_success, | 1806 | var config = {on: {success: on_success, |
792 | 1807 | failure: hide_spinner}}; | 1807 | failure: hide_spinner}}; |
794 | 1808 | var url = Y.get( | 1808 | var url = Y.one( |
795 | 1809 | '#subscribers-content-link').getAttribute('href').replace('bugs.', ''); | 1809 | '#subscribers-content-link').getAttribute('href').replace('bugs.', ''); |
796 | 1810 | Y.io(url, config); | 1810 | Y.io(url, config); |
797 | 1811 | }; | 1811 | }; |
798 | 1812 | 1812 | ||
799 | === modified file 'lib/canonical/launchpad/javascript/bugs/filebug-dupefinder.js' | |||
800 | --- lib/canonical/launchpad/javascript/bugs/filebug-dupefinder.js 2009-07-22 16:42:10 +0000 | |||
801 | +++ lib/canonical/launchpad/javascript/bugs/filebug-dupefinder.js 2009-11-18 13:45:26 +0000 | |||
802 | @@ -46,7 +46,7 @@ | |||
803 | 46 | */ | 46 | */ |
804 | 47 | function get_details_div(expander) { | 47 | function get_details_div(expander) { |
805 | 48 | var details_div = expander.get( | 48 | var details_div = expander.get( |
807 | 49 | 'parentNode').get('parentNode').query('.duplicate-details'); | 49 | 'parentNode').get('parentNode').one('.duplicate-details'); |
808 | 50 | 50 | ||
809 | 51 | // Check that the details_div actually exists and raise an error if | 51 | // Check that the details_div actually exists and raise an error if |
810 | 52 | // we can't find it. | 52 | // we can't find it. |
811 | @@ -77,24 +77,24 @@ | |||
812 | 77 | */ | 77 | */ |
813 | 78 | function show_bug_reporting_form(e) { | 78 | function show_bug_reporting_form(e) { |
814 | 79 | // Collapse all the duplicate-details divs. | 79 | // Collapse all the duplicate-details divs. |
816 | 80 | Y.each(bug_already_reported_expanders, function(expander) { | 80 | bug_already_reported_expanders.each(function(expander) { |
817 | 81 | collapse_bug_details(expander); | 81 | collapse_bug_details(expander); |
818 | 82 | }); | 82 | }); |
819 | 83 | 83 | ||
820 | 84 | // Show the bug reporting form. | 84 | // Show the bug reporting form. |
821 | 85 | bug_reporting_form.setStyle(DISPLAY, BLOCK); | 85 | bug_reporting_form.setStyle(DISPLAY, BLOCK); |
823 | 86 | Y.get(Y.DOM.byId('field.actions.submit_bug')).focus(); | 86 | Y.one(Y.DOM.byId('field.actions.submit_bug')).focus(); |
824 | 87 | window.location.href = '#form-start'; | 87 | window.location.href = '#form-start'; |
825 | 88 | 88 | ||
826 | 89 | // Focus the relevant elements of the form based on | 89 | // Focus the relevant elements of the form based on |
827 | 90 | // whether the package drop-down is displayed. | 90 | // whether the package drop-down is displayed. |
829 | 91 | var bugtarget_package_btn = Y.get( | 91 | var bugtarget_package_btn = Y.one( |
830 | 92 | Y.DOM.byId('field.bugtarget.option.package')); | 92 | Y.DOM.byId('field.bugtarget.option.package')); |
831 | 93 | if (bugtarget_package_btn !== null && | 93 | if (bugtarget_package_btn !== null && |
832 | 94 | bugtarget_package_btn !== undefined) { | 94 | bugtarget_package_btn !== undefined) { |
834 | 95 | Y.get(Y.DOM.byId('field.bugtarget.package')).focus(); | 95 | Y.one(Y.DOM.byId('field.bugtarget.package')).focus(); |
835 | 96 | } else { | 96 | } else { |
837 | 97 | Y.get(Y.DOM.byId('field.comment')).focus(); | 97 | Y.one(Y.DOM.byId('field.comment')).focus(); |
838 | 98 | } | 98 | } |
839 | 99 | } | 99 | } |
840 | 100 | 100 | ||
841 | @@ -106,9 +106,9 @@ | |||
842 | 106 | */ | 106 | */ |
843 | 107 | function create_subscribe_overlay(form) { | 107 | function create_subscribe_overlay(form) { |
844 | 108 | // Grab the bug id and title from the "Yes, this is my bug" form. | 108 | // Grab the bug id and title from the "Yes, this is my bug" form. |
846 | 109 | var bug_id = form.query( | 109 | var bug_id = form.one( |
847 | 110 | 'input.bug-already-reported-as').get('value'); | 110 | 'input.bug-already-reported-as').get('value'); |
849 | 111 | var bug_title = Y.get('#bug-' + bug_id + '-title').get('innerHTML'); | 111 | var bug_title = Y.one('#bug-' + bug_id + '-title').get('innerHTML'); |
850 | 112 | 112 | ||
851 | 113 | if (bug_title.length > 35) { | 113 | if (bug_title.length > 35) { |
852 | 114 | // Truncate the bug title if it's more than 30 characters long. | 114 | // Truncate the bug title if it's more than 30 characters long. |
853 | @@ -161,25 +161,16 @@ | |||
854 | 161 | 161 | ||
855 | 162 | // Add an on-click handler to the radio buttons to ensure that their | 162 | // Add an on-click handler to the radio buttons to ensure that their |
856 | 163 | // labels' styles are set correctly when they're selected. | 163 | // labels' styles are set correctly when they're selected. |
859 | 164 | var radio_buttons = form.queryAll('input.subscribe-option'); | 164 | var radio_buttons = form.all('input.subscribe-option'); |
860 | 165 | if (radio_buttons !== null && radio_buttons !== undefined) { | 165 | radio_buttons.on('click', function(e) { |
861 | 166 | // Loop over the radio buttons and set their parent | ||
862 | 167 | // div's font-weight depending on whether they're | ||
863 | 168 | // checked or not. | ||
864 | 166 | Y.each(radio_buttons, function(radio_button) { | 169 | Y.each(radio_buttons, function(radio_button) { |
879 | 167 | radio_button.on('click', function(e) { | 170 | var weight = radio_button.get('checked') ? 'bold' : 'normal'; |
880 | 168 | // Loop over the radio buttons and set their parent | 171 | radio_button.get('parentNode').setStyle('fontWeight', weight); |
867 | 169 | // div's font-weight depending on whether they're | ||
868 | 170 | // checked or not. | ||
869 | 171 | Y.each(radio_buttons, function(radio_button) { | ||
870 | 172 | if (radio_button.get('checked')) { | ||
871 | 173 | radio_button.get( | ||
872 | 174 | 'parentNode').setStyle('fontWeight', 'bold'); | ||
873 | 175 | } else { | ||
874 | 176 | radio_button.get( | ||
875 | 177 | 'parentNode').setStyle('fontWeight', 'normal'); | ||
876 | 178 | } | ||
877 | 179 | }); | ||
878 | 180 | }); | ||
881 | 181 | }); | 172 | }); |
883 | 182 | } | 173 | }); |
884 | 183 | 174 | ||
885 | 184 | return subscribe_form_overlay; | 175 | return subscribe_form_overlay; |
886 | 185 | } | 176 | } |
887 | @@ -189,17 +180,16 @@ | |||
888 | 189 | Y.on('domready', function() { | 180 | Y.on('domready', function() { |
889 | 190 | bug_already_reported_expanders = Y.all( | 181 | bug_already_reported_expanders = Y.all( |
890 | 191 | 'img.bug-already-reported-expander'); | 182 | 'img.bug-already-reported-expander'); |
892 | 192 | bug_reporting_form = Y.get('#bug_reporting_form'); | 183 | bug_reporting_form = Y.one('#bug_reporting_form'); |
893 | 193 | 184 | ||
896 | 194 | if (bug_already_reported_expanders !== null && | 185 | if (bug_already_reported_expanders.size() !== 0) { |
895 | 195 | bug_already_reported_expanders !== undefined) { | ||
897 | 196 | 186 | ||
898 | 197 | // Set up the onclick handlers for the expanders. | 187 | // Set up the onclick handlers for the expanders. |
904 | 198 | Y.each(Y.all('.similar-bug'), function(row) { | 188 | Y.all('.similar-bug').each(function(row) { |
905 | 199 | var bug_details_div = row.query('div.duplicate-details'); | 189 | var bug_details_div = row.one('div.duplicate-details'); |
906 | 200 | var image = row.query('img.bug-already-reported-expander'); | 190 | var image = row.one('img.bug-already-reported-expander'); |
907 | 201 | var bug_title_link = row.query('.duplicate-bug-link'); | 191 | var bug_title_link = row.one('.duplicate-bug-link'); |
908 | 202 | var view_bug_link = row.query('.view-bug-link'); | 192 | var view_bug_link = row.one('.view-bug-link'); |
909 | 203 | 193 | ||
910 | 204 | // Grab the initial height of the element and create a | 194 | // Grab the initial height of the element and create a |
911 | 205 | // config for the slide_out animation. This allows us to | 195 | // config for the slide_out animation. This allows us to |
912 | @@ -276,13 +266,13 @@ | |||
913 | 276 | 266 | ||
914 | 277 | // Collapse all the details divs, since we don't want them | 267 | // Collapse all the details divs, since we don't want them |
915 | 278 | // expanded first up. | 268 | // expanded first up. |
917 | 279 | Y.each(Y.all('div.duplicate-details'), function(div) { | 269 | Y.all('div.duplicate-details').each(function(div) { |
918 | 280 | collapse_bug_details(div); | 270 | collapse_bug_details(div); |
919 | 281 | }); | 271 | }); |
920 | 282 | 272 | ||
921 | 283 | } | 273 | } |
922 | 284 | 274 | ||
924 | 285 | bug_not_reported_button = Y.get('#bug-not-already-reported'); | 275 | bug_not_reported_button = Y.one('#bug-not-already-reported'); |
925 | 286 | if (bug_not_reported_button !== null && | 276 | if (bug_not_reported_button !== null && |
926 | 287 | bug_not_reported_button !== undefined) { | 277 | bug_not_reported_button !== undefined) { |
927 | 288 | // The bug_not_reported_button won't show up if there aren't any | 278 | // The bug_not_reported_button won't show up if there aren't any |
928 | @@ -291,8 +281,7 @@ | |||
929 | 291 | } | 281 | } |
930 | 292 | 282 | ||
931 | 293 | // Attach the form overlay to the "Yes, this is my bug" forms. | 283 | // Attach the form overlay to the "Yes, this is my bug" forms. |
934 | 294 | var this_is_my_bug_forms = Y.all('form.this-is-my-bug-form'); | 284 | Y.all('form.this-is-my-bug-form').each(function(form) { |
933 | 295 | Y.each(this_is_my_bug_forms, function(form) { | ||
935 | 296 | var subscribe_form_overlay = create_subscribe_overlay(form); | 285 | var subscribe_form_overlay = create_subscribe_overlay(form); |
936 | 297 | 286 | ||
937 | 298 | form.on('submit', function(e) { | 287 | form.on('submit', function(e) { |
938 | 299 | 288 | ||
939 | === modified file 'lib/canonical/launchpad/javascript/bugs/offical_bug_tags.js' | |||
940 | --- lib/canonical/launchpad/javascript/bugs/offical_bug_tags.js 2009-06-30 21:06:27 +0000 | |||
941 | +++ lib/canonical/launchpad/javascript/bugs/offical_bug_tags.js 2009-11-18 13:45:26 +0000 | |||
942 | @@ -129,8 +129,8 @@ | |||
943 | 129 | other_cbs_checked = other_cbs_checked || cb.get('checked'); | 129 | other_cbs_checked = other_cbs_checked || cb.get('checked'); |
944 | 130 | }); | 130 | }); |
945 | 131 | } | 131 | } |
948 | 132 | Y.get('#remove-official-tags').set('disabled', !official_cbs_checked); | 132 | Y.one('#remove-official-tags').set('disabled', !official_cbs_checked); |
949 | 133 | Y.get('#add-official-tags').set('disabled', !other_cbs_checked); | 133 | Y.one('#add-official-tags').set('disabled', !other_cbs_checked); |
950 | 134 | }; | 134 | }; |
951 | 135 | 135 | ||
952 | 136 | /** | 136 | /** |
953 | @@ -158,9 +158,9 @@ | |||
954 | 158 | item); | 158 | item); |
955 | 159 | var li_node = Y.Node.create(li_html); | 159 | var li_node = Y.Node.create(li_html); |
956 | 160 | li_node._tag = item; | 160 | li_node._tag = item; |
958 | 161 | li_node.query('input').on('click', function(e) { | 161 | li_node.one('input').on('click', function(e) { |
959 | 162 | enable_arrows(); | 162 | enable_arrows(); |
961 | 163 | var cb_node = li_node.query('input'); | 163 | var cb_node = li_node.one('input'); |
962 | 164 | if (cb_node.get('checked')) { | 164 | if (cb_node.get('checked')) { |
963 | 165 | li_node.addClass('selected'); | 165 | li_node.addClass('selected'); |
964 | 166 | } else { | 166 | } else { |
965 | @@ -179,8 +179,8 @@ | |||
966 | 179 | * @method render_tag_lists | 179 | * @method render_tag_lists |
967 | 180 | */ | 180 | */ |
968 | 181 | var render_tag_lists = function() { | 181 | var render_tag_lists = function() { |
971 | 182 | var official_tags_ul = Y.get('#official-tags-list'); | 182 | var official_tags_ul = Y.one('#official-tags-list'); |
972 | 183 | var other_tags_ul = Y.get('#other-tags-list'); | 183 | var other_tags_ul = Y.one('#other-tags-list'); |
973 | 184 | 184 | ||
974 | 185 | official_tags_ul.set('innerHTML', ''); | 185 | official_tags_ul.set('innerHTML', ''); |
975 | 186 | other_tags_ul.set('innerHTML', ''); | 186 | other_tags_ul.set('innerHTML', ''); |
976 | @@ -207,8 +207,8 @@ | |||
977 | 207 | Y.each(official_tags, function(item) { | 207 | Y.each(official_tags, function(item) { |
978 | 208 | tags.push(item.tag); | 208 | tags.push(item.tag); |
979 | 209 | }); | 209 | }); |
982 | 210 | Y.get('#field-official_bug_tags').set('value', tags.join(' ')); | 210 | Y.one('#field-official_bug_tags').set('value', tags.join(' ')); |
983 | 211 | Y.get('#save-form').submit(); | 211 | Y.one('#save-form').submit(); |
984 | 212 | }; | 212 | }; |
985 | 213 | 213 | ||
986 | 214 | /** | 214 | /** |
987 | @@ -219,8 +219,8 @@ | |||
988 | 219 | */ | 219 | */ |
989 | 220 | var get_selected_tags = function(tags_ul) { | 220 | var get_selected_tags = function(tags_ul) { |
990 | 221 | var selected_tags = []; | 221 | var selected_tags = []; |
993 | 222 | tags_ul.queryAll('li').each(function(li) { | 222 | tags_ul.all('li').each(function(li) { |
994 | 223 | if (li.query('input').get('checked')) { | 223 | if (li.one('input').get('checked')) { |
995 | 224 | selected_tags.push(li._tag); | 224 | selected_tags.push(li._tag); |
996 | 225 | } | 225 | } |
997 | 226 | }); | 226 | }); |
998 | @@ -276,7 +276,7 @@ | |||
999 | 276 | * @method on_new_tag_add | 276 | * @method on_new_tag_add |
1000 | 277 | */ | 277 | */ |
1001 | 278 | var on_new_tag_add = function() { | 278 | var on_new_tag_add = function() { |
1003 | 279 | var new_tag = Y.Lang.trim(Y.get('#new-tag-text').get('value')); | 279 | var new_tag = Y.Lang.trim(Y.one('#new-tag-text').get('value')); |
1004 | 280 | var new_tag_already_official = false; | 280 | var new_tag_already_official = false; |
1005 | 281 | Y.each(official_tags, function(item) { | 281 | Y.each(official_tags, function(item) { |
1006 | 282 | new_tag_already_official = ( | 282 | new_tag_already_official = ( |
1007 | @@ -305,9 +305,9 @@ | |||
1008 | 305 | } | 305 | } |
1009 | 306 | official_tags.push({tag: new_tag, count: 0}); | 306 | official_tags.push({tag: new_tag, count: 0}); |
1010 | 307 | sort_tags(official_tags); | 307 | sort_tags(official_tags); |
1014 | 308 | Y.get('#new-tag-text').set('value', ''); | 308 | Y.one('#new-tag-text').set('value', ''); |
1015 | 309 | Y.get('#new-tag-add').set('disabled', true); | 309 | Y.one('#new-tag-add').set('disabled', true); |
1016 | 310 | Y.get('#save-button').set('disabled', false); | 310 | Y.one('#save-button').set('disabled', false); |
1017 | 311 | } else { | 311 | } else { |
1018 | 312 | display_error(); | 312 | display_error(); |
1019 | 313 | } | 313 | } |
1020 | @@ -330,7 +330,7 @@ | |||
1021 | 330 | * @method display_error | 330 | * @method display_error |
1022 | 331 | */ | 331 | */ |
1023 | 332 | var display_error = function() { | 332 | var display_error = function() { |
1025 | 333 | var new_tag = Y.get('#new-tag-text').get( | 333 | var new_tag = Y.one('#new-tag-text').get( |
1026 | 334 | 'value').replace(new RegExp('<', 'g'), '<'); | 334 | 'value').replace(new RegExp('<', 'g'), '<'); |
1027 | 335 | var overlay = new Y.lazr.PrettyOverlay({ | 335 | var overlay = new Y.lazr.PrettyOverlay({ |
1028 | 336 | headerContent: '<span class="official-tag-error-message-header">' + | 336 | headerContent: '<span class="official-tag-error-message-header">' + |
1029 | @@ -356,56 +356,56 @@ | |||
1030 | 356 | official_tags = get_official_bug_tags(official_bug_tags); | 356 | official_tags = get_official_bug_tags(official_bug_tags); |
1031 | 357 | other_tags = get_other_bug_tags(used_bug_tags); | 357 | other_tags = get_other_bug_tags(used_bug_tags); |
1032 | 358 | 358 | ||
1034 | 359 | var layout_table = Y.get('#layout-table'); | 359 | var layout_table = Y.one('#layout-table'); |
1035 | 360 | 360 | ||
1036 | 361 | // The entire dynamic UI is hidden initially, so that clients | 361 | // The entire dynamic UI is hidden initially, so that clients |
1037 | 362 | // with no JS don't display it. | 362 | // with no JS don't display it. |
1038 | 363 | layout_table.setStyle('display', 'block'); | 363 | layout_table.setStyle('display', 'block'); |
1039 | 364 | 364 | ||
1042 | 365 | var official_tags_ul = Y.get('#official-tags-list'); | 365 | var official_tags_ul = Y.one('#official-tags-list'); |
1043 | 366 | var other_tags_ul = Y.get('#other-tags-list'); | 366 | var other_tags_ul = Y.one('#other-tags-list'); |
1044 | 367 | 367 | ||
1045 | 368 | render_tag_lists(); | 368 | render_tag_lists(); |
1046 | 369 | 369 | ||
1047 | 370 | // Hook an event handler to the arrow button for moving | 370 | // Hook an event handler to the arrow button for moving |
1048 | 371 | // tags from the list of unofficial tags to the list of official tags. | 371 | // tags from the list of unofficial tags to the list of official tags. |
1050 | 372 | Y.get('#add-official-tags').on('click', function(e) { | 372 | Y.one('#add-official-tags').on('click', function(e) { |
1051 | 373 | var updated_tags = get_updated_tags( | 373 | var updated_tags = get_updated_tags( |
1052 | 374 | other_tags_ul, other_tags, official_tags); | 374 | other_tags_ul, other_tags, official_tags); |
1053 | 375 | other_tags = updated_tags.from_tags; | 375 | other_tags = updated_tags.from_tags; |
1054 | 376 | official_tags = updated_tags.to_tags; | 376 | official_tags = updated_tags.to_tags; |
1055 | 377 | render_tag_lists(); | 377 | render_tag_lists(); |
1056 | 378 | enable_arrows(); | 378 | enable_arrows(); |
1058 | 379 | Y.get('#save-button').set('disabled', false); | 379 | Y.one('#save-button').set('disabled', false); |
1059 | 380 | }); | 380 | }); |
1060 | 381 | 381 | ||
1061 | 382 | // Hook an event handler to the arrow button for moving | 382 | // Hook an event handler to the arrow button for moving |
1062 | 383 | // tags from the list of official tags to the list of unofficial tags. | 383 | // tags from the list of official tags to the list of unofficial tags. |
1064 | 384 | Y.get('#remove-official-tags').on('click', function(e) { | 384 | Y.one('#remove-official-tags').on('click', function(e) { |
1065 | 385 | var updated_tags = get_updated_tags( | 385 | var updated_tags = get_updated_tags( |
1066 | 386 | official_tags_ul, official_tags, other_tags); | 386 | official_tags_ul, official_tags, other_tags); |
1067 | 387 | official_tags = updated_tags.from_tags; | 387 | official_tags = updated_tags.from_tags; |
1068 | 388 | other_tags = updated_tags.to_tags; | 388 | other_tags = updated_tags.to_tags; |
1069 | 389 | render_tag_lists(); | 389 | render_tag_lists(); |
1070 | 390 | enable_arrows(); | 390 | enable_arrows(); |
1072 | 391 | Y.get('#save-button').set('disabled', false); | 391 | Y.one('#save-button').set('disabled', false); |
1073 | 392 | }); | 392 | }); |
1074 | 393 | 393 | ||
1076 | 394 | Y.get('#new-tag-add').on('click', function(e) { | 394 | Y.one('#new-tag-add').on('click', function(e) { |
1077 | 395 | on_new_tag_add(); | 395 | on_new_tag_add(); |
1078 | 396 | }); | 396 | }); |
1079 | 397 | 397 | ||
1080 | 398 | // Hook a keypress event handler to the new tag text box. If enter is | 398 | // Hook a keypress event handler to the new tag text box. If enter is |
1081 | 399 | // pressed, try adding a new tag. | 399 | // pressed, try adding a new tag. |
1085 | 400 | Y.get('#new-tag-text').on('keypress', function(e) { | 400 | Y.one('#new-tag-text').on('keypress', function(e) { |
1086 | 401 | var new_value = Y.Lang.trim(Y.get('#new-tag-text').get('value')); | 401 | var new_value = Y.Lang.trim(Y.one('#new-tag-text').get('value')); |
1087 | 402 | Y.get('#new-tag-add').set('disabled', new_value == ''); | 402 | Y.one('#new-tag-add').set('disabled', new_value == ''); |
1088 | 403 | if (e.keyCode == 13) { // Enter == 13 | 403 | if (e.keyCode == 13) { // Enter == 13 |
1089 | 404 | on_new_tag_add(); | 404 | on_new_tag_add(); |
1090 | 405 | } | 405 | } |
1091 | 406 | }); | 406 | }); |
1092 | 407 | 407 | ||
1094 | 408 | Y.get('#save-button').on('click', function(e) { | 408 | Y.one('#save-button').on('click', function(e) { |
1095 | 409 | e.halt(); | 409 | e.halt(); |
1096 | 410 | save_tags(); | 410 | save_tags(); |
1097 | 411 | }); | 411 | }); |
1098 | 412 | 412 | ||
1099 | === modified file 'lib/canonical/launchpad/javascript/bugs/subscriber.js' | |||
1100 | --- lib/canonical/launchpad/javascript/bugs/subscriber.js 2009-08-03 12:51:30 +0000 | |||
1101 | +++ lib/canonical/launchpad/javascript/bugs/subscriber.js 2009-11-18 13:45:26 +0000 | |||
1102 | @@ -75,17 +75,15 @@ | |||
1103 | 75 | */ | 75 | */ |
1104 | 76 | 'is_already_subscribed': function() { | 76 | 'is_already_subscribed': function() { |
1105 | 77 | var display_name = this.get('person').get('full_display_name'); | 77 | var display_name = this.get('person').get('full_display_name'); |
1106 | 78 | var subscribers = Y.get('#subscribers-links'); | ||
1107 | 79 | var all_subscribers = subscribers.queryAll('div'); | ||
1108 | 80 | var already_subscribed = false; | 78 | var already_subscribed = false; |
1117 | 81 | if (Y.Lang.isValue(all_subscribers)) { | 79 | |
1118 | 82 | all_subscribers.each(function(link) { | 80 | Y.all('#subscribers-links div').each(function(link) { |
1119 | 83 | var name = link.query('a').getAttribute('name'); | 81 | var name = link.one('a').getAttribute('name'); |
1120 | 84 | if (name == display_name) { | 82 | if (name == display_name) { |
1121 | 85 | already_subscribed = true; | 83 | already_subscribed = true; |
1122 | 86 | } | 84 | } |
1123 | 87 | }); | 85 | }); |
1124 | 88 | } | 86 | |
1125 | 89 | return already_subscribed; | 87 | return already_subscribed; |
1126 | 90 | }, | 88 | }, |
1127 | 91 | 89 | ||
1128 | @@ -310,12 +308,12 @@ | |||
1129 | 310 | if (Y.Lang.isValue(this.get('user_node'))) { | 308 | if (Y.Lang.isValue(this.get('user_node'))) { |
1130 | 311 | user_node = this.get('user_node'); | 309 | user_node = this.get('user_node'); |
1131 | 312 | } else { | 310 | } else { |
1133 | 313 | user_node = Y.get('.subscriber-' + this.get('name')); | 311 | user_node = Y.one('.subscriber-' + this.get('name')); |
1134 | 314 | } | 312 | } |
1135 | 315 | 313 | ||
1136 | 316 | if (Y.Lang.isValue(user_node)) { | 314 | if (Y.Lang.isValue(user_node)) { |
1137 | 317 | this.set('user_node', user_node); | 315 | this.set('user_node', user_node); |
1139 | 318 | var anchor = this.get('user_node').query('a'); | 316 | var anchor = this.get('user_node').one('a'); |
1140 | 319 | var display_name = anchor.get('name'); | 317 | var display_name = anchor.get('name'); |
1141 | 320 | return display_name; | 318 | return display_name; |
1142 | 321 | } else { | 319 | } else { |
1143 | 322 | 320 | ||
1144 | === modified file 'lib/canonical/launchpad/javascript/bugs/tests/test_me_too.js' | |||
1145 | --- lib/canonical/launchpad/javascript/bugs/tests/test_me_too.js 2009-08-04 16:19:27 +0000 | |||
1146 | +++ lib/canonical/launchpad/javascript/bugs/tests/test_me_too.js 2009-11-18 13:45:26 +0000 | |||
1147 | @@ -16,7 +16,7 @@ | |||
1148 | 16 | * CSS selectors and Node instances instead of raw nodes. | 16 | * CSS selectors and Node instances instead of raw nodes. |
1149 | 17 | */ | 17 | */ |
1150 | 18 | function simulate(widget, selector, evtype, options) { | 18 | function simulate(widget, selector, evtype, options) { |
1152 | 19 | var rawnode = Y.Node.getDOMNode(widget.query(selector)); | 19 | var rawnode = Y.Node.getDOMNode(widget.one(selector)); |
1153 | 20 | Y.Event.simulate(rawnode, evtype, options); | 20 | Y.Event.simulate(rawnode, evtype, options); |
1154 | 21 | } | 21 | } |
1155 | 22 | 22 | ||
1156 | @@ -68,8 +68,8 @@ | |||
1157 | 68 | ' <img src="https://bugs.edge.launchpad.net/@@/flame-icon" alt=""/>', | 68 | ' <img src="https://bugs.edge.launchpad.net/@@/flame-icon" alt=""/>', |
1158 | 69 | ' </span>', | 69 | ' </span>', |
1159 | 70 | '</span>'].join('')); | 70 | '</span>'].join('')); |
1162 | 71 | Y.get("body").appendChild(inpage); | 71 | Y.one("body").appendChild(inpage); |
1163 | 72 | var me_too_content = Y.get('#affectsmetoo'); | 72 | var me_too_content = Y.one('#affectsmetoo'); |
1164 | 73 | this.config = { | 73 | this.config = { |
1165 | 74 | contentBox: me_too_content, value: null, | 74 | contentBox: me_too_content, value: null, |
1166 | 75 | elementToFlash: me_too_content | 75 | elementToFlash: me_too_content |
1167 | @@ -82,7 +82,7 @@ | |||
1168 | 82 | if (this.choice_edit._choice_list) { | 82 | if (this.choice_edit._choice_list) { |
1169 | 83 | cleanup_widget(this.choice_edit._choice_list); | 83 | cleanup_widget(this.choice_edit._choice_list); |
1170 | 84 | } | 84 | } |
1172 | 85 | var status = Y.get("document").query("#affectsmetoo"); | 85 | var status = Y.one("document").one("#affectsmetoo"); |
1173 | 86 | if (status) { | 86 | if (status) { |
1174 | 87 | status.get("parentNode").removeChild(status); | 87 | status.get("parentNode").removeChild(status); |
1175 | 88 | } | 88 | } |
1176 | @@ -101,7 +101,7 @@ | |||
1177 | 101 | * The .static area should be hidden by adding the "unseen" class. | 101 | * The .static area should be hidden by adding the "unseen" class. |
1178 | 102 | */ | 102 | */ |
1179 | 103 | test_hide_static: function() { | 103 | test_hide_static: function() { |
1181 | 104 | var static_area = this.choice_edit.get('contentBox').query('.static'); | 104 | var static_area = this.choice_edit.get('contentBox').one('.static'); |
1182 | 105 | Assert.isTrue( | 105 | Assert.isTrue( |
1183 | 106 | static_area.hasClass('unseen'), "Static area is not hidden."); | 106 | static_area.hasClass('unseen'), "Static area is not hidden."); |
1184 | 107 | }, | 107 | }, |
1185 | @@ -110,7 +110,7 @@ | |||
1186 | 110 | * The .dynamic area should be shown by removing the "unseen" class. | 110 | * The .dynamic area should be shown by removing the "unseen" class. |
1187 | 111 | */ | 111 | */ |
1188 | 112 | test_hide_dynamic: function() { | 112 | test_hide_dynamic: function() { |
1190 | 113 | var dynamic_area = this.choice_edit.get('contentBox').query('.dynamic'); | 113 | var dynamic_area = this.choice_edit.get('contentBox').one('.dynamic'); |
1191 | 114 | Assert.isFalse( | 114 | Assert.isFalse( |
1192 | 115 | dynamic_area.hasClass('unseen'), "Dynamic area is hidden."); | 115 | dynamic_area.hasClass('unseen'), "Dynamic area is hidden."); |
1193 | 116 | }, | 116 | }, |
1194 | 117 | 117 | ||
1195 | === modified file 'lib/canonical/launchpad/javascript/bugs/tests/test_subscriber.js' | |||
1196 | --- lib/canonical/launchpad/javascript/bugs/tests/test_subscriber.js 2009-07-24 15:26:14 +0000 | |||
1197 | +++ lib/canonical/launchpad/javascript/bugs/tests/test_subscriber.js 2009-11-18 13:45:26 +0000 | |||
1198 | @@ -99,7 +99,7 @@ | |||
1199 | 99 | name: 'Subscriber Name When Passed Node', | 99 | name: 'Subscriber Name When Passed Node', |
1200 | 100 | 100 | ||
1201 | 101 | setUp: function() { | 101 | setUp: function() { |
1203 | 102 | var node = Y.get('.subscriber-tester'); | 102 | var node = Y.one('.subscriber-tester'); |
1204 | 103 | this.config = { | 103 | this.config = { |
1205 | 104 | uri: '/~tester', | 104 | uri: '/~tester', |
1206 | 105 | user_node: node | 105 | user_node: node |
1207 | @@ -212,7 +212,7 @@ | |||
1208 | 212 | Y.Assert.isFalse( | 212 | Y.Assert.isFalse( |
1209 | 213 | this.subscription.is_node(), | 213 | this.subscription.is_node(), |
1210 | 214 | 'Initially, no node should be supplied to the config.'); | 214 | 'Initially, no node should be supplied to the config.'); |
1212 | 215 | var link = Y.get('.menu-link-subscription'); | 215 | var link = Y.one('.menu-link-subscription'); |
1213 | 216 | this.subscription.set('link', link); | 216 | this.subscription.set('link', link); |
1214 | 217 | Y.Assert.isTrue( | 217 | Y.Assert.isTrue( |
1215 | 218 | this.subscription.is_node(), | 218 | this.subscription.is_node(), |
1216 | 219 | 219 | ||
1217 | === modified file 'lib/canonical/launchpad/javascript/client/client.js' | |||
1218 | --- lib/canonical/launchpad/javascript/client/client.js 2009-10-26 14:57:22 +0000 | |||
1219 | +++ lib/canonical/launchpad/javascript/client/client.js 2009-11-18 13:45:26 +0000 | |||
1220 | @@ -69,8 +69,8 @@ | |||
1221 | 69 | result = format(o); | 69 | result = format(o); |
1222 | 70 | } else { | 70 | } else { |
1223 | 71 | result = '(direct-attributes)\n ' + introspect(o); | 71 | result = '(direct-attributes)\n ' + introspect(o); |
1226 | 72 | if (o.getAtts !== undefined) { | 72 | if (o.getAttrs !== undefined) { |
1227 | 73 | result += '\n(get()-attributes)\n ' + introspect(o.getAtts()); | 73 | result += '\n(get()-attributes)\n ' + introspect(o.getAttrs()); |
1228 | 74 | } | 74 | } |
1229 | 75 | } | 75 | } |
1230 | 76 | if (name !== undefined) { | 76 | if (name !== undefined) { |
1231 | @@ -331,15 +331,19 @@ | |||
1232 | 331 | this.dirty_attributes = []; | 331 | this.dirty_attributes = []; |
1233 | 332 | var entry = this; | 332 | var entry = this; |
1234 | 333 | 333 | ||
1235 | 334 | // Copy the representation keys into our own set of attributes, and add | ||
1236 | 335 | // an attribute-change event listener for caching purposes. | ||
1237 | 334 | for (key in representation) { | 336 | for (key in representation) { |
1238 | 335 | if (representation.hasOwnProperty(key)) { | 337 | if (representation.hasOwnProperty(key)) { |
1240 | 336 | this.addAtt(key, {value: representation[key]}); | 338 | this.addAttr(key, {value: representation[key]}); |
1241 | 337 | this.on(key + "Change", this.mark_as_dirty); | 339 | this.on(key + "Change", this.mark_as_dirty); |
1242 | 338 | } | 340 | } |
1243 | 339 | } | 341 | } |
1244 | 340 | }; | 342 | }; |
1245 | 341 | 343 | ||
1246 | 342 | LP.client.Entry.prototype = new LP.client.Resource(); | 344 | LP.client.Entry.prototype = new LP.client.Resource(); |
1247 | 345 | |||
1248 | 346 | // Augment with Attribute so that we can listen for attribute change events. | ||
1249 | 343 | Y.augment(LP.client.Entry, Y.Attribute); | 347 | Y.augment(LP.client.Entry, Y.Attribute); |
1250 | 344 | 348 | ||
1251 | 345 | LP.client.Entry.prototype.mark_as_dirty = function(event) { | 349 | LP.client.Entry.prototype.mark_as_dirty = function(event) { |
1252 | @@ -669,7 +673,8 @@ | |||
1253 | 669 | } | 673 | } |
1254 | 670 | }; | 674 | }; |
1255 | 671 | 675 | ||
1257 | 672 | Y.extend(PATCHPlugin, Y.Plugin, { | 676 | |
1258 | 677 | Y.extend(PATCHPlugin, Y.Plugin.Base, { | ||
1259 | 673 | 678 | ||
1260 | 674 | /** | 679 | /** |
1261 | 675 | * Configuration parameters that will be passed through to the LP.client | 680 | * Configuration parameters that will be passed through to the LP.client |
1262 | @@ -702,7 +707,7 @@ | |||
1263 | 702 | 707 | ||
1264 | 703 | // Save a reference to the original _saveData() | 708 | // Save a reference to the original _saveData() |
1265 | 704 | //method before wrapping it. | 709 | //method before wrapping it. |
1267 | 705 | this.original_save = config.owner._saveData; | 710 | this.original_save = config.host._saveData; |
1268 | 706 | 711 | ||
1269 | 707 | // We want to run our PATCH code instead of the original | 712 | // We want to run our PATCH code instead of the original |
1270 | 708 | // 'save' method. Using doBefore() means that | 713 | // 'save' method. Using doBefore() means that |
1271 | @@ -713,10 +718,10 @@ | |||
1272 | 713 | var self = this; | 718 | var self = this; |
1273 | 714 | this.error_handler = new LP.client.ErrorHandler(); | 719 | this.error_handler = new LP.client.ErrorHandler(); |
1274 | 715 | this.error_handler.clearProgressUI = function () { | 720 | this.error_handler.clearProgressUI = function () { |
1276 | 716 | self._owner._uiClearWaiting(); | 721 | config.host._uiClearWaiting(); |
1277 | 717 | }; | 722 | }; |
1278 | 718 | this.error_handler.showError = function (error_msg) { | 723 | this.error_handler.showError = function (error_msg) { |
1280 | 719 | self._owner.showError(error_msg); | 724 | config.host.showError(error_msg); |
1281 | 720 | }; | 725 | }; |
1282 | 721 | }, | 726 | }, |
1283 | 722 | 727 | ||
1284 | @@ -732,7 +737,7 @@ | |||
1285 | 732 | * @method doPATCH | 737 | * @method doPATCH |
1286 | 733 | */ | 738 | */ |
1287 | 734 | doPATCH: function() { | 739 | doPATCH: function() { |
1289 | 735 | var owner = this._owner, | 740 | var owner = this.get("host"), |
1290 | 736 | original_save = this.original_save; | 741 | original_save = this.original_save; |
1291 | 737 | 742 | ||
1292 | 738 | // Set the widget in 'waiting' state. | 743 | // Set the widget in 'waiting' state. |
1293 | 739 | 744 | ||
1294 | === modified file 'lib/canonical/launchpad/javascript/code/branchlinks.js' | |||
1295 | --- lib/canonical/launchpad/javascript/code/branchlinks.js 2009-08-13 13:16:04 +0000 | |||
1296 | +++ lib/canonical/launchpad/javascript/code/branchlinks.js 2009-11-18 13:45:26 +0000 | |||
1297 | @@ -44,7 +44,7 @@ | |||
1298 | 44 | }); | 44 | }); |
1299 | 45 | link_bug_overlay.render(); | 45 | link_bug_overlay.render(); |
1300 | 46 | link_bug_overlay.loadFormContentAndRender('+linkbug/++form++'); | 46 | link_bug_overlay.loadFormContentAndRender('+linkbug/++form++'); |
1302 | 47 | var linkbug_handle = Y.get('#linkbug'); | 47 | var linkbug_handle = Y.one('#linkbug'); |
1303 | 48 | linkbug_handle.addClass('js-action'); | 48 | linkbug_handle.addClass('js-action'); |
1304 | 49 | linkbug_handle.on('click', function(e) { | 49 | linkbug_handle.on('click', function(e) { |
1305 | 50 | e.preventDefault(); | 50 | e.preventDefault(); |
1306 | @@ -59,14 +59,11 @@ | |||
1307 | 59 | * remove the links. | 59 | * remove the links. |
1308 | 60 | */ | 60 | */ |
1309 | 61 | function connect_remove_links() { | 61 | function connect_remove_links() { |
1318 | 62 | var linked_bugs = Y.all('.delete-buglink'); | 62 | Y.on('click', function(e) { |
1319 | 63 | if (Y.Lang.isValue(linked_bugs)) { | 63 | e.preventDefault(); |
1320 | 64 | linked_bugs.on('click', function(e) { | 64 | var bugnumber = get_bugnumber_from_id(e.currentTarget.get('id')); |
1321 | 65 | e.preventDefault(); | 65 | unlink_bug_from_branch(bugnumber); |
1322 | 66 | var bugnumber = get_bugnumber_from_id(e.currentTarget.get('id')); | 66 | }, '.delete-buglink'); |
1315 | 67 | unlink_bug_from_branch(bugnumber); | ||
1316 | 68 | }); | ||
1317 | 69 | } | ||
1323 | 70 | } | 67 | } |
1324 | 71 | 68 | ||
1325 | 72 | /* | 69 | /* |
1326 | @@ -78,7 +75,7 @@ | |||
1327 | 78 | create_temporary_spinner(); | 75 | create_temporary_spinner(); |
1328 | 79 | 76 | ||
1329 | 80 | var bugnumber = data['field.bug']; | 77 | var bugnumber = data['field.bug']; |
1331 | 81 | var existing = Y.get('#buglink-' + bugnumber); | 78 | var existing = Y.one('#buglink-' + bugnumber); |
1332 | 82 | if (Y.Lang.isValue(existing)) { | 79 | if (Y.Lang.isValue(existing)) { |
1333 | 83 | // Bug is already linked, don't do unneccessary requests. | 80 | // Bug is already linked, don't do unneccessary requests. |
1334 | 84 | Y.lazr.anim.green_flash({node: existing}).run(); | 81 | Y.lazr.anim.green_flash({node: existing}).run(); |
1335 | @@ -124,10 +121,10 @@ | |||
1336 | 124 | on: { | 121 | on: { |
1337 | 125 | success: function(id, response) { | 122 | success: function(id, response) { |
1338 | 126 | destroy_temporary_spinner(); | 123 | destroy_temporary_spinner(); |
1340 | 127 | Y.get('#linkbug').set( | 124 | Y.one('#linkbug').set( |
1341 | 128 | 'innerHTML', 'Link to another bug report'); | 125 | 'innerHTML', 'Link to another bug report'); |
1344 | 129 | Y.get('#buglink-list').set('innerHTML', response.responseText); | 126 | Y.one('#buglink-list').set('innerHTML', response.responseText); |
1345 | 130 | var new_buglink = Y.get('#buglink-' + bug.get('id')); | 127 | var new_buglink = Y.one('#buglink-' + bug.get('id')); |
1346 | 131 | var anim = Y.lazr.anim.green_flash({node: new_buglink}); | 128 | var anim = Y.lazr.anim.green_flash({node: new_buglink}); |
1347 | 132 | anim.on('end', connect_remove_links); | 129 | anim.on('end', connect_remove_links); |
1348 | 133 | anim.run(); | 130 | anim.run(); |
1349 | @@ -150,14 +147,14 @@ | |||
1350 | 150 | function unlink_bug_from_branch(bugnumber) { | 147 | function unlink_bug_from_branch(bugnumber) { |
1351 | 151 | link_bug_overlay.hide(); | 148 | link_bug_overlay.hide(); |
1352 | 152 | 149 | ||
1354 | 153 | Y.get('#delete-buglink-' + bugnumber).get('children').set( | 150 | Y.one('#delete-buglink-' + bugnumber).get('children').set( |
1355 | 154 | 'src', '/@@/spinner'); | 151 | 'src', '/@@/spinner'); |
1356 | 155 | get_bug_from_bugnumber(bugnumber, function(bug) { | 152 | get_bug_from_bugnumber(bugnumber, function(bug) { |
1357 | 156 | 153 | ||
1358 | 157 | config = { | 154 | config = { |
1359 | 158 | on: { | 155 | on: { |
1360 | 159 | success: function(updated_entry) { | 156 | success: function(updated_entry) { |
1362 | 160 | var element = Y.get('#buglink-' + bugnumber); | 157 | var element = Y.one('#buglink-' + bugnumber); |
1363 | 161 | var parent_element = element.get('parentNode'); | 158 | var parent_element = element.get('parentNode'); |
1364 | 162 | anim = Y.lazr.anim.red_flash({node: element}); | 159 | anim = Y.lazr.anim.red_flash({node: element}); |
1365 | 163 | anim.on('end', function() { | 160 | anim.on('end', function() { |
1366 | @@ -165,8 +162,8 @@ | |||
1367 | 165 | 162 | ||
1368 | 166 | // Check to see if that was the only bug linked. | 163 | // Check to see if that was the only bug linked. |
1369 | 167 | var buglinks = Y.all(".bug-branch-summary"); | 164 | var buglinks = Y.all(".bug-branch-summary"); |
1372 | 168 | if (!buglinks) { | 165 | if (buglinks.size() == 0) { |
1373 | 169 | Y.get('#linkbug').set('innerHTML', | 166 | Y.one('#linkbug').set('innerHTML', |
1374 | 170 | 'Link to a bug report'); | 167 | 'Link to a bug report'); |
1375 | 171 | } | 168 | } |
1376 | 172 | }); | 169 | }); |
1377 | @@ -174,7 +171,7 @@ | |||
1378 | 174 | }, | 171 | }, |
1379 | 175 | failure: function(id, response) { | 172 | failure: function(id, response) { |
1380 | 176 | alert('An unexpected error has occurred.'); | 173 | alert('An unexpected error has occurred.'); |
1382 | 177 | Y.get('#delete-buglink-' + bugnumber).get('children').set( | 174 | Y.one('#delete-buglink-' + bugnumber).get('children').set( |
1383 | 178 | 'src', '/@@/remove'); | 175 | 'src', '/@@/remove'); |
1384 | 179 | Y.log(response.responseText); | 176 | Y.log(response.responseText); |
1385 | 180 | } | 177 | } |
1386 | @@ -237,8 +234,8 @@ | |||
1387 | 237 | '<div id="temp-spinner">', | 234 | '<div id="temp-spinner">', |
1388 | 238 | '<img src="/@@/spinner"/>Linking...', | 235 | '<img src="/@@/spinner"/>Linking...', |
1389 | 239 | '</div>'].join('')); | 236 | '</div>'].join('')); |
1392 | 240 | var buglinks = Y.get('#buglinks'); | 237 | var buglinks = Y.one('#buglinks'); |
1393 | 241 | var last = Y.get('#linkbug').get('parentNode'); | 238 | var last = Y.one('#linkbug').get('parentNode'); |
1394 | 242 | if (last) { | 239 | if (last) { |
1395 | 243 | buglinks.insertBefore(temp_spinner, last); | 240 | buglinks.insertBefore(temp_spinner, last); |
1396 | 244 | } | 241 | } |
1397 | @@ -249,7 +246,7 @@ | |||
1398 | 249 | */ | 246 | */ |
1399 | 250 | function destroy_temporary_spinner() { | 247 | function destroy_temporary_spinner() { |
1400 | 251 | 248 | ||
1402 | 252 | var temp_spinner = Y.get('#temp-spinner'); | 249 | var temp_spinner = Y.one('#temp-spinner'); |
1403 | 253 | var spinner_parent = temp_spinner.get('parentNode'); | 250 | var spinner_parent = temp_spinner.get('parentNode'); |
1404 | 254 | spinner_parent.removeChild(temp_spinner); | 251 | spinner_parent.removeChild(temp_spinner); |
1405 | 255 | 252 | ||
1406 | 256 | 253 | ||
1407 | === modified file 'lib/canonical/launchpad/javascript/code/branchstatus.js' | |||
1408 | --- lib/canonical/launchpad/javascript/code/branchstatus.js 2009-11-10 05:12:59 +0000 | |||
1409 | +++ lib/canonical/launchpad/javascript/code/branchstatus.js 2009-11-18 13:45:26 +0000 | |||
1410 | @@ -15,7 +15,7 @@ | |||
1411 | 15 | */ | 15 | */ |
1412 | 16 | Y.branchstatus.connect_status = function(conf) { | 16 | Y.branchstatus.connect_status = function(conf) { |
1413 | 17 | 17 | ||
1415 | 18 | var status_content = Y.get('#branch-details-status-value'); | 18 | var status_content = Y.one('#branch-details-status-value'); |
1416 | 19 | 19 | ||
1417 | 20 | if | 20 | if |
1418 | 21 | (conf.user_can_edit_status) { | 21 | (conf.user_can_edit_status) { |
1419 | @@ -31,9 +31,9 @@ | |||
1420 | 31 | var cb = status_choice_edit.get('contentBox'); | 31 | var cb = status_choice_edit.get('contentBox'); |
1421 | 32 | Y.Array.each(conf.status_widget_items, function(item) { | 32 | Y.Array.each(conf.status_widget_items, function(item) { |
1422 | 33 | if (item.value == status_choice_edit.get('value')) { | 33 | if (item.value == status_choice_edit.get('value')) { |
1424 | 34 | cb.query('span').addClass(item.css_class); | 34 | cb.one('span').addClass(item.css_class); |
1425 | 35 | } else { | 35 | } else { |
1427 | 36 | cb.query('span').removeClass(item.css_class); | 36 | cb.one('span').removeClass(item.css_class); |
1428 | 37 | } | 37 | } |
1429 | 38 | }); | 38 | }); |
1430 | 39 | }); | 39 | }); |
1431 | 40 | 40 | ||
1432 | === modified file 'lib/canonical/launchpad/javascript/code/branchsubscription.js' | |||
1433 | --- lib/canonical/launchpad/javascript/code/branchsubscription.js 2009-08-13 13:47:24 +0000 | |||
1434 | +++ lib/canonical/launchpad/javascript/code/branchsubscription.js 2009-11-18 13:45:26 +0000 | |||
1435 | @@ -38,15 +38,15 @@ | |||
1436 | 38 | Y.io('+branch-portlet-subscriber-content', { | 38 | Y.io('+branch-portlet-subscriber-content', { |
1437 | 39 | on: { | 39 | on: { |
1438 | 40 | success: function(id, response) { | 40 | success: function(id, response) { |
1440 | 41 | Y.get('#subscriber-list').set( | 41 | Y.one('#subscriber-list').set( |
1441 | 42 | 'innerHTML', response.responseText); | 42 | 'innerHTML', response.responseText); |
1443 | 43 | Y.get('#subscriber-list').setStyle('display', 'block'); | 43 | Y.one('#subscriber-list').setStyle('display', 'block'); |
1444 | 44 | if (highlight) { | 44 | if (highlight) { |
1445 | 45 | animate_subscription_update(); | 45 | animate_subscription_update(); |
1446 | 46 | } | 46 | } |
1447 | 47 | }, | 47 | }, |
1448 | 48 | failure: function(id, response) { | 48 | failure: function(id, response) { |
1450 | 49 | Y.get('#subscriber-list').set( | 49 | Y.one('#subscriber-list').set( |
1451 | 50 | 'innerHTML', 'A problem has occurred.'); | 50 | 'innerHTML', 'A problem has occurred.'); |
1452 | 51 | Y.log(reponse.responseText); | 51 | Y.log(reponse.responseText); |
1453 | 52 | }, | 52 | }, |
1454 | @@ -77,7 +77,7 @@ | |||
1455 | 77 | subscription_form_overlay.hide(); | 77 | subscription_form_overlay.hide(); |
1456 | 78 | 78 | ||
1457 | 79 | me = LP.client.links.me; | 79 | me = LP.client.links.me; |
1459 | 80 | var selfsubscriptioncontainer = Y.get('#selfsubscriptioncontainer'); | 80 | var selfsubscriptioncontainer = Y.one('#selfsubscriptioncontainer'); |
1460 | 81 | selfsubscriptioncontainer.set('innerHTML', | 81 | selfsubscriptioncontainer.set('innerHTML', |
1461 | 82 | '<img src="/@@/spinner">Subscribing...'); | 82 | '<img src="/@@/spinner">Subscribing...'); |
1462 | 83 | 83 | ||
1463 | @@ -104,7 +104,7 @@ | |||
1464 | 104 | 104 | ||
1465 | 105 | // XXX: rockstar: bug=336866 The etag returned by lp_save() is | 105 | // XXX: rockstar: bug=336866 The etag returned by lp_save() is |
1466 | 106 | // totally wrong. | 106 | // totally wrong. |
1468 | 107 | lp_subscription_entry.removeAtt('http_etag'); | 107 | lp_subscription_entry.removeAttr('http_etag'); |
1469 | 108 | 108 | ||
1470 | 109 | selfsubscriptioncontainer.setStyle('display', 'none'); | 109 | selfsubscriptioncontainer.setStyle('display', 'none'); |
1471 | 110 | Y.code.branchsubscription.update_subscriber_list(true); | 110 | Y.code.branchsubscription.update_subscriber_list(true); |
1472 | @@ -133,7 +133,7 @@ | |||
1473 | 133 | */ | 133 | */ |
1474 | 134 | function set_up_self_subscription_formoverlay(element_id) { | 134 | function set_up_self_subscription_formoverlay(element_id) { |
1475 | 135 | 135 | ||
1477 | 136 | var subscribe_yourself = Y.get('#selfsubscription'); | 136 | var subscribe_yourself = Y.one('#selfsubscription'); |
1478 | 137 | 137 | ||
1479 | 138 | if (subscribe_yourself !== null) { | 138 | if (subscribe_yourself !== null) { |
1480 | 139 | 139 | ||
1481 | @@ -158,8 +158,8 @@ | |||
1482 | 158 | /* XXX: rockstar - bug=389185 - The form is a bit wide for the current | 158 | /* XXX: rockstar - bug=389185 - The form is a bit wide for the current |
1483 | 159 | * form overlay, and there isn't an easy way to resize it, thus this hack. | 159 | * form overlay, and there isn't an easy way to resize it, thus this hack. |
1484 | 160 | */ | 160 | */ |
1487 | 161 | Y.get('#shadow').setStyle('width', '562px'); | 161 | Y.one('#shadow').setStyle('width', '562px'); |
1488 | 162 | Y.get('div#yui-pretty-overlay-modal.content_box_container').setStyle( | 162 | Y.one('div#yui-pretty-overlay-modal.content_box_container').setStyle( |
1489 | 163 | 'width', '500px'); | 163 | 'width', '500px'); |
1490 | 164 | subscribe_yourself.addClass('js-action'); | 164 | subscribe_yourself.addClass('js-action'); |
1491 | 165 | subscribe_yourself.on('click', function(e) { | 165 | subscribe_yourself.on('click', function(e) { |
1492 | @@ -176,7 +176,7 @@ | |||
1493 | 176 | * Hides the "Edit your subscription" link. | 176 | * Hides the "Edit your subscription" link. |
1494 | 177 | */ | 177 | */ |
1495 | 178 | function hide_edit_your_subscription() { | 178 | function hide_edit_your_subscription() { |
1497 | 179 | var element = Y.get('#selfsubscription'); | 179 | var element = Y.one('#selfsubscription'); |
1498 | 180 | if (element !== null) { | 180 | if (element !== null) { |
1499 | 181 | if (element.get('innerHTML') == 'Edit your subscription') { | 181 | if (element.get('innerHTML') == 'Edit your subscription') { |
1500 | 182 | element.setStyle('display', 'none'); | 182 | element.setStyle('display', 'none'); |
1501 | @@ -203,13 +203,13 @@ | |||
1502 | 203 | ' style="position:absolute;right:8px" /></div>'].join(''); | 203 | ' style="position:absolute;right:8px" /></div>'].join(''); |
1503 | 204 | var link_node = Y.Node.create(html); | 204 | var link_node = Y.Node.create(html); |
1504 | 205 | 205 | ||
1507 | 206 | var subscribers = Y.get('#subscriber-list'); | 206 | var subscribers = Y.one('#subscriber-list'); |
1508 | 207 | var next = subscribers.query('div')[0]; | 207 | var next = subscribers.one('div')[0]; |
1509 | 208 | if (next) { | 208 | if (next) { |
1510 | 209 | subscribers.insertBefore(link_node, next); | 209 | subscribers.insertBefore(link_node, next); |
1511 | 210 | } else { | 210 | } else { |
1512 | 211 | // Handle the case of the displayed "None". | 211 | // Handle the case of the displayed "None". |
1514 | 212 | var none_subscribers = Y.get('#none-subscribers'); | 212 | var none_subscribers = Y.one('#none-subscribers'); |
1515 | 213 | if (none_subscribers) { | 213 | if (none_subscribers) { |
1516 | 214 | var none_parent = none_subscribers.get('parentNode'); | 214 | var none_parent = none_subscribers.get('parentNode'); |
1517 | 215 | none_parent.removeChild(none_subscribers); | 215 | none_parent.removeChild(none_subscribers); |
1518 | @@ -261,7 +261,7 @@ | |||
1519 | 261 | 261 | ||
1520 | 262 | 262 | ||
1521 | 263 | function animate_subscription_update() { | 263 | function animate_subscription_update() { |
1523 | 264 | var element = Y.get('#subscriber-' + user_name); | 264 | var element = Y.one('#subscriber-' + user_name); |
1524 | 265 | var anim = Y.lazr.anim.green_flash({node: element}); | 265 | var anim = Y.lazr.anim.green_flash({node: element}); |
1525 | 266 | anim.run(); | 266 | anim.run(); |
1526 | 267 | } | 267 | } |
1527 | 268 | 268 | ||
1528 | === modified file 'lib/canonical/launchpad/javascript/code/codereview.js' | |||
1529 | --- lib/canonical/launchpad/javascript/code/codereview.js 2009-10-28 16:49:59 +0000 | |||
1530 | +++ lib/canonical/launchpad/javascript/code/codereview.js 2009-11-18 13:45:26 +0000 | |||
1531 | @@ -18,7 +18,7 @@ | |||
1532 | 18 | */ | 18 | */ |
1533 | 19 | Y.codereview.connect_links = function() { | 19 | Y.codereview.connect_links = function() { |
1534 | 20 | 20 | ||
1536 | 21 | var link = Y.get('#request-review'); | 21 | var link = Y.one('#request-review'); |
1537 | 22 | if (link !== null) { | 22 | if (link !== null) { |
1538 | 23 | link.addClass('js-action'); | 23 | link.addClass('js-action'); |
1539 | 24 | link.on('click', show_request_review_form); | 24 | link.on('click', show_request_review_form); |
1540 | @@ -39,7 +39,7 @@ | |||
1541 | 39 | reviewer_picker = Y.lp.picker.create( | 39 | reviewer_picker = Y.lp.picker.create( |
1542 | 40 | 'ValidPersonOrTeam', | 40 | 'ValidPersonOrTeam', |
1543 | 41 | function(result) { | 41 | function(result) { |
1545 | 42 | var review_type = Y.get("[id=field.review_type]").get('value'); | 42 | var review_type = Y.one("[id=field.review_type]").get('value'); |
1546 | 43 | request_reviewer(result, review_type); | 43 | request_reviewer(result, review_type); |
1547 | 44 | }, | 44 | }, |
1548 | 45 | config); | 45 | config); |
1549 | @@ -67,7 +67,7 @@ | |||
1550 | 67 | '<img src="/@@/spinner" />', | 67 | '<img src="/@@/spinner" />', |
1551 | 68 | 'Requesting review...', | 68 | 'Requesting review...', |
1552 | 69 | '</td></tr>'].join("")); | 69 | '</td></tr>'].join("")); |
1554 | 70 | var last_element = Y.get('#email-review'); | 70 | var last_element = Y.one('#email-review'); |
1555 | 71 | var reviewer_table = last_element.get('parentNode'); | 71 | var reviewer_table = last_element.get('parentNode'); |
1556 | 72 | reviewer_table.insertBefore(table_row, last_element); | 72 | reviewer_table.insertBefore(table_row, last_element); |
1557 | 73 | 73 | ||
1558 | @@ -110,11 +110,11 @@ | |||
1559 | 110 | Y.io(VOTES_TABLE_PATH, { | 110 | Y.io(VOTES_TABLE_PATH, { |
1560 | 111 | on: { | 111 | on: { |
1561 | 112 | success: function(id, response) { | 112 | success: function(id, response) { |
1563 | 113 | var target = Y.get('#votes-target'); | 113 | var target = Y.one('#votes-target'); |
1564 | 114 | target.set('innerHTML', response.responseText); | 114 | target.set('innerHTML', response.responseText); |
1565 | 115 | 115 | ||
1566 | 116 | Y.codereview.connect_links(); | 116 | Y.codereview.connect_links(); |
1568 | 117 | var new_reviewer = Y.get('#review-' + username); | 117 | var new_reviewer = Y.one('#review-' + username); |
1569 | 118 | var anim = Y.lazr.anim.green_flash({node: new_reviewer}); | 118 | var anim = Y.lazr.anim.green_flash({node: new_reviewer}); |
1570 | 119 | anim.run(); | 119 | anim.run(); |
1571 | 120 | }, | 120 | }, |
1572 | @@ -147,11 +147,11 @@ | |||
1573 | 147 | var ui = Y.Node.create('<li><label>' + | 147 | var ui = Y.Node.create('<li><label>' + |
1574 | 148 | '<input type="checkbox" checked="checked" id="show-no"/>' + | 148 | '<input type="checkbox" checked="checked" id="show-no"/>' + |
1575 | 149 | ' Show line numbers</label></li>'); | 149 | ' Show line numbers</label></li>'); |
1577 | 150 | var ul = Y.get('#review-diff div div ul.horizontal'); | 150 | var ul = Y.one('#review-diff div div ul.horizontal'); |
1578 | 151 | ul.appendChild(ui); | 151 | ul.appendChild(ui); |
1579 | 152 | }, | 152 | }, |
1580 | 153 | bindUI: function(){ | 153 | bindUI: function(){ |
1582 | 154 | Y.get('#show-no').on('click', update_nos); | 154 | Y.one('#show-no').on('click', update_nos); |
1583 | 155 | } | 155 | } |
1584 | 156 | }); | 156 | }); |
1585 | 157 | 157 | ||
1586 | 158 | 158 | ||
1587 | === modified file 'lib/canonical/launchpad/javascript/lp/calendar.js' | |||
1588 | --- lib/canonical/launchpad/javascript/lp/calendar.js 2009-07-17 00:26:05 +0000 | |||
1589 | +++ lib/canonical/launchpad/javascript/lp/calendar.js 2009-11-18 13:45:26 +0000 | |||
1590 | @@ -125,7 +125,7 @@ | |||
1591 | 125 | 125 | ||
1592 | 126 | // Ensure that when the ok button is click, the calendar's | 126 | // Ensure that when the ok button is click, the calendar's |
1593 | 127 | // selectEvent is fired and the calendar closed. | 127 | // selectEvent is fired and the calendar closed. |
1595 | 128 | var ok_button = time_selector_node.query('.lazr-btn'); | 128 | var ok_button = time_selector_node.one('.lazr-btn'); |
1596 | 129 | Y.on("click", function(e) { | 129 | Y.on("click", function(e) { |
1597 | 130 | calendar_widget.selectEvent.fire(); | 130 | calendar_widget.selectEvent.fire(); |
1598 | 131 | calendar_widget.hide(); | 131 | calendar_widget.hide(); |
1599 | @@ -153,9 +153,9 @@ | |||
1600 | 153 | 153 | ||
1601 | 154 | if (is_datetime_widget) { | 154 | if (is_datetime_widget) { |
1602 | 155 | hours = pad_with_zero( | 155 | hours = pad_with_zero( |
1604 | 156 | time_selector_node.query('.hours').get('value')); | 156 | time_selector_node.one('.hours').get('value')); |
1605 | 157 | minutes = pad_with_zero( | 157 | minutes = pad_with_zero( |
1607 | 158 | time_selector_node.query('.minutes').get('value')); | 158 | time_selector_node.one('.minutes').get('value')); |
1608 | 159 | value_string += " " + hours + ":" + minutes; | 159 | value_string += " " + hours + ":" + minutes; |
1609 | 160 | } | 160 | } |
1610 | 161 | 161 | ||
1611 | 162 | 162 | ||
1612 | === modified file 'lib/canonical/launchpad/javascript/lp/comment.js' | |||
1613 | --- lib/canonical/launchpad/javascript/lp/comment.js 2009-10-28 14:56:45 +0000 | |||
1614 | +++ lib/canonical/launchpad/javascript/lp/comment.js 2009-11-18 13:45:26 +0000 | |||
1615 | @@ -20,7 +20,7 @@ | |||
1616 | 20 | */ | 20 | */ |
1617 | 21 | initializer: function() { | 21 | initializer: function() { |
1618 | 22 | this.submit_button = this.get_submit(); | 22 | this.submit_button = this.get_submit(); |
1620 | 23 | this.comment_input = Y.get('[id="field.comment"]'); | 23 | this.comment_input = Y.one('[id="field.comment"]'); |
1621 | 24 | this.lp_client = new LP.client.Launchpad(); | 24 | this.lp_client = new LP.client.Launchpad(); |
1622 | 25 | this.error_handler = new LP.client.ErrorHandler(); | 25 | this.error_handler = new LP.client.ErrorHandler(); |
1623 | 26 | this.error_handler.clearProgressUI = bind(this.clearProgressUI, this); | 26 | this.error_handler.clearProgressUI = bind(this.clearProgressUI, this); |
1624 | @@ -39,7 +39,7 @@ | |||
1625 | 39 | * @method get_submit | 39 | * @method get_submit |
1626 | 40 | */ | 40 | */ |
1627 | 41 | get_submit: function(){ | 41 | get_submit: function(){ |
1629 | 42 | return Y.get('[id="field.actions.save"]'); | 42 | return Y.one('[id="field.actions.save"]'); |
1630 | 43 | }, | 43 | }, |
1631 | 44 | /** | 44 | /** |
1632 | 45 | * Implementation of Widget.renderUI. | 45 | * Implementation of Widget.renderUI. |
1633 | @@ -131,7 +131,7 @@ | |||
1634 | 131 | * @param message_html The HTML of the comment to insert. | 131 | * @param message_html The HTML of the comment to insert. |
1635 | 132 | */ | 132 | */ |
1636 | 133 | insert_comment_HTML: function(message_html) { | 133 | insert_comment_HTML: function(message_html) { |
1638 | 134 | var fieldset = Y.get('#add-comment-form'); | 134 | var fieldset = Y.one('#add-comment-form'); |
1639 | 135 | var comment = Y.Node.create(message_html); | 135 | var comment = Y.Node.create(message_html); |
1640 | 136 | fieldset.get('parentNode').insertBefore(comment, fieldset); | 136 | fieldset.get('parentNode').insertBefore(comment, fieldset); |
1641 | 137 | this.reset_contents(); | 137 | this.reset_contents(); |
1642 | @@ -209,8 +209,8 @@ | |||
1643 | 209 | * @method initializer | 209 | * @method initializer |
1644 | 210 | */ | 210 | */ |
1645 | 211 | initializer: function() { | 211 | initializer: function() { |
1648 | 212 | this.vote_input = Y.get('[id="field.vote"]'); | 212 | this.vote_input = Y.one('[id="field.vote"]'); |
1649 | 213 | this.review_type = Y.get('[id="field.review_type"]'); | 213 | this.review_type = Y.one('[id="field.review_type"]'); |
1650 | 214 | this.in_reply_to = null; | 214 | this.in_reply_to = null; |
1651 | 215 | }, | 215 | }, |
1652 | 216 | /** | 216 | /** |
1653 | @@ -219,7 +219,7 @@ | |||
1654 | 219 | * @method get_submit | 219 | * @method get_submit |
1655 | 220 | */ | 220 | */ |
1656 | 221 | get_submit: function(){ | 221 | get_submit: function(){ |
1658 | 222 | return Y.get('[id="field.actions.add"]'); | 222 | return Y.one('[id="field.actions.add"]'); |
1659 | 223 | }, | 223 | }, |
1660 | 224 | /** | 224 | /** |
1661 | 225 | * Return the vote value selected, or null if none is selected. | 225 | * Return the vote value selected, or null if none is selected. |
1662 | @@ -313,7 +313,7 @@ | |||
1663 | 313 | reply_link.length - '+reply'.length); | 313 | reply_link.length - '+reply'.length); |
1664 | 314 | var object_url = '/api/beta' + root_url; | 314 | var object_url = '/api/beta' + root_url; |
1665 | 315 | this.activateProgressUI('Loading...'); | 315 | this.activateProgressUI('Loading...'); |
1667 | 316 | window.scrollTo(0, Y.get('label [for=field.vote]').getY()); | 316 | window.scrollTo(0, Y.one('label [for=field.vote]').getY()); |
1668 | 317 | this.lp_client.get(object_url, { | 317 | this.lp_client.get(object_url, { |
1669 | 318 | on: { | 318 | on: { |
1670 | 319 | success: bind(function(comment){ | 319 | success: bind(function(comment){ |
1671 | @@ -352,7 +352,7 @@ | |||
1672 | 352 | * @param message_html The HTML of the comment to insert. | 352 | * @param message_html The HTML of the comment to insert. |
1673 | 353 | */ | 353 | */ |
1674 | 354 | insert_comment_HTML: function(message_html){ | 354 | insert_comment_HTML: function(message_html){ |
1676 | 355 | var conversation = Y.get('[id=conversation]'); | 355 | var conversation = Y.one('[id=conversation]'); |
1677 | 356 | var comment = Y.Node.create(message_html); | 356 | var comment = Y.Node.create(message_html); |
1678 | 357 | conversation.appendChild(comment); | 357 | conversation.appendChild(comment); |
1679 | 358 | this.reset_contents(); | 358 | this.reset_contents(); |
1680 | @@ -360,7 +360,7 @@ | |||
1681 | 360 | }, | 360 | }, |
1682 | 361 | renderUI: function() { | 361 | renderUI: function() { |
1683 | 362 | CodeReviewComment.superclass.renderUI.apply(this); | 362 | CodeReviewComment.superclass.renderUI.apply(this); |
1685 | 363 | Y.get('#inline-add-comment').setStyle('display', 'block'); | 363 | Y.one('#inline-add-comment').setStyle('display', 'block'); |
1686 | 364 | }, | 364 | }, |
1687 | 365 | /** | 365 | /** |
1688 | 366 | * Implementation of Widget.bindUI: Bind events to methods. | 366 | * Implementation of Widget.bindUI: Bind events to methods. |
1689 | 367 | 367 | ||
1690 | === modified file 'lib/canonical/launchpad/javascript/lp/lp.js' | |||
1691 | --- lib/canonical/launchpad/javascript/lp/lp.js 2009-07-24 12:32:28 +0000 | |||
1692 | +++ lib/canonical/launchpad/javascript/lp/lp.js 2009-11-18 13:45:26 +0000 | |||
1693 | @@ -61,8 +61,8 @@ | |||
1694 | 61 | */ | 61 | */ |
1695 | 62 | Y.lp.toggle_collapsible = function(collapsible) { | 62 | Y.lp.toggle_collapsible = function(collapsible) { |
1696 | 63 | // Find the collapse icon and wrapper div for this collapsible. | 63 | // Find the collapse icon and wrapper div for this collapsible. |
1699 | 64 | var icon = collapsible.query('.collapseIcon'); | 64 | var icon = collapsible.one('.collapseIcon'); |
1700 | 65 | var wrapper_div = collapsible.query('.collapseWrapper'); | 65 | var wrapper_div = collapsible.one('.collapseWrapper'); |
1701 | 66 | 66 | ||
1702 | 67 | // If either the wrapper or the icon is null, raise an error. | 67 | // If either the wrapper or the icon is null, raise an error. |
1703 | 68 | if (wrapper_div === null) { | 68 | if (wrapper_div === null) { |
1704 | @@ -102,131 +102,129 @@ | |||
1705 | 102 | */ | 102 | */ |
1706 | 103 | Y.lp.activate_collapsibles = function() { | 103 | Y.lp.activate_collapsibles = function() { |
1707 | 104 | // Grab the collapsibles. | 104 | // Grab the collapsibles. |
1830 | 105 | var collapsibles = Y.all('.collapsible'); | 105 | Y.all('.collapsible').each(function(collapsible) { |
1831 | 106 | if (collapsibles !== null) { | 106 | |
1832 | 107 | Y.each(collapsibles, function(collapsible) { | 107 | var legend = collapsible.one('legend'); |
1833 | 108 | var legend = collapsible.query('legend'); | 108 | if (legend === null || |
1834 | 109 | if (legend === null || | 109 | legend.one('.collapseIcon') !== null) { |
1835 | 110 | legend.query('.collapseIcon') !== null) { | 110 | // If there's no legend there's not much we can do, |
1836 | 111 | // If there's no legend there's not much we can do, | 111 | // so just exit this iteration. If there's a |
1837 | 112 | // so just exit this iteration. If there's a | 112 | // collapseIcon in there we consider the collapsible |
1838 | 113 | // collapseIcon in there we consider the collapsible | 113 | // to already have been set up and therefore ignore |
1839 | 114 | // to already have been set up and therefore ignore | 114 | // it this time around. |
1840 | 115 | // it this time around. | 115 | return; |
1841 | 116 | return; | 116 | } |
1842 | 117 | } | 117 | |
1843 | 118 | 118 | var icon = Y.Node.create( | |
1844 | 119 | var icon = Y.Node.create( | 119 | '<img src="/@@/treeExpanded" class="collapseIcon" />'); |
1845 | 120 | '<img src="/@@/treeExpanded" class="collapseIcon" />'); | 120 | |
1846 | 121 | 121 | // We use javascript:void(0) here (though it will cause | |
1847 | 122 | // We use javascript:void(0) here (though it will cause | 122 | // lint to complain) because it prevents clicking on the |
1848 | 123 | // lint to complain) because it prevents clicking on the | 123 | // anchor from altering the page URL, which can subtly |
1849 | 124 | // anchor from altering the page URL, which can subtly | 124 | // break things. |
1850 | 125 | // break things. | 125 | var anchor = Y.Node.create( |
1851 | 126 | var anchor = Y.Node.create( | 126 | '<a href="javascript:void(0);"></a>'); |
1852 | 127 | '<a href="javascript:void(0);"></a>'); | 127 | anchor.appendChild(icon); |
1853 | 128 | anchor.appendChild(icon); | 128 | |
1854 | 129 | 129 | // Move the contents of the legend into the span. We use | |
1855 | 130 | // Move the contents of the legend into the span. We use | 130 | // the verbose version of <span /> to avoid silly |
1856 | 131 | // the verbose version of <span /> to avoid silly | 131 | // breakages in Firefox. |
1857 | 132 | // breakages in Firefox. | 132 | var span = Y.Node.create('<span></span>'); |
1858 | 133 | var span = Y.Node.create('<span></span>'); | 133 | var legend_children = legend.get('children'); |
1859 | 134 | var legend_children = legend.get('children'); | 134 | var len; |
1860 | 135 | var len; | 135 | |
1861 | 136 | 136 | if (Y.Lang.isValue(legend_children)) { | |
1862 | 137 | if (Y.Lang.isValue(legend_children)) { | 137 | // XXX 2009-07-06 gmb Account for oddness from |
1863 | 138 | // XXX 2009-07-06 gmb Account for oddness from | 138 | // Node.get('children'); (see YUI ticket 2528028 for |
1864 | 139 | // Node.get('children'); (see YUI ticket 2528028 for | 139 | // details). |
1865 | 140 | // details). | 140 | len = legend_children.size ? |
1866 | 141 | len = legend_children.size ? | 141 | legend_children.size() : legend_children.length; |
1867 | 142 | legend_children.size() : legend_children.length; | 142 | } else { |
1868 | 143 | } else { | 143 | len = 0; |
1869 | 144 | len = 0; | 144 | } |
1870 | 145 | } | 145 | |
1871 | 146 | 146 | if (len > 0) { | |
1872 | 147 | if (len > 0) { | 147 | // If the legend has child elements, move them |
1873 | 148 | // If the legend has child elements, move them | 148 | // across one by one. |
1874 | 149 | // across one by one. | 149 | Y.each(legend_children, function(child_node) { |
1875 | 150 | Y.each(legend_children, function(child_node) { | 150 | if (child_node.get('tagName') == 'A') { |
1876 | 151 | if (child_node.get('tagName') == 'A') { | 151 | // If this child is an anchor, add only its |
1877 | 152 | // If this child is an anchor, add only its | 152 | // contents to the span. |
1878 | 153 | // contents to the span. | 153 | new_node = Y.Node.create( |
1879 | 154 | new_node = Y.Node.create( | 154 | child_node.get('innerHTML')); |
1880 | 155 | child_node.get('innerHTML')); | 155 | span.appendChild(new_node); |
1881 | 156 | span.appendChild(new_node); | 156 | legend.removeChild(child_node); |
1882 | 157 | legend.removeChild(child_node); | 157 | } else { |
1883 | 158 | } else { | 158 | // Otherwise, add the node to the span as it |
1884 | 159 | // Otherwise, add the node to the span as it | 159 | // is. |
1885 | 160 | // is. | 160 | span.appendChild(child_node); |
1886 | 161 | span.appendChild(child_node); | 161 | } |
1765 | 162 | } | ||
1766 | 163 | }); | ||
1767 | 164 | } else { | ||
1768 | 165 | // Otherwise just move the innerHTML across as a | ||
1769 | 166 | // block. Once the span is appended to the anchor, | ||
1770 | 167 | // this will essentially turn the contents of the | ||
1771 | 168 | // legend into a link. | ||
1772 | 169 | span.set('innerHTML', legend.get('innerHTML')); | ||
1773 | 170 | legend.set('innerHTML', ''); | ||
1774 | 171 | } | ||
1775 | 172 | |||
1776 | 173 | // Replace the contents of the legend with the anchor. | ||
1777 | 174 | anchor.appendChild(span); | ||
1778 | 175 | legend.appendChild(anchor); | ||
1779 | 176 | |||
1780 | 177 | // Put a wrapper around the fieldset contents for ease | ||
1781 | 178 | // of hiding. | ||
1782 | 179 | var wrapper_div = Y.Node.create( | ||
1783 | 180 | '<div class="collapseWrapper" />'); | ||
1784 | 181 | |||
1785 | 182 | // Loop over the children of the collapsible and move them | ||
1786 | 183 | // into the wrapper div. We remove the legend from the | ||
1787 | 184 | // collapsible at this point to make sure it gets left | ||
1788 | 185 | // outside the wrapper div; we'll add it again later. | ||
1789 | 186 | collapsible.removeChild(legend); | ||
1790 | 187 | |||
1791 | 188 | // "Why do this as a while?" I hear you cry. Well, it's | ||
1792 | 189 | // because using Y.each() leads to interesting results | ||
1793 | 190 | // in FF3.5, Opera and Chrome, since by doing | ||
1794 | 191 | // appendChild() with each child node (and thus removing | ||
1795 | 192 | // them from the collapsible) means you're altering the | ||
1796 | 193 | // collection as you're looping over it, which is a Bad | ||
1797 | 194 | // Thing. This isn't as pretty but it actually works. | ||
1798 | 195 | var first_child = collapsible.query(':first-child'); | ||
1799 | 196 | while (Y.Lang.isValue(first_child)) { | ||
1800 | 197 | wrapper_div.appendChild(first_child); | ||
1801 | 198 | first_child = collapsible.query(':first-child'); | ||
1802 | 199 | } | ||
1803 | 200 | |||
1804 | 201 | // Put the legend and the new wrapper div into the | ||
1805 | 202 | // collapsible in the right order. | ||
1806 | 203 | collapsible.appendChild(legend); | ||
1807 | 204 | collapsible.appendChild(wrapper_div); | ||
1808 | 205 | |||
1809 | 206 | // If the collapsible is to be collapsed on pageload, do | ||
1810 | 207 | // so. | ||
1811 | 208 | if (collapsible.hasClass('collapsed')) { | ||
1812 | 209 | // Strip out the 'collapsed' class as it's no longer | ||
1813 | 210 | // needed. | ||
1814 | 211 | collapsible.removeClass('collapsed'); | ||
1815 | 212 | |||
1816 | 213 | // We use the slide_in effect to hide the | ||
1817 | 214 | // collapsible because it sets up all the properties | ||
1818 | 215 | // and classes for the element properly and saves us | ||
1819 | 216 | // from embarrasment later on. | ||
1820 | 217 | var slide_in = Y.lazr.effects.slide_in(wrapper_div); | ||
1821 | 218 | slide_in.run(); | ||
1822 | 219 | |||
1823 | 220 | icon.set('src', '/@@/treeCollapsed'); | ||
1824 | 221 | } | ||
1825 | 222 | |||
1826 | 223 | // Finally, add toggle_collapsible() as an onclick | ||
1827 | 224 | // handler to the anchor. | ||
1828 | 225 | anchor.on('click', function(e) { | ||
1829 | 226 | Y.lp.toggle_collapsible(collapsible); | ||
1887 | 227 | }); | 162 | }); |
1888 | 163 | } else { | ||
1889 | 164 | // Otherwise just move the innerHTML across as a | ||
1890 | 165 | // block. Once the span is appended to the anchor, | ||
1891 | 166 | // this will essentially turn the contents of the | ||
1892 | 167 | // legend into a link. | ||
1893 | 168 | span.set('innerHTML', legend.get('innerHTML')); | ||
1894 | 169 | legend.set('innerHTML', ''); | ||
1895 | 170 | } | ||
1896 | 171 | |||
1897 | 172 | // Replace the contents of the legend with the anchor. | ||
1898 | 173 | anchor.appendChild(span); | ||
1899 | 174 | legend.appendChild(anchor); | ||
1900 | 175 | |||
1901 | 176 | // Put a wrapper around the fieldset contents for ease | ||
1902 | 177 | // of hiding. | ||
1903 | 178 | var wrapper_div = Y.Node.create( | ||
1904 | 179 | '<div class="collapseWrapper" />'); | ||
1905 | 180 | |||
1906 | 181 | // Loop over the children of the collapsible and move them | ||
1907 | 182 | // into the wrapper div. We remove the legend from the | ||
1908 | 183 | // collapsible at this point to make sure it gets left | ||
1909 | 184 | // outside the wrapper div; we'll add it again later. | ||
1910 | 185 | collapsible.removeChild(legend); | ||
1911 | 186 | |||
1912 | 187 | // "Why do this as a while?" I hear you cry. Well, it's | ||
1913 | 188 | // because using Y.each() leads to interesting results | ||
1914 | 189 | // in FF3.5, Opera and Chrome, since by doing | ||
1915 | 190 | // appendChild() with each child node (and thus removing | ||
1916 | 191 | // them from the collapsible) means you're altering the | ||
1917 | 192 | // collection as you're looping over it, which is a Bad | ||
1918 | 193 | // Thing. This isn't as pretty but it actually works. | ||
1919 | 194 | var first_child = collapsible.one(':first-child'); | ||
1920 | 195 | while (Y.Lang.isValue(first_child)) { | ||
1921 | 196 | wrapper_div.appendChild(first_child); | ||
1922 | 197 | first_child = collapsible.one(':first-child'); | ||
1923 | 198 | } | ||
1924 | 199 | |||
1925 | 200 | // Put the legend and the new wrapper div into the | ||
1926 | 201 | // collapsible in the right order. | ||
1927 | 202 | collapsible.appendChild(legend); | ||
1928 | 203 | collapsible.appendChild(wrapper_div); | ||
1929 | 204 | |||
1930 | 205 | // If the collapsible is to be collapsed on pageload, do | ||
1931 | 206 | // so. | ||
1932 | 207 | if (collapsible.hasClass('collapsed')) { | ||
1933 | 208 | // Strip out the 'collapsed' class as it's no longer | ||
1934 | 209 | // needed. | ||
1935 | 210 | collapsible.removeClass('collapsed'); | ||
1936 | 211 | |||
1937 | 212 | // We use the slide_in effect to hide the | ||
1938 | 213 | // collapsible because it sets up all the properties | ||
1939 | 214 | // and classes for the element properly and saves us | ||
1940 | 215 | // from embarrasment later on. | ||
1941 | 216 | var slide_in = Y.lazr.effects.slide_in(wrapper_div); | ||
1942 | 217 | slide_in.run(); | ||
1943 | 218 | |||
1944 | 219 | icon.set('src', '/@@/treeCollapsed'); | ||
1945 | 220 | } | ||
1946 | 221 | |||
1947 | 222 | // Finally, add toggle_collapsible() as an onclick | ||
1948 | 223 | // handler to the anchor. | ||
1949 | 224 | anchor.on('click', function(e) { | ||
1950 | 225 | Y.lp.toggle_collapsible(collapsible); | ||
1951 | 228 | }); | 226 | }); |
1953 | 229 | } | 227 | }); |
1954 | 230 | }; | 228 | }; |
1955 | 231 | 229 | ||
1956 | 232 | }, '0.1', {requires:['cookie', 'lazr.effects']}); | 230 | }, '0.1', {requires:['cookie', 'lazr.effects']}); |
1957 | 233 | 231 | ||
1958 | === modified file 'lib/canonical/launchpad/javascript/lp/mapping.js' | |||
1959 | --- lib/canonical/launchpad/javascript/lp/mapping.js 2009-10-16 09:25:45 +0000 | |||
1960 | +++ lib/canonical/launchpad/javascript/lp/mapping.js 2009-11-18 13:45:26 +0000 | |||
1961 | @@ -102,16 +102,16 @@ | |||
1962 | 102 | */ | 102 | */ |
1963 | 103 | mapping.setLocation = function(lat, lng, geoname, | 103 | mapping.setLocation = function(lat, lng, geoname, |
1964 | 104 | tz_name, lat_name, lng_name) { | 104 | tz_name, lat_name, lng_name) { |
1968 | 105 | Y.get(Y.DOM.byId(lat_name)).set('value', lat); | 105 | Y.one(Y.DOM.byId(lat_name)).set('value', lat); |
1969 | 106 | Y.get(Y.DOM.byId(lng_name)).set('value', lng); | 106 | Y.one(Y.DOM.byId(lng_name)).set('value', lng); |
1970 | 107 | var spinner = Y.get('#tz_spinner'); | 107 | var spinner = Y.one('#tz_spinner'); |
1971 | 108 | spinner.set('src', '/@@/spinner'); | 108 | spinner.set('src', '/@@/spinner'); |
1972 | 109 | 109 | ||
1973 | 110 | function succeeded() { | 110 | function succeeded() { |
1974 | 111 | if (request.readyState == 4) { | 111 | if (request.readyState == 4) { |
1975 | 112 | if (request.responseText) { | 112 | if (request.responseText) { |
1976 | 113 | var tz = request.responseJSON.timezoneId; | 113 | var tz = request.responseJSON.timezoneId; |
1978 | 114 | Y.get(Y.DOM.byId(tz_name)).set('value', tz); | 114 | Y.one(Y.DOM.byId(tz_name)).set('value', tz); |
1979 | 115 | spinner.set('src', '/@@/nospin'); | 115 | spinner.set('src', '/@@/nospin'); |
1980 | 116 | } | 116 | } |
1981 | 117 | } | 117 | } |
1982 | @@ -164,7 +164,7 @@ | |||
1983 | 164 | var label = Y.Node.create('<label></label>'); | 164 | var label = Y.Node.create('<label></label>'); |
1984 | 165 | label.appendChild(checkbox); | 165 | label.appendChild(checkbox); |
1985 | 166 | label.appendChild(label_text); | 166 | label.appendChild(label_text); |
1987 | 167 | var action_div = Y.get(div_id); | 167 | var action_div = Y.one(div_id); |
1988 | 168 | action_div.appendChild(label); | 168 | action_div.appendChild(label); |
1989 | 169 | if (!show_small_maps) { | 169 | if (!show_small_maps) { |
1990 | 170 | mapping.toggleShowSmallMaps(checkbox); | 170 | mapping.toggleShowSmallMaps(checkbox); |
1991 | 171 | 171 | ||
1992 | === modified file 'lib/canonical/launchpad/javascript/lp/picker.js' | |||
1993 | --- lib/canonical/launchpad/javascript/lp/picker.js 2009-09-28 11:51:08 +0000 | |||
1994 | +++ lib/canonical/launchpad/javascript/lp/picker.js 2009-11-18 13:45:26 +0000 | |||
1995 | @@ -42,7 +42,7 @@ | |||
1996 | 42 | } | 42 | } |
1997 | 43 | } | 43 | } |
1998 | 44 | 44 | ||
2000 | 45 | var content_box = Y.get('#' + content_box_id); | 45 | var content_box = Y.one('#' + content_box_id); |
2001 | 46 | 46 | ||
2002 | 47 | var activator = new Y.lazr.activator.Activator( | 47 | var activator = new Y.lazr.activator.Activator( |
2003 | 48 | {contentBox: content_box}); | 48 | {contentBox: content_box}); |
2004 | @@ -56,7 +56,7 @@ | |||
2005 | 56 | }; | 56 | }; |
2006 | 57 | 57 | ||
2007 | 58 | var show_hide_buttons = function () { | 58 | var show_hide_buttons = function () { |
2009 | 59 | var link = content_box.query('.yui-activator-data-box a'); | 59 | var link = content_box.one('.yui-activator-data-box a'); |
2010 | 60 | if (remove_button) { | 60 | if (remove_button) { |
2011 | 61 | if (link === null || !show_remove_button) { | 61 | if (link === null || !show_remove_button) { |
2012 | 62 | remove_button.addClass('yui-picker-hidden'); | 62 | remove_button.addClass('yui-picker-hidden'); |
2013 | @@ -89,7 +89,7 @@ | |||
2014 | 89 | if (element.tagName == 'DD') { | 89 | if (element.tagName == 'DD') { |
2015 | 90 | if (current_field == attribute_name) { | 90 | if (current_field == attribute_name) { |
2016 | 91 | // The field value is found | 91 | // The field value is found |
2018 | 92 | node = Y.get(element).query('span'); | 92 | node = Y.one(element).one('span'); |
2019 | 93 | } else if (current_field == 'self_link') { | 93 | } else if (current_field == 'self_link') { |
2020 | 94 | picker._resource_uri = element.innerHTML; | 94 | picker._resource_uri = element.innerHTML; |
2021 | 95 | } | 95 | } |
2022 | @@ -230,7 +230,7 @@ | |||
2023 | 230 | 230 | ||
2024 | 231 | picker.subscribe('save', function (e) { | 231 | picker.subscribe('save', function (e) { |
2025 | 232 | Y.log('Got save event.'); | 232 | Y.log('Got save event.'); |
2027 | 233 | // Y.get() uses CSS3 selectors which don't work with ids containing | 233 | // Y.one() uses CSS3 selectors which don't work with ids containing |
2028 | 234 | // a period, so we have to use Y.DOM.byId(). | 234 | // a period, so we have to use Y.DOM.byId(). |
2029 | 235 | save(e.details[Y.Picker.SAVE_RESULT]); | 235 | save(e.details[Y.Picker.SAVE_RESULT]); |
2030 | 236 | }); | 236 | }); |
2031 | 237 | 237 | ||
2032 | === modified file 'lib/canonical/launchpad/javascript/lp/tests/test_lp_collapsibles.js' | |||
2033 | --- lib/canonical/launchpad/javascript/lp/tests/test_lp_collapsibles.js 2009-07-08 17:21:50 +0000 | |||
2034 | +++ lib/canonical/launchpad/javascript/lp/tests/test_lp_collapsibles.js 2009-11-18 13:45:26 +0000 | |||
2035 | @@ -39,7 +39,7 @@ | |||
2036 | 39 | this.default_fieldset_content_node)); | 39 | this.default_fieldset_content_node)); |
2037 | 40 | 40 | ||
2038 | 41 | // Reset the container to its default contents. | 41 | // Reset the container to its default contents. |
2040 | 42 | this.container = Y.get('#container-of-stuff'); | 42 | this.container = Y.one('#container-of-stuff'); |
2041 | 43 | this.container.set('innerHTML', ''); | 43 | this.container.set('innerHTML', ''); |
2042 | 44 | this.container.appendChild( | 44 | this.container.appendChild( |
2043 | 45 | this.default_fieldset_node.cloneNode( | 45 | this.default_fieldset_node.cloneNode( |
2044 | @@ -51,7 +51,7 @@ | |||
2045 | 51 | // business of toggling the collapsible open and shut. | 51 | // business of toggling the collapsible open and shut. |
2046 | 52 | Y.lp.activate_collapsibles(); | 52 | Y.lp.activate_collapsibles(); |
2047 | 53 | 53 | ||
2049 | 54 | var anchor = this.container.query('a'); | 54 | var anchor = this.container.one('a'); |
2050 | 55 | Assert.isNotNull( | 55 | Assert.isNotNull( |
2051 | 56 | anchor, "activate_collapsibles() should create an anchor"); | 56 | anchor, "activate_collapsibles() should create an anchor"); |
2052 | 57 | 57 | ||
2053 | @@ -65,8 +65,8 @@ | |||
2054 | 65 | // creates. | 65 | // creates. |
2055 | 66 | Y.lp.activate_collapsibles(); | 66 | Y.lp.activate_collapsibles(); |
2056 | 67 | 67 | ||
2059 | 68 | var anchor = this.container.query('a'); | 68 | var anchor = this.container.one('a'); |
2060 | 69 | var icon = anchor.query('img'); | 69 | var icon = anchor.one('img'); |
2061 | 70 | 70 | ||
2062 | 71 | Assert.isNotNull( | 71 | Assert.isNotNull( |
2063 | 72 | icon, | 72 | icon, |
2064 | @@ -83,8 +83,8 @@ | |||
2065 | 83 | // activate_collapsibles() adds a span to the anchor it creates. | 83 | // activate_collapsibles() adds a span to the anchor it creates. |
2066 | 84 | Y.lp.activate_collapsibles(); | 84 | Y.lp.activate_collapsibles(); |
2067 | 85 | 85 | ||
2070 | 86 | var anchor = this.container.query('a'); | 86 | var anchor = this.container.one('a'); |
2071 | 87 | var span = anchor.query('span'); | 87 | var span = anchor.one('span'); |
2072 | 88 | 88 | ||
2073 | 89 | Assert.isNotNull( | 89 | Assert.isNotNull( |
2074 | 90 | span, | 90 | span, |
2075 | @@ -108,22 +108,22 @@ | |||
2076 | 108 | wrapper_div, | 108 | wrapper_div, |
2077 | 109 | "activate_collapsibles() should add a wrapper div"); | 109 | "activate_collapsibles() should add a wrapper div"); |
2078 | 110 | 110 | ||
2080 | 111 | var collapsible = this.container.query('.collapsible'); | 111 | var collapsible = this.container.one('.collapsible'); |
2081 | 112 | Assert.isNotNull( | 112 | Assert.isNotNull( |
2083 | 113 | collapsible.query('.collapseWrapper'), | 113 | collapsible.one('.collapseWrapper'), |
2084 | 114 | "The collapseWrapper div should be within the collapsible."); | 114 | "The collapseWrapper div should be within the collapsible."); |
2085 | 115 | }, | 115 | }, |
2086 | 116 | 116 | ||
2087 | 117 | test_activate_collapsibles_collapses_collapsed: function() { | 117 | test_activate_collapsibles_collapses_collapsed: function() { |
2088 | 118 | // If a collapsible has the class 'collapsed', | 118 | // If a collapsible has the class 'collapsed', |
2089 | 119 | // activate_collapsibles() will pre-collapse it. | 119 | // activate_collapsibles() will pre-collapse it. |
2091 | 120 | var collapsible = this.container.query('.collapsible'); | 120 | var collapsible = this.container.one('.collapsible'); |
2092 | 121 | collapsible.addClass('collapsed'); | 121 | collapsible.addClass('collapsed'); |
2093 | 122 | 122 | ||
2094 | 123 | Y.lp.activate_collapsibles(); | 123 | Y.lp.activate_collapsibles(); |
2095 | 124 | 124 | ||
2098 | 125 | var icon = collapsible.query('img'); | 125 | var icon = collapsible.one('img'); |
2099 | 126 | var wrapper_div = collapsible.query('.collapseWrapper'); | 126 | var wrapper_div = collapsible.one('.collapseWrapper'); |
2100 | 127 | this.wait(function() { | 127 | this.wait(function() { |
2101 | 128 | Assert.isTrue(wrapper_div.hasClass('lazr-closed')); | 128 | Assert.isTrue(wrapper_div.hasClass('lazr-closed')); |
2102 | 129 | Assert.areNotEqual( | 129 | Assert.areNotEqual( |
2103 | @@ -136,9 +136,9 @@ | |||
2104 | 136 | // won't be pre-collapsed. | 136 | // won't be pre-collapsed. |
2105 | 137 | Y.lp.activate_collapsibles(); | 137 | Y.lp.activate_collapsibles(); |
2106 | 138 | 138 | ||
2110 | 139 | var collapsible = this.container.query('.collapsible'); | 139 | var collapsible = this.container.one('.collapsible'); |
2111 | 140 | var icon = collapsible.query('img'); | 140 | var icon = collapsible.one('img'); |
2112 | 141 | var wrapper_div = collapsible.query('.collapseWrapper'); | 141 | var wrapper_div = collapsible.one('.collapseWrapper'); |
2113 | 142 | this.wait(function() { | 142 | this.wait(function() { |
2114 | 143 | Assert.isFalse(wrapper_div.hasClass('lazr-closed')); | 143 | Assert.isFalse(wrapper_div.hasClass('lazr-closed')); |
2115 | 144 | Assert.areNotEqual( | 144 | Assert.areNotEqual( |
2116 | @@ -149,7 +149,7 @@ | |||
2117 | 149 | test_toggle_collapsible_opens_collapsed_collapsible: function() { | 149 | test_toggle_collapsible_opens_collapsed_collapsible: function() { |
2118 | 150 | // Calling toggle_collapsible() on a collapsed collapsible will | 150 | // Calling toggle_collapsible() on a collapsed collapsible will |
2119 | 151 | // toggle its state to open. | 151 | // toggle its state to open. |
2121 | 152 | var collapsible = this.container.query('.collapsible'); | 152 | var collapsible = this.container.one('.collapsible'); |
2122 | 153 | collapsible.addClass('collapsed'); | 153 | collapsible.addClass('collapsed'); |
2123 | 154 | 154 | ||
2124 | 155 | Y.lp.activate_collapsibles(); | 155 | Y.lp.activate_collapsibles(); |
2125 | @@ -157,8 +157,8 @@ | |||
2126 | 157 | this.wait(function() { | 157 | this.wait(function() { |
2127 | 158 | 158 | ||
2128 | 159 | // The collapsible's wrapper div will now be open. | 159 | // The collapsible's wrapper div will now be open. |
2131 | 160 | var icon = collapsible.query('img'); | 160 | var icon = collapsible.one('img'); |
2132 | 161 | var wrapper_div = collapsible.query('.collapseWrapper'); | 161 | var wrapper_div = collapsible.one('.collapseWrapper'); |
2133 | 162 | Assert.isTrue(wrapper_div.hasClass('lazr-open')); | 162 | Assert.isTrue(wrapper_div.hasClass('lazr-open')); |
2134 | 163 | Assert.areNotEqual( | 163 | Assert.areNotEqual( |
2135 | 164 | -1, icon.get('src').indexOf('/@@/treeExpanded'); | 164 | -1, icon.get('src').indexOf('/@@/treeExpanded'); |
2136 | @@ -168,15 +168,15 @@ | |||
2137 | 168 | test_toggle_collapsible_closes_open_collapsible: function() { | 168 | test_toggle_collapsible_closes_open_collapsible: function() { |
2138 | 169 | // Calling toggle_collapsible() on an open collapsible will | 169 | // Calling toggle_collapsible() on an open collapsible will |
2139 | 170 | // toggle its state to closed. | 170 | // toggle its state to closed. |
2141 | 171 | var collapsible = this.container.query('.collapsible'); | 171 | var collapsible = this.container.one('.collapsible'); |
2142 | 172 | 172 | ||
2143 | 173 | Y.lp.activate_collapsibles(); | 173 | Y.lp.activate_collapsibles(); |
2144 | 174 | Y.lp.toggle_collapsible(collapsible); | 174 | Y.lp.toggle_collapsible(collapsible); |
2145 | 175 | 175 | ||
2146 | 176 | this.wait(function() { | 176 | this.wait(function() { |
2147 | 177 | // The collapsible's wrapper div will now be closed. | 177 | // The collapsible's wrapper div will now be closed. |
2150 | 178 | var icon = collapsible.query('img'); | 178 | var icon = collapsible.one('img'); |
2151 | 179 | var wrapper_div = collapsible.query('.collapseWrapper'); | 179 | var wrapper_div = collapsible.one('.collapseWrapper'); |
2152 | 180 | Assert.isTrue(wrapper_div.hasClass('lazr-closed')); | 180 | Assert.isTrue(wrapper_div.hasClass('lazr-closed')); |
2153 | 181 | Assert.areNotEqual( | 181 | Assert.areNotEqual( |
2154 | 182 | -1, icon.get('src').indexOf('/@@/treeCollapsed')); | 182 | -1, icon.get('src').indexOf('/@@/treeCollapsed')); |
2155 | @@ -220,13 +220,13 @@ | |||
2156 | 220 | ' <p>No legend!</p>' + | 220 | ' <p>No legend!</p>' + |
2157 | 221 | '</fieldset>'); | 221 | '</fieldset>'); |
2158 | 222 | 222 | ||
2160 | 223 | var valid_collapsible = this.container.query('.collapsible'); | 223 | var valid_collapsible = this.container.one('.collapsible'); |
2161 | 224 | this.container.insertBefore(invalid_collapsible, valid_collapsible); | 224 | this.container.insertBefore(invalid_collapsible, valid_collapsible); |
2162 | 225 | Y.lp.activate_collapsibles(); | 225 | Y.lp.activate_collapsibles(); |
2163 | 226 | 226 | ||
2164 | 227 | // The standard, valid collapsible is still set up correctly. | 227 | // The standard, valid collapsible is still set up correctly. |
2165 | 228 | Assert.isNotNull( | 228 | Assert.isNotNull( |
2167 | 229 | valid_collapsible.query('.collapseWrapper'), | 229 | valid_collapsible.one('.collapseWrapper'), |
2168 | 230 | "activate_collapsibles() should have added a wrapper div for " + | 230 | "activate_collapsibles() should have added a wrapper div for " + |
2169 | 231 | "the valid collapsible."); | 231 | "the valid collapsible."); |
2170 | 232 | }, | 232 | }, |
2171 | @@ -243,9 +243,9 @@ | |||
2172 | 243 | } | 243 | } |
2173 | 244 | 244 | ||
2174 | 245 | Y.lp.activate_collapsibles(); | 245 | Y.lp.activate_collapsibles(); |
2176 | 246 | Y.each(Y.all('.collapsible'), function(collapsible) { | 246 | Y.all('.collapsible').each(function(collapsible) { |
2177 | 247 | Assert.isNotNull( | 247 | Assert.isNotNull( |
2179 | 248 | collapsible.query('.collapseWrapper'), | 248 | collapsible.one('.collapseWrapper'), |
2180 | 249 | "activate_collapsibles() should have added a wrapper div " + | 249 | "activate_collapsibles() should have added a wrapper div " + |
2181 | 250 | "to all collapsibles."); | 250 | "to all collapsibles."); |
2182 | 251 | }); | 251 | }); |
2183 | @@ -279,9 +279,9 @@ | |||
2184 | 279 | this.container.appendChild(new_collapsible); | 279 | this.container.appendChild(new_collapsible); |
2185 | 280 | Y.lp.activate_collapsibles(); | 280 | Y.lp.activate_collapsibles(); |
2186 | 281 | 281 | ||
2188 | 282 | var collapsible = this.container.query('.collapsible'); | 282 | var collapsible = this.container.one('.collapsible'); |
2189 | 283 | Assert.isNull( | 283 | Assert.isNull( |
2191 | 284 | this.container.query('#should-be-removed'), | 284 | this.container.one('#should-be-removed'), |
2192 | 285 | "The should-be-removed link should have been removed"); | 285 | "The should-be-removed link should have been removed"); |
2193 | 286 | }, | 286 | }, |
2194 | 287 | 287 | ||
2195 | @@ -289,24 +289,24 @@ | |||
2196 | 289 | // If activate_collapsibles() has already been called, calling | 289 | // If activate_collapsibles() has already been called, calling |
2197 | 290 | // it again won't break the existing collapsibles. | 290 | // it again won't break the existing collapsibles. |
2198 | 291 | Y.lp.activate_collapsibles(); | 291 | Y.lp.activate_collapsibles(); |
2202 | 292 | var collapsible = this.container.query('.collapsible'); | 292 | var collapsible = this.container.one('.collapsible'); |
2203 | 293 | var anchor = collapsible.query('a'); | 293 | var anchor = collapsible.one('a'); |
2204 | 294 | var span = anchor.query('span'); | 294 | var span = anchor.one('span'); |
2205 | 295 | var original_span_contents = span.get('innerHTML'); | 295 | var original_span_contents = span.get('innerHTML'); |
2207 | 296 | var wrapper = collapsible.query('.collapseWrapper'); | 296 | var wrapper = collapsible.one('.collapseWrapper'); |
2208 | 297 | var original_wrapper_contents = wrapper.get('innerHTML'); | 297 | var original_wrapper_contents = wrapper.get('innerHTML'); |
2209 | 298 | 298 | ||
2210 | 299 | // Calling activate_collapsibles() shouldn't break things. | 299 | // Calling activate_collapsibles() shouldn't break things. |
2211 | 300 | Y.lp.activate_collapsibles(); | 300 | Y.lp.activate_collapsibles(); |
2216 | 301 | collapsible = this.container.query('.collapsible'); | 301 | collapsible = this.container.one('.collapsible'); |
2217 | 302 | anchor = collapsible.query('a'); | 302 | anchor = collapsible.one('a'); |
2218 | 303 | span = anchor.query('span'); | 303 | span = anchor.one('span'); |
2219 | 304 | wrapper = collapsible.query('.collapseWrapper'); | 304 | wrapper = collapsible.one('.collapseWrapper'); |
2220 | 305 | 305 | ||
2221 | 306 | Assert.isNotNull( | 306 | Assert.isNotNull( |
2222 | 307 | anchor, "Existing collapsibles' anchors should be intact."); | 307 | anchor, "Existing collapsibles' anchors should be intact."); |
2223 | 308 | 308 | ||
2225 | 309 | var icon = anchor.query('img'); | 309 | var icon = anchor.one('img'); |
2226 | 310 | Assert.isNotNull( | 310 | Assert.isNotNull( |
2227 | 311 | icon, | 311 | icon, |
2228 | 312 | "Existing collapsibles' icons should be intact."); | 312 | "Existing collapsibles' icons should be intact."); |
2229 | 313 | 313 | ||
2230 | === modified file 'lib/canonical/launchpad/javascript/registry/milestone_table.js' | |||
2231 | --- lib/canonical/launchpad/javascript/registry/milestone_table.js 2009-06-19 20:35:13 +0000 | |||
2232 | +++ lib/canonical/launchpad/javascript/registry/milestone_table.js 2009-11-18 13:45:26 +0000 | |||
2233 | @@ -101,7 +101,7 @@ | |||
2234 | 101 | "Undefined properties in setup config for milestonetable."); | 101 | "Undefined properties in setup config for milestonetable."); |
2235 | 102 | } | 102 | } |
2236 | 103 | self._milestone_row_uri_template = config.milestone_row_uri_template; | 103 | self._milestone_row_uri_template = config.milestone_row_uri_template; |
2238 | 104 | self._tbody = Y.get(config.milestone_rows_id); | 104 | self._tbody = Y.one(config.milestone_rows_id); |
2239 | 105 | if (self._tbody === null) { | 105 | if (self._tbody === null) { |
2240 | 106 | throw new Error( | 106 | throw new Error( |
2241 | 107 | Y.substitute("'{milestone_rows_id}' not in page.", config)); | 107 | Y.substitute("'{milestone_rows_id}' not in page.", config)); |
2242 | 108 | 108 | ||
2243 | === modified file 'lib/canonical/launchpad/javascript/registry/milestoneoverlay.js' | |||
2244 | --- lib/canonical/launchpad/javascript/registry/milestoneoverlay.js 2009-08-13 13:36:02 +0000 | |||
2245 | +++ lib/canonical/launchpad/javascript/registry/milestoneoverlay.js 2009-11-18 13:45:26 +0000 | |||
2246 | @@ -32,7 +32,7 @@ | |||
2247 | 32 | milestone_form.clearError(); | 32 | milestone_form.clearError(); |
2248 | 33 | milestone_form.hide(); | 33 | milestone_form.hide(); |
2249 | 34 | // Reset the HTML form inside the widget. | 34 | // Reset the HTML form inside the widget. |
2251 | 35 | milestone_form.get('contentBox').query('form').reset(); | 35 | milestone_form.get('contentBox').one('form').reset(); |
2252 | 36 | next_step(parameters); | 36 | next_step(parameters); |
2253 | 37 | }; | 37 | }; |
2254 | 38 | 38 | ||
2255 | @@ -42,7 +42,7 @@ | |||
2256 | 42 | on: { | 42 | on: { |
2257 | 43 | success: finish_new_milestone, | 43 | success: finish_new_milestone, |
2258 | 44 | failure: function (ignore, response, args) { | 44 | failure: function (ignore, response, args) { |
2260 | 45 | var error_box = Y.get('#milestone-error'); | 45 | var error_box = Y.one('#milestone-error'); |
2261 | 46 | var error_message = '<strong>' + response.statusText + | 46 | var error_message = '<strong>' + response.statusText + |
2262 | 47 | '</strong><p>' + | 47 | '</strong><p>' + |
2263 | 48 | response.responseText + | 48 | response.responseText + |
2264 | 49 | 49 | ||
2265 | === modified file 'lib/canonical/launchpad/javascript/registry/tests/test_milestone_table.js' | |||
2266 | --- lib/canonical/launchpad/javascript/registry/tests/test_milestone_table.js 2009-06-19 18:31:25 +0000 | |||
2267 | +++ lib/canonical/launchpad/javascript/registry/tests/test_milestone_table.js 2009-11-18 13:45:26 +0000 | |||
2268 | @@ -21,7 +21,7 @@ | |||
2269 | 21 | }, | 21 | }, |
2270 | 22 | 22 | ||
2271 | 23 | setUp: function() { | 23 | setUp: function() { |
2273 | 24 | this.tbody = Y.get('#milestone-rows'); | 24 | this.tbody = Y.one('#milestone-rows'); |
2274 | 25 | }, | 25 | }, |
2275 | 26 | 26 | ||
2276 | 27 | tearDown: function() { | 27 | tearDown: function() { |
2277 | @@ -71,7 +71,7 @@ | |||
2278 | 71 | name: '_setup_milestone_event_data', | 71 | name: '_setup_milestone_event_data', |
2279 | 72 | 72 | ||
2280 | 73 | setUp: function() { | 73 | setUp: function() { |
2282 | 74 | this.tbody = Y.get('#milestone-rows'); | 74 | this.tbody = Y.one('#milestone-rows'); |
2283 | 75 | }, | 75 | }, |
2284 | 76 | 76 | ||
2285 | 77 | tearDown: function() { | 77 | tearDown: function() { |
2286 | @@ -155,7 +155,7 @@ | |||
2287 | 155 | 155 | ||
2288 | 156 | setUp: function() { | 156 | setUp: function() { |
2289 | 157 | this.data = milestonetable._setup_milestone_event_data( | 157 | this.data = milestonetable._setup_milestone_event_data( |
2291 | 158 | {name: '0.1'}, Y.get('#milestone-rows')); | 158 | {name: '0.1'}, Y.one('#milestone-rows')); |
2292 | 159 | }, | 159 | }, |
2293 | 160 | 160 | ||
2294 | 161 | tearDown: function() { | 161 | tearDown: function() { |
2295 | @@ -181,7 +181,7 @@ | |||
2296 | 181 | this.response = { | 181 | this.response = { |
2297 | 182 | responseText: " <tr><td>" + this.success + "<td></tr> "}; | 182 | responseText: " <tr><td>" + this.success + "<td></tr> "}; |
2298 | 183 | this.data = milestonetable._setup_milestone_event_data( | 183 | this.data = milestonetable._setup_milestone_event_data( |
2300 | 184 | {name: '0.1'}, Y.get('#milestone-rows')); | 184 | {name: '0.1'}, Y.one('#milestone-rows')); |
2301 | 185 | // Needed to reset the DOM. | 185 | // Needed to reset the DOM. |
2302 | 186 | this.table = this.data.tbody.ancestor(); | 186 | this.table = this.data.tbody.ancestor(); |
2303 | 187 | this.tbody_markup = this.table.get('innerHTML'); | 187 | this.tbody_markup = this.table.get('innerHTML'); |
2304 | 188 | 188 | ||
2305 | === modified file 'lib/canonical/launchpad/javascript/registry/tests/timeline.js' | |||
2306 | --- lib/canonical/launchpad/javascript/registry/tests/timeline.js 2009-10-06 22:11:50 +0000 | |||
2307 | +++ lib/canonical/launchpad/javascript/registry/tests/timeline.js 2009-11-18 13:45:26 +0000 | |||
2308 | @@ -76,7 +76,7 @@ | |||
2309 | 76 | */ | 76 | */ |
2310 | 77 | function simulate(widget, selector, evtype, options) { | 77 | function simulate(widget, selector, evtype, options) { |
2311 | 78 | var bounding_box = widget.get('boundingBox'); | 78 | var bounding_box = widget.get('boundingBox'); |
2313 | 79 | var rawnode = Y.Node.getDOMNode(bounding_box.query(selector)); | 79 | var rawnode = Y.Node.getDOMNode(bounding_box.one(selector)); |
2314 | 80 | Y.Event.simulate(rawnode, evtype, options); | 80 | Y.Event.simulate(rawnode, evtype, options); |
2315 | 81 | } | 81 | } |
2316 | 82 | 82 | ||
2317 | @@ -104,24 +104,24 @@ | |||
2318 | 104 | "TimelineGraph was not created."); | 104 | "TimelineGraph was not created."); |
2319 | 105 | 105 | ||
2320 | 106 | Assert.isNotNull( | 106 | Assert.isNotNull( |
2322 | 107 | this.content_box.query('canvas'), | 107 | this.content_box.one('canvas'), |
2323 | 108 | "A canvas should have been created."); | 108 | "A canvas should have been created."); |
2324 | 109 | }, | 109 | }, |
2325 | 110 | 110 | ||
2326 | 111 | test_zoom_buttons: function() { | 111 | test_zoom_buttons: function() { |
2328 | 112 | var zoom_in = this.content_box.query('a.yui-timelinegraph-zoom-in'); | 112 | var zoom_in = this.content_box.one('a.yui-timelinegraph-zoom-in'); |
2329 | 113 | Assert.isNotNull( | 113 | Assert.isNotNull( |
2330 | 114 | zoom_in, | 114 | zoom_in, |
2331 | 115 | 'zoom_in link not found.'); | 115 | 'zoom_in link not found.'); |
2332 | 116 | 116 | ||
2334 | 117 | var zoom_out = this.content_box.query('a.yui-timelinegraph-zoom-out'); | 117 | var zoom_out = this.content_box.one('a.yui-timelinegraph-zoom-out'); |
2335 | 118 | Assert.isNotNull( | 118 | Assert.isNotNull( |
2336 | 119 | zoom_in, | 119 | zoom_in, |
2337 | 120 | 'zoom_out link not found.'); | 120 | 'zoom_out link not found.'); |
2338 | 121 | }, | 121 | }, |
2339 | 122 | 122 | ||
2340 | 123 | test_series_label: function() { | 123 | test_series_label: function() { |
2342 | 124 | var label = this.content_box.query('div#trunk'); | 124 | var label = this.content_box.one('div#trunk'); |
2343 | 125 | Assert.isNotNull( | 125 | Assert.isNotNull( |
2344 | 126 | label, | 126 | label, |
2345 | 127 | "Series label not found."); | 127 | "Series label not found."); |
2346 | @@ -130,7 +130,7 @@ | |||
2347 | 130 | label.get('title'), | 130 | label.get('title'), |
2348 | 131 | "Unexpected series label title."); | 131 | "Unexpected series label title."); |
2349 | 132 | 132 | ||
2351 | 133 | var link = label.query('a'); | 133 | var link = label.one('a'); |
2352 | 134 | Assert.isNotNull( | 134 | Assert.isNotNull( |
2353 | 135 | link, | 135 | link, |
2354 | 136 | "Series label does not contain a link."); | 136 | "Series label does not contain a link."); |
2355 | @@ -163,8 +163,8 @@ | |||
2356 | 163 | }, | 163 | }, |
2357 | 164 | 164 | ||
2358 | 165 | test_milestone_label_second_line: function() { | 165 | test_milestone_label_second_line: function() { |
2361 | 166 | var label = this.content_box.query('div#ski'); | 166 | var label = this.content_box.one('div#ski'); |
2362 | 167 | var second_line = label.query('div'); | 167 | var second_line = label.one('div'); |
2363 | 168 | Assert.areEqual( | 168 | Assert.areEqual( |
2364 | 169 | '2200-05-26', | 169 | '2200-05-26', |
2365 | 170 | second_line.get('innerHTML'), | 170 | second_line.get('innerHTML'), |
2366 | @@ -180,7 +180,7 @@ | |||
2367 | 180 | 'This test must be run in an iframe with id=' + | 180 | 'This test must be run in an iframe with id=' + |
2368 | 181 | this.timeline_graph.resize_frame + '.'); | 181 | this.timeline_graph.resize_frame + '.'); |
2369 | 182 | 182 | ||
2371 | 183 | var canvas = this.content_box.query('canvas'); | 183 | var canvas = this.content_box.one('canvas'); |
2372 | 184 | var first_canvas_height = canvas.get('offsetHeight'); | 184 | var first_canvas_height = canvas.get('offsetHeight'); |
2373 | 185 | Assert.areEqual(1, this.timeline_graph.graph_scale); | 185 | Assert.areEqual(1, this.timeline_graph.graph_scale); |
2374 | 186 | Assert.areEqual( | 186 | Assert.areEqual( |
2375 | @@ -192,7 +192,7 @@ | |||
2376 | 192 | 192 | ||
2377 | 193 | // The canvas is recreated in order to | 193 | // The canvas is recreated in order to |
2378 | 194 | // resize correctly in all browsers. | 194 | // resize correctly in all browsers. |
2380 | 195 | canvas = this.content_box.query('canvas'); | 195 | canvas = this.content_box.one('canvas'); |
2381 | 196 | Assert.areEqual(1.1, this.timeline_graph.graph_scale); | 196 | Assert.areEqual(1.1, this.timeline_graph.graph_scale); |
2382 | 197 | Assert.areEqual( | 197 | Assert.areEqual( |
2383 | 198 | canvas.get('offsetHeight'), frame.height, | 198 | canvas.get('offsetHeight'), frame.height, |
2384 | @@ -204,7 +204,7 @@ | |||
2385 | 204 | simulate( | 204 | simulate( |
2386 | 205 | this.timeline_graph, '.yui-timelinegraph-zoom-out', 'click'); | 205 | this.timeline_graph, '.yui-timelinegraph-zoom-out', 'click'); |
2387 | 206 | 206 | ||
2389 | 207 | canvas = this.content_box.query('canvas'); | 207 | canvas = this.content_box.one('canvas'); |
2390 | 208 | Assert.areEqual(1, this.timeline_graph.graph_scale); | 208 | Assert.areEqual(1, this.timeline_graph.graph_scale); |
2391 | 209 | Assert.areEqual( | 209 | Assert.areEqual( |
2392 | 210 | canvas.get('offsetHeight'), frame.height, | 210 | canvas.get('offsetHeight'), frame.height, |
2393 | @@ -230,7 +230,7 @@ | |||
2394 | 230 | }, | 230 | }, |
2395 | 231 | 231 | ||
2396 | 232 | test_milestone_label: function() { | 232 | test_milestone_label: function() { |
2398 | 233 | var label = this.content_box.query('div#alpha'); | 233 | var label = this.content_box.one('div#alpha'); |
2399 | 234 | Assert.isNotNull( | 234 | Assert.isNotNull( |
2400 | 235 | label, | 235 | label, |
2401 | 236 | "Milestone label not found."); | 236 | "Milestone label not found."); |
2402 | @@ -239,7 +239,7 @@ | |||
2403 | 239 | label.get('title'), | 239 | label.get('title'), |
2404 | 240 | "Unexpected milestone label title."); | 240 | "Unexpected milestone label title."); |
2405 | 241 | 241 | ||
2407 | 242 | var link = label.query('a'); | 242 | var link = label.one('a'); |
2408 | 243 | Assert.isNotNull( | 243 | Assert.isNotNull( |
2409 | 244 | link, | 244 | link, |
2410 | 245 | "Milestone label does not contain a link."); | 245 | "Milestone label does not contain a link."); |
2411 | @@ -253,7 +253,7 @@ | |||
2412 | 253 | link.get('href'), | 253 | link.get('href'), |
2413 | 254 | "Unexpected milestone link href."); | 254 | "Unexpected milestone link href."); |
2414 | 255 | 255 | ||
2416 | 256 | var second_line = label.query('div'); | 256 | var second_line = label.one('div'); |
2417 | 257 | Assert.isNull( | 257 | Assert.isNull( |
2418 | 258 | second_line, | 258 | second_line, |
2419 | 259 | "There should be no second line for landmarks when " + | 259 | "There should be no second line for landmarks when " + |
2420 | 260 | 260 | ||
2421 | === modified file 'lib/canonical/launchpad/javascript/soyuz/archivesubscribers_index.js' | |||
2422 | --- lib/canonical/launchpad/javascript/soyuz/archivesubscribers_index.js 2009-09-29 07:26:40 +0000 | |||
2423 | +++ lib/canonical/launchpad/javascript/soyuz/archivesubscribers_index.js 2009-11-18 13:45:26 +0000 | |||
2424 | @@ -18,22 +18,22 @@ | |||
2425 | 18 | Y.soyuz.setup_archivesubscribers_index = function() { | 18 | Y.soyuz.setup_archivesubscribers_index = function() { |
2426 | 19 | // If there are no errors then we hide the add-subscriber row and | 19 | // If there are no errors then we hide the add-subscriber row and |
2427 | 20 | // potentially the whole table if there are no subscribers. | 20 | // potentially the whole table if there are no subscribers. |
2429 | 21 | if (Y.Lang.isNull(Y.get('p.error.message'))) { | 21 | if (Y.Lang.isNull(Y.one('p.error.message'))) { |
2430 | 22 | 22 | ||
2431 | 23 | // Hide the add-subscriber row. | 23 | // Hide the add-subscriber row. |
2433 | 24 | var add_subscriber_row = Y.get( | 24 | var add_subscriber_row = Y.one( |
2434 | 25 | '#archive-subscribers .add-subscriber'); | 25 | '#archive-subscribers .add-subscriber'); |
2435 | 26 | add_subscriber_row.setStyle('display', 'none'); | 26 | add_subscriber_row.setStyle('display', 'none'); |
2436 | 27 | 27 | ||
2437 | 28 | // If there are no subscribers, then hide the complete section. | 28 | // If there are no subscribers, then hide the complete section. |
2440 | 29 | var subscribers = Y.get('#subscribers'); | 29 | var subscribers = Y.one('#subscribers'); |
2441 | 30 | if (Y.Lang.isObject(Y.get('#no-subscribers'))) { | 30 | if (Y.Lang.isObject(Y.one('#no-subscribers'))) { |
2442 | 31 | subscribers.setStyle('display', 'none'); | 31 | subscribers.setStyle('display', 'none'); |
2443 | 32 | } | 32 | } |
2444 | 33 | } | 33 | } |
2445 | 34 | 34 | ||
2446 | 35 | // Add a link to open the add-subscriber row. | 35 | // Add a link to open the add-subscriber row. |
2448 | 36 | var placeholder = Y.get('#add-subscriber-placeholder'); | 36 | var placeholder = Y.one('#add-subscriber-placeholder'); |
2449 | 37 | placeholder.set( | 37 | placeholder.set( |
2450 | 38 | 'innerHTML', | 38 | 'innerHTML', |
2451 | 39 | '<a class="js-action sprite add" href="#">Add access</a>'); | 39 | '<a class="js-action sprite add" href="#">Add access</a>'); |
2452 | 40 | 40 | ||
2453 | === modified file 'lib/canonical/launchpad/javascript/soyuz/lp_dynamic_dom_updater.js' | |||
2454 | --- lib/canonical/launchpad/javascript/soyuz/lp_dynamic_dom_updater.js 2009-06-30 21:06:27 +0000 | |||
2455 | +++ lib/canonical/launchpad/javascript/soyuz/lp_dynamic_dom_updater.js 2009-11-18 13:45:26 +0000 | |||
2456 | @@ -19,7 +19,7 @@ | |||
2457 | 19 | * expected format. | 19 | * expected format. |
2458 | 20 | * | 20 | * |
2459 | 21 | * For example: | 21 | * For example: |
2461 | 22 | * var table = Y.get('table#build-count-table'); | 22 | * var table = Y.one('table#build-count-table'); |
2462 | 23 | * var config = { | 23 | * var config = { |
2463 | 24 | * domUpdateFunction: updateArchiveBuildStatusSummary | 24 | * domUpdateFunction: updateArchiveBuildStatusSummary |
2464 | 25 | * } | 25 | * } |
2465 | @@ -93,7 +93,7 @@ | |||
2466 | 93 | * into a DOM subtree so that it can update itself using an LP api method. | 93 | * into a DOM subtree so that it can update itself using an LP api method. |
2467 | 94 | * | 94 | * |
2468 | 95 | * For example: | 95 | * For example: |
2470 | 96 | * var table = Y.get('table#build-count-table'); | 96 | * var table = Y.one('table#build-count-table'); |
2471 | 97 | * var config = { | 97 | * var config = { |
2472 | 98 | * domUpdateFunction: updateArchiveBuildStatusSummary, | 98 | * domUpdateFunction: updateArchiveBuildStatusSummary, |
2473 | 99 | * uri: LP.client.cache.context.self_link, | 99 | * uri: LP.client.cache.context.self_link, |
2474 | 100 | 100 | ||
2475 | === modified file 'lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.js' | |||
2476 | --- lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.js 2009-09-30 06:40:29 +0000 | |||
2477 | +++ lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.js 2009-11-18 13:45:26 +0000 | |||
2478 | @@ -17,12 +17,12 @@ | |||
2479 | 17 | name: 'add-subscriber', | 17 | name: 'add-subscriber', |
2480 | 18 | 18 | ||
2481 | 19 | setUp: function() { | 19 | setUp: function() { |
2483 | 20 | this.add_subscriber_placeholder = Y.get( | 20 | this.add_subscriber_placeholder = Y.one( |
2484 | 21 | '#add-subscriber-placeholder'); | 21 | '#add-subscriber-placeholder'); |
2489 | 22 | this.archive_subscribers_table_body = Y.get( | 22 | this.archive_subscribers_table_body = Y.one( |
2490 | 23 | '#archive-subscribers').query('tbody'); | 23 | '#archive-subscribers').one('tbody'); |
2491 | 24 | this.error_div = Y.get('#errors'); | 24 | this.error_div = Y.one('#errors'); |
2492 | 25 | this.subscribers_div = Y.get('#subscribers'); | 25 | this.subscribers_div = Y.one('#subscribers'); |
2493 | 26 | 26 | ||
2494 | 27 | 27 | ||
2495 | 28 | // Ensure there are no errors displayed. | 28 | // Ensure there are no errors displayed. |
2496 | @@ -48,7 +48,7 @@ | |||
2497 | 48 | '</tr>' | 48 | '</tr>' |
2498 | 49 | ].join('')); | 49 | ].join('')); |
2499 | 50 | 50 | ||
2501 | 51 | this.add_subscriber_row = Y.get( | 51 | this.add_subscriber_row = Y.one( |
2502 | 52 | '#archive-subscribers .add-subscriber'); | 52 | '#archive-subscribers .add-subscriber'); |
2503 | 53 | }, | 53 | }, |
2504 | 54 | 54 | ||
2505 | @@ -120,7 +120,7 @@ | |||
2506 | 120 | test_click_add_access_displays_add_row: function() { | 120 | test_click_add_access_displays_add_row: function() { |
2507 | 121 | // The add subscriber row is displayed after clicking 'Add access'. | 121 | // The add subscriber row is displayed after clicking 'Add access'. |
2508 | 122 | Y.soyuz.setup_archivesubscribers_index(); | 122 | Y.soyuz.setup_archivesubscribers_index(); |
2510 | 123 | var link_node = this.add_subscriber_placeholder.query('a'); | 123 | var link_node = this.add_subscriber_placeholder.one('a'); |
2511 | 124 | Assert.areEqual( | 124 | Assert.areEqual( |
2512 | 125 | 'Add access', link_node.get('innerHTML')); | 125 | 'Add access', link_node.get('innerHTML')); |
2513 | 126 | 126 | ||
2514 | 127 | 127 | ||
2515 | === modified file 'lib/canonical/launchpad/javascript/soyuz/update_archive_build_statuses.js' | |||
2516 | --- lib/canonical/launchpad/javascript/soyuz/update_archive_build_statuses.js 2009-08-28 16:06:56 +0000 | |||
2517 | +++ lib/canonical/launchpad/javascript/soyuz/update_archive_build_statuses.js 2009-11-18 13:45:26 +0000 | |||
2518 | @@ -36,16 +36,14 @@ | |||
2519 | 36 | * @config domUpdateFunction | 36 | * @config domUpdateFunction |
2520 | 37 | */ | 37 | */ |
2521 | 38 | domUpdateFunction: function(portlet_node, data_object){ | 38 | domUpdateFunction: function(portlet_node, data_object){ |
2522 | 39 | var counter_nodelist = portlet_node.queryAll('.build-count'); | ||
2523 | 40 | |||
2524 | 41 | // For each node of the counter node in the portlet: | 39 | // For each node of the counter node in the portlet: |
2526 | 42 | counter_nodelist.each(function(node){ | 40 | portlet_node.all('.build-count').each(function(node){ |
2527 | 43 | // Check whether the node has a class matching the data name | 41 | // Check whether the node has a class matching the data name |
2528 | 44 | // of the passed in data, and if so, set the innerHTML to | 42 | // of the passed in data, and if so, set the innerHTML to |
2529 | 45 | // the corresponding value. | 43 | // the corresponding value. |
2530 | 46 | Y.each(data_object, function(data_value, data_name){ | 44 | Y.each(data_object, function(data_value, data_name){ |
2531 | 47 | if (node.hasClass(data_name)){ | 45 | if (node.hasClass(data_name)){ |
2533 | 48 | previous_value = node.get("innerHTML"); | 46 | var previous_value = node.get("innerHTML"); |
2534 | 49 | node.set("innerHTML", data_value); | 47 | node.set("innerHTML", data_value); |
2535 | 50 | // If the value changed, just put a quick anim | 48 | // If the value changed, just put a quick anim |
2536 | 51 | // on the parent row. | 49 | // on the parent row. |
2537 | @@ -69,7 +67,7 @@ | |||
2538 | 69 | */ | 67 | */ |
2539 | 70 | stopUpdatesCheckFunction: function(portlet_node){ | 68 | stopUpdatesCheckFunction: function(portlet_node){ |
2540 | 71 | // Stop updating only when there are zero pending builds: | 69 | // Stop updating only when there are zero pending builds: |
2542 | 72 | var pending_elem = portlet_node.query(".pending"); | 70 | var pending_elem = portlet_node.one(".pending"); |
2543 | 73 | if (pending_elem === null){ | 71 | if (pending_elem === null){ |
2544 | 74 | return true; | 72 | return true; |
2545 | 75 | } | 73 | } |
2546 | @@ -85,7 +83,7 @@ | |||
2547 | 85 | Y.on("domready", function(){ | 83 | Y.on("domready", function(){ |
2548 | 86 | // Grab the Archive build count portlet and tell it how to | 84 | // Grab the Archive build count portlet and tell it how to |
2549 | 87 | // update itself: | 85 | // update itself: |
2551 | 88 | var portlet = Y.get('div#build-status-summary'); | 86 | var portlet = Y.one('div#build-status-summary'); |
2552 | 89 | build_summary_portlet_dynamic_update_config.uri = | 87 | build_summary_portlet_dynamic_update_config.uri = |
2553 | 90 | LP.client.cache.context.self_link; | 88 | LP.client.cache.context.self_link; |
2554 | 91 | portlet.plug(Y.lp.DynamicDomUpdater, | 89 | portlet.plug(Y.lp.DynamicDomUpdater, |
2555 | @@ -114,7 +112,7 @@ | |||
2556 | 114 | Y.each(data_object, function(build_summary, source_id){ | 112 | Y.each(data_object, function(build_summary, source_id){ |
2557 | 115 | // Grab the related td element (and fail silently if it doesn't | 113 | // Grab the related td element (and fail silently if it doesn't |
2558 | 116 | // exist). | 114 | // exist). |
2560 | 117 | var td_elem = Y.get("#pubstatus" + source_id); | 115 | var td_elem = Y.one("#pubstatus" + source_id); |
2561 | 118 | if (td_elem === null) { | 116 | if (td_elem === null) { |
2562 | 119 | return; | 117 | return; |
2563 | 120 | } | 118 | } |
2564 | @@ -122,7 +120,7 @@ | |||
2565 | 122 | // We'll need to remember whether we've change the UI so that | 120 | // We'll need to remember whether we've change the UI so that |
2566 | 123 | // we can add a flash at the end if we do: | 121 | // we can add a flash at the end if we do: |
2567 | 124 | var td_ui_changed = false; | 122 | var td_ui_changed = false; |
2569 | 125 | var img_node = td_elem.query('img'); | 123 | var img_node = td_elem.one('img'); |
2570 | 126 | 124 | ||
2571 | 127 | // If the status has changed then we need to update the td | 125 | // If the status has changed then we need to update the td |
2572 | 128 | // element's class and image: | 126 | // element's class and image: |
2573 | @@ -145,12 +143,12 @@ | |||
2574 | 145 | switch(build_summary.status) { | 143 | switch(build_summary.status) { |
2575 | 146 | case 'BUILDING': | 144 | case 'BUILDING': |
2576 | 147 | new_src = '/@@/processing'; | 145 | new_src = '/@@/processing'; |
2578 | 148 | new_title = 'There are some builds currently ' + | 146 | new_title = 'There are some builds currently ' + |
2579 | 149 | 'building.'; | 147 | 'building.'; |
2580 | 150 | break; | 148 | break; |
2581 | 151 | case 'NEEDSBUILD': | 149 | case 'NEEDSBUILD': |
2582 | 152 | new_src = '/@@/build-needed'; | 150 | new_src = '/@@/build-needed'; |
2584 | 153 | new_title = 'There are some builds waiting to ' + | 151 | new_title = 'There are some builds waiting to ' + |
2585 | 154 | 'be built.'; | 152 | 'be built.'; |
2586 | 155 | break; | 153 | break; |
2587 | 156 | case 'FAILEDTOBUILD': | 154 | case 'FAILEDTOBUILD': |
2588 | @@ -215,7 +213,7 @@ | |||
2589 | 215 | }, | 213 | }, |
2590 | 216 | 214 | ||
2591 | 217 | /** | 215 | /** |
2593 | 218 | * This function evaluates the parameters required for the | 216 | * This function evaluates the parameters required for the |
2594 | 219 | * getBuildSummariesForSourceIds api function, using the current | 217 | * getBuildSummariesForSourceIds api function, using the current |
2595 | 220 | * state of the DOM subtree (ie. It finds the ids of builds in the | 218 | * state of the DOM subtree (ie. It finds the ids of builds in the |
2596 | 221 | * subtree that are have a class of either NEEDSBUILD or BUILDING.) | 219 | * subtree that are have a class of either NEEDSBUILD or BUILDING.) |
2597 | @@ -225,14 +223,14 @@ | |||
2598 | 225 | parameterEvaluatorFunction: function(table_node){ | 223 | parameterEvaluatorFunction: function(table_node){ |
2599 | 226 | // Grab all the td's with the class 'build_status' and an additional | 224 | // Grab all the td's with the class 'build_status' and an additional |
2600 | 227 | // class of either 'NEEDSBUILD' or 'BUILDING': | 225 | // class of either 'NEEDSBUILD' or 'BUILDING': |
2603 | 228 | // Note: filter('.NEEDSBUILD, .BUILDING') returns [] | 226 | var td_list = table_node.all('td.build_status'); |
2602 | 229 | var td_list = table_node.queryAll('td.build_status'); | ||
2604 | 230 | var tds_needsbuild = td_list.filter(".NEEDSBUILD"); | 227 | var tds_needsbuild = td_list.filter(".NEEDSBUILD"); |
2605 | 231 | var tds_building = td_list.filter(".BUILDING"); | 228 | var tds_building = td_list.filter(".BUILDING"); |
2606 | 232 | var tds_fullybuilt_pending = td_list.filter(".FULLYBUILT_PENDING"); | 229 | var tds_fullybuilt_pending = td_list.filter(".FULLYBUILT_PENDING"); |
2607 | 233 | 230 | ||
2610 | 234 | if (tds_needsbuild.length === 0 && tds_building.length === 0 && | 231 | if (tds_needsbuild.size() === 0 && |
2611 | 235 | tds_fullybuilt_pending.length === 0) { | 232 | tds_building.size() === 0 && |
2612 | 233 | tds_fullybuilt_pending.size() === 0) { | ||
2613 | 236 | return null; | 234 | return null; |
2614 | 237 | } | 235 | } |
2615 | 238 | 236 | ||
2616 | @@ -259,10 +257,10 @@ | |||
2617 | 259 | */ | 257 | */ |
2618 | 260 | stopUpdatesCheckFunction: function(table_node){ | 258 | stopUpdatesCheckFunction: function(table_node){ |
2619 | 261 | // Stop updating only when there aren't any sources to update: | 259 | // Stop updating only when there aren't any sources to update: |
2624 | 262 | var td_list = table_node.queryAll('td.build_status'); | 260 | var td_list = table_node.all('td.build_status'); |
2625 | 263 | return (td_list.filter(".NEEDSBUILD").length === 0 && | 261 | return (td_list.filter(".NEEDSBUILD").size() === 0 && |
2626 | 264 | td_list.filter(".BUILDING").length === 0 && | 262 | td_list.filter(".BUILDING").size() === 0 && |
2627 | 265 | td_list.filter(".FULLYBUILT_PENDING").length === 0); | 263 | td_list.filter(".FULLYBUILT_PENDING").size() === 0); |
2628 | 266 | } | 264 | } |
2629 | 267 | }; | 265 | }; |
2630 | 268 | 266 | ||
2631 | @@ -273,7 +271,7 @@ | |||
2632 | 273 | // Grab the packages table and tell it how to update itself. | 271 | // Grab the packages table and tell it how to update itself. |
2633 | 274 | // Note: there are situations, such as displaying empty result | 272 | // Note: there are situations, such as displaying empty result |
2634 | 275 | // sets, when the table will not be on the page. | 273 | // sets, when the table will not be on the page. |
2636 | 276 | var table = Y.get('table#packages_list'); | 274 | var table = Y.one('table#packages_list'); |
2637 | 277 | if (table !== null) { | 275 | if (table !== null) { |
2638 | 278 | source_package_table_dynamic_update_config.uri = | 276 | source_package_table_dynamic_update_config.uri = |
2639 | 279 | LP.client.cache.context.self_link; | 277 | LP.client.cache.context.self_link; |
2640 | 280 | 278 | ||
2641 | === modified file 'lib/canonical/launchpad/javascript/translations/translations.js' | |||
2642 | --- lib/canonical/launchpad/javascript/translations/translations.js 2009-10-01 11:10:51 +0000 | |||
2643 | +++ lib/canonical/launchpad/javascript/translations/translations.js 2009-11-18 13:45:26 +0000 | |||
2644 | @@ -103,7 +103,7 @@ | |||
2645 | 103 | table.insertBefore(output, row.next()); | 103 | table.insertBefore(output, row.next()); |
2646 | 104 | 104 | ||
2647 | 105 | var entry_uri = '+imports/' + entry_id; | 105 | var entry_uri = '+imports/' + entry_id; |
2649 | 106 | var div = output.query('div'); | 106 | var div = output.one('div'); |
2650 | 107 | var lp = new LP.client.Launchpad(); | 107 | var lp = new LP.client.Launchpad(); |
2651 | 108 | lp.get(entry_uri, output_loader(div)); | 108 | lp.get(entry_uri, output_loader(div)); |
2652 | 109 | }; | 109 | }; |
2653 | 110 | 110 | ||
2654 | === modified file 'lib/lp/app/templates/base-layout-macros.pt' | |||
2655 | --- lib/lp/app/templates/base-layout-macros.pt 2009-11-10 21:49:38 +0000 | |||
2656 | +++ lib/lp/app/templates/base-layout-macros.pt 2009-11-18 13:45:26 +0000 | |||
2657 | @@ -43,7 +43,7 @@ | |||
2658 | 43 | rooturl modules/canonical.launchpad.webapp.vhosts/allvhosts/configs/mainsite/rooturl; | 43 | rooturl modules/canonical.launchpad.webapp.vhosts/allvhosts/configs/mainsite/rooturl; |
2659 | 44 | icingroot string:${rooturl}+icing/rev${revno}; | 44 | icingroot string:${rooturl}+icing/rev${revno}; |
2660 | 45 | devmode modules/canonical.config/config/devmode; | 45 | devmode modules/canonical.config/config/devmode; |
2662 | 46 | yui string:${icingroot}/yui/3.0.0pr2/build; | 46 | yui string:${icingroot}/yui/current/build; |
2663 | 47 | lazr_js string:${icingroot}/lazr/build; | 47 | lazr_js string:${icingroot}/lazr/build; |
2664 | 48 | lp_js string:${icingroot}/build" | 48 | lp_js string:${icingroot}/build" |
2665 | 49 | > | 49 | > |
2666 | @@ -53,17 +53,45 @@ | |||
2667 | 53 | </tal:comment> | 53 | </tal:comment> |
2668 | 54 | 54 | ||
2669 | 55 | <tal:devmode condition="devmode"> | 55 | <tal:devmode condition="devmode"> |
2672 | 56 | <script type="text/javascript" | 56 | |
2673 | 57 | tal:attributes="src string:${yui}/yui/yui.js"></script> | 57 | <tal:comment replace="nothing"> |
2674 | 58 | Instead of loading the yui.js seed we will load three of it's five | ||
2675 | 59 | sub-components. | ||
2676 | 60 | |||
2677 | 61 | We leave out get.js and loader.js, effectively disabling | ||
2678 | 62 | dynamic loading of modules. | ||
2679 | 63 | |||
2680 | 64 | XXX mars 2009-11-03 | ||
2681 | 65 | To see what modules are missing you have to change yui-base.js to | ||
2682 | 66 | yui-base-debug.js and move the <script/> node outside of this block. | ||
2683 | 67 | |||
2684 | 68 | This will hopefully be fixed in YUI itself. | ||
2685 | 69 | See http://yuilibrary.com/projects/yui3/ticket/2528368 | ||
2686 | 70 | </tal:comment> | ||
2687 | 71 | <script type="text/javascript" | ||
2688 | 72 | tal:attributes="src string:${yui}/yui/yui-base.js"></script> | ||
2689 | 73 | <script type="text/javascript" | ||
2690 | 74 | tal:attributes="src string:${yui}/yui/yui-log.js"></script> | ||
2691 | 75 | <script type="text/javascript" | ||
2692 | 76 | tal:attributes="src string:${yui}/yui/yui-later.js"></script> | ||
2693 | 77 | |||
2694 | 58 | <script type="text/javascript" | 78 | <script type="text/javascript" |
2695 | 59 | tal:attributes="src string:${yui}/oop/oop.js"></script> | 79 | tal:attributes="src string:${yui}/oop/oop.js"></script> |
2696 | 60 | <script type="text/javascript" | 80 | <script type="text/javascript" |
2697 | 61 | tal:attributes="src string:${yui}/event/event.js"></script> | 81 | tal:attributes="src string:${yui}/event/event.js"></script> |
2698 | 62 | <script type="text/javascript" | 82 | <script type="text/javascript" |
2699 | 83 | tal:attributes="src string:${yui}/event-custom/event-custom.js"></script> | ||
2700 | 84 | <script type="text/javascript" | ||
2701 | 85 | tal:attributes="src string:${yui}/event-simulate/event-simulate.js"></script> | ||
2702 | 86 | <script type="text/javascript" | ||
2703 | 63 | tal:attributes="src string:${yui}/dom/dom.js"></script> | 87 | tal:attributes="src string:${yui}/dom/dom.js"></script> |
2704 | 64 | <script type="text/javascript" | 88 | <script type="text/javascript" |
2705 | 65 | tal:attributes="src string:${yui}/node/node.js"></script> | 89 | tal:attributes="src string:${yui}/node/node.js"></script> |
2706 | 66 | <script type="text/javascript" | 90 | <script type="text/javascript" |
2707 | 91 | tal:attributes="src string:${yui}/node-focusmanager/node-focusmanager.js"></script> | ||
2708 | 92 | <script type="text/javascript" | ||
2709 | 93 | tal:attributes="src string:${yui}/node/node-event-simulate.js"></script> | ||
2710 | 94 | <script type="text/javascript" | ||
2711 | 67 | tal:attributes="src string:${yui}/dump/dump.js"></script> | 95 | tal:attributes="src string:${yui}/dump/dump.js"></script> |
2712 | 68 | <script type="text/javascript" | 96 | <script type="text/javascript" |
2713 | 69 | tal:attributes="src string:${yui}/io/io.js"></script> | 97 | tal:attributes="src string:${yui}/io/io.js"></script> |
2714 | @@ -82,6 +110,8 @@ | |||
2715 | 82 | <script type="text/javascript" | 110 | <script type="text/javascript" |
2716 | 83 | tal:attributes="src string:${yui}/plugin/plugin.js"></script> | 111 | tal:attributes="src string:${yui}/plugin/plugin.js"></script> |
2717 | 84 | <script type="text/javascript" | 112 | <script type="text/javascript" |
2718 | 113 | tal:attributes="src string:${yui}/pluginhost/pluginhost.js"></script> | ||
2719 | 114 | <script type="text/javascript" | ||
2720 | 85 | tal:attributes="src string:${yui}/widget/widget.js"></script> | 115 | tal:attributes="src string:${yui}/widget/widget.js"></script> |
2721 | 86 | <script type="text/javascript" | 116 | <script type="text/javascript" |
2722 | 87 | tal:attributes="src string:${yui}/widget/widget-position-ext.js"></script> | 117 | tal:attributes="src string:${yui}/widget/widget-position-ext.js"></script> |
2723 | @@ -267,7 +297,7 @@ | |||
2724 | 267 | revno modules/canonical.launchpad.versioninfo/revno | string:unknown; | 297 | revno modules/canonical.launchpad.versioninfo/revno | string:unknown; |
2725 | 268 | rooturl modules/canonical.launchpad.webapp.vhosts/allvhosts/configs/mainsite/rooturl; | 298 | rooturl modules/canonical.launchpad.webapp.vhosts/allvhosts/configs/mainsite/rooturl; |
2726 | 269 | icingroot string:${rooturl}+icing/rev${revno}; | 299 | icingroot string:${rooturl}+icing/rev${revno}; |
2728 | 270 | yui string:${icingroot}/yui/3.0.0pr2/build; | 300 | yui string:${icingroot}/yui/current/build; |
2729 | 271 | devmode modules/canonical.config/config/devmode"> | 301 | devmode modules/canonical.config/config/devmode"> |
2730 | 272 | <tal:comment replace="nothing"> | 302 | <tal:comment replace="nothing"> |
2731 | 273 | This macro loads the old stylesheet, then the YUI CSS, and finally | 303 | This macro loads the old stylesheet, then the YUI CSS, and finally |
2732 | 274 | 304 | ||
2733 | === modified file 'lib/lp/app/templates/base-layout.pt' | |||
2734 | --- lib/lp/app/templates/base-layout.pt 2009-09-23 10:17:34 +0000 | |||
2735 | +++ lib/lp/app/templates/base-layout.pt 2009-11-18 13:45:26 +0000 | |||
2736 | @@ -24,7 +24,7 @@ | |||
2737 | 24 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | 24 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
2738 | 25 | xml:lang="en" lang="en" dir="ltr"> | 25 | xml:lang="en" lang="en" dir="ltr"> |
2739 | 26 | <head tal:define=" | 26 | <head tal:define=" |
2741 | 27 | yui string:${icingroot}/yui/3.0.0pr2/build; | 27 | yui string:${icingroot}/yui/current/build; |
2742 | 28 | lazr_js string:${icingroot}/lazr/build; | 28 | lazr_js string:${icingroot}/lazr/build; |
2743 | 29 | lp_js string:${icingroot}/build"> | 29 | lp_js string:${icingroot}/build"> |
2744 | 30 | <title tal:content="view/fmt:pagetitle">Page Title</title> | 30 | <title tal:content="view/fmt:pagetitle">Page Title</title> |
2745 | 31 | 31 | ||
2746 | === modified file 'lib/lp/bugs/templates/bug-portlet-subscribers.pt' | |||
2747 | --- lib/lp/bugs/templates/bug-portlet-subscribers.pt 2009-11-05 14:56:01 +0000 | |||
2748 | +++ lib/lp/bugs/templates/bug-portlet-subscribers.pt 2009-11-18 13:45:26 +0000 | |||
2749 | @@ -25,7 +25,7 @@ | |||
2750 | 25 | YUI().use('io-base', 'node', 'bugs.bugtask_index', function(Y) { | 25 | YUI().use('io-base', 'node', 'bugs.bugtask_index', function(Y) { |
2751 | 26 | // Must be done inline here to ensure the load event fires. | 26 | // Must be done inline here to ensure the load event fires. |
2752 | 27 | // This is a work around for a YUI3 issue with event handling. | 27 | // This is a work around for a YUI3 issue with event handling. |
2754 | 28 | var subscription_link = Y.get('.menu-link-subscription'); | 28 | var subscription_link = Y.one('.menu-link-subscription'); |
2755 | 29 | var subscription_link_handler; | 29 | var subscription_link_handler; |
2756 | 30 | if (subscription_link) { | 30 | if (subscription_link) { |
2757 | 31 | subscription_link_handler = subscription_link.on('click', function(e) { | 31 | subscription_link_handler = subscription_link.on('click', function(e) { |
2758 | 32 | 32 | ||
2759 | === modified file 'lib/lp/bugs/templates/bugtarget-portlet-bugfilters.pt' | |||
2760 | --- lib/lp/bugs/templates/bugtarget-portlet-bugfilters.pt 2009-07-17 17:59:07 +0000 | |||
2761 | +++ lib/lp/bugs/templates/bugtarget-portlet-bugfilters.pt 2009-11-18 13:45:25 +0000 | |||
2762 | @@ -14,11 +14,11 @@ | |||
2763 | 14 | <script type="text/javascript"> | 14 | <script type="text/javascript"> |
2764 | 15 | YUI().use('io-base', 'node', function(Y) { | 15 | YUI().use('io-base', 'node', function(Y) { |
2765 | 16 | Y.on('domready', function() { | 16 | Y.on('domready', function() { |
2768 | 17 | var portlet = Y.get('#portlet-bugfilters'); | 17 | var portlet = Y.one('#portlet-bugfilters'); |
2769 | 18 | Y.get('#bugfilters-portlet-spinner').setStyle('display', 'block'); | 18 | Y.one('#bugfilters-portlet-spinner').setStyle('display', 'block'); |
2770 | 19 | 19 | ||
2771 | 20 | function hide_spinner() { | 20 | function hide_spinner() { |
2773 | 21 | Y.get('#bugfilters-portlet-spinner').setStyle('display', 'none'); | 21 | Y.one('#bugfilters-portlet-spinner').setStyle('display', 'none'); |
2774 | 22 | } | 22 | } |
2775 | 23 | 23 | ||
2776 | 24 | function on_success(transactionid, response, arguments) { | 24 | function on_success(transactionid, response, arguments) { |
2777 | @@ -29,7 +29,7 @@ | |||
2778 | 29 | 29 | ||
2779 | 30 | var config = {on: {success: on_success, | 30 | var config = {on: {success: on_success, |
2780 | 31 | failure: hide_spinner}}; | 31 | failure: hide_spinner}}; |
2782 | 32 | var url = Y.get('#bugtarget-bugfilters-link').getAttribute('href'); | 32 | var url = Y.one('#bugtarget-bugfilters-link').getAttribute('href'); |
2783 | 33 | var request = Y.io(url, config); | 33 | var request = Y.io(url, config); |
2784 | 34 | }); | 34 | }); |
2785 | 35 | }); | 35 | }); |
2786 | 36 | 36 | ||
2787 | === modified file 'lib/lp/bugs/templates/bugtarget-portlet-bugtags.pt' | |||
2788 | --- lib/lp/bugs/templates/bugtarget-portlet-bugtags.pt 2009-09-13 20:39:15 +0000 | |||
2789 | +++ lib/lp/bugs/templates/bugtarget-portlet-bugtags.pt 2009-11-18 13:45:26 +0000 | |||
2790 | @@ -11,15 +11,15 @@ | |||
2791 | 11 | <script type="text/javascript"> | 11 | <script type="text/javascript"> |
2792 | 12 | YUI().use('io-base', 'node', function(Y) { | 12 | YUI().use('io-base', 'node', function(Y) { |
2793 | 13 | Y.on('domready', function() { | 13 | Y.on('domready', function() { |
2795 | 14 | Y.get('#tags-portlet-spinner').setStyle('display', 'block'); | 14 | Y.one('#tags-portlet-spinner').setStyle('display', 'block'); |
2796 | 15 | 15 | ||
2797 | 16 | function hide_spinner() { | 16 | function hide_spinner() { |
2799 | 17 | Y.get('#tags-portlet-spinner').setStyle('display', 'none'); | 17 | Y.one('#tags-portlet-spinner').setStyle('display', 'none'); |
2800 | 18 | } | 18 | } |
2801 | 19 | 19 | ||
2802 | 20 | function on_success(transactionid, response, arguments) { | 20 | function on_success(transactionid, response, arguments) { |
2803 | 21 | hide_spinner(); | 21 | hide_spinner(); |
2805 | 22 | var portlet = Y.get('#portlet-tags'); | 22 | var portlet = Y.one('#portlet-tags'); |
2806 | 23 | if (Y.Lang.trim(response.responseText).length == 0) { | 23 | if (Y.Lang.trim(response.responseText).length == 0) { |
2807 | 24 | portlet.setStyle('display', 'none') | 24 | portlet.setStyle('display', 'none') |
2808 | 25 | } | 25 | } |
2809 | @@ -31,7 +31,7 @@ | |||
2810 | 31 | 31 | ||
2811 | 32 | var config = {on: {success: on_success, | 32 | var config = {on: {success: on_success, |
2812 | 33 | failure: hide_spinner}}; | 33 | failure: hide_spinner}}; |
2814 | 34 | var url = Y.get('#tags-content-link').getAttribute('href').replace('bugs.', ''); | 34 | var url = Y.one('#tags-content-link').getAttribute('href').replace('bugs.', ''); |
2815 | 35 | Y.io(url, config); | 35 | Y.io(url, config); |
2816 | 36 | }); | 36 | }); |
2817 | 37 | }); | 37 | }); |
2818 | 38 | 38 | ||
2819 | === modified file 'lib/lp/bugs/templates/bugtask-index.pt' | |||
2820 | --- lib/lp/bugs/templates/bugtask-index.pt 2009-10-28 06:08:11 +0000 | |||
2821 | +++ lib/lp/bugs/templates/bugtask-index.pt 2009-11-18 13:45:26 +0000 | |||
2822 | @@ -157,7 +157,7 @@ | |||
2823 | 157 | // non-JS form, we first disable the link. This is awful and | 157 | // non-JS form, we first disable the link. This is awful and |
2824 | 158 | // must be fixed as soon as YUI3 is fixed. | 158 | // must be fixed as soon as YUI3 is fixed. |
2825 | 159 | if (LP.client.links['me'] !== undefined) { | 159 | if (LP.client.links['me'] !== undefined) { |
2827 | 160 | Y.get('#edit-tags-trigger').on('click', function(e) { | 160 | Y.one('#edit-tags-trigger').on('click', function(e) { |
2828 | 161 | e.halt(); | 161 | e.halt(); |
2829 | 162 | }); | 162 | }); |
2830 | 163 | } | 163 | } |
2831 | 164 | 164 | ||
2832 | === modified file 'lib/lp/code/templates/branch-import-details.pt' | |||
2833 | --- lib/lp/code/templates/branch-import-details.pt 2009-09-15 04:21:59 +0000 | |||
2834 | +++ lib/lp/code/templates/branch-import-details.pt 2009-11-18 13:45:26 +0000 | |||
2835 | @@ -33,7 +33,7 @@ | |||
2836 | 33 | </a> | 33 | </a> |
2837 | 34 | <script type="text/javascript"> | 34 | <script type="text/javascript"> |
2838 | 35 | YUI().use('event', 'node', function(Y) { | 35 | YUI().use('event', 'node', function(Y) { |
2840 | 36 | Y.on("domready", function () { Y.get('#tryagainlink').setStyle('display', 'inline') }); | 36 | Y.on("domready", function () { Y.one('#tryagainlink').setStyle('display', 'inline') }); |
2841 | 37 | }); | 37 | }); |
2842 | 38 | </script> | 38 | </script> |
2843 | 39 | </form> | 39 | </form> |
2844 | 40 | 40 | ||
2845 | === modified file 'lib/lp/code/templates/branch-listing.pt' | |||
2846 | --- lib/lp/code/templates/branch-listing.pt 2009-10-28 23:40:13 +0000 | |||
2847 | +++ lib/lp/code/templates/branch-listing.pt 2009-11-18 13:45:26 +0000 | |||
2848 | @@ -64,7 +64,7 @@ | |||
2849 | 64 | 64 | ||
2850 | 65 | spark_div = branch_sparks[spark_div][0]; | 65 | spark_div = branch_sparks[spark_div][0]; |
2851 | 66 | 66 | ||
2853 | 67 | if (Y.get('#' + spark_div) !== null) { | 67 | if (Y.one('#' + spark_div) !== null) { |
2854 | 68 | json_url = branch_sparks[0][1]; | 68 | json_url = branch_sparks[0][1]; |
2855 | 69 | var container = spark_div; | 69 | var container = spark_div; |
2856 | 70 | var uri = json_url; | 70 | var uri = json_url; |
2857 | 71 | 71 | ||
2858 | === modified file 'lib/lp/code/templates/branch-portlet-subscribers.pt' | |||
2859 | --- lib/lp/code/templates/branch-portlet-subscribers.pt 2009-09-15 03:34:45 +0000 | |||
2860 | +++ lib/lp/code/templates/branch-portlet-subscribers.pt 2009-11-18 13:45:26 +0000 | |||
2861 | @@ -44,7 +44,7 @@ | |||
2862 | 44 | YUI().use('io-base', 'node', 'code.branchsubscription', function(Y) { | 44 | YUI().use('io-base', 'node', 'code.branchsubscription', function(Y) { |
2863 | 45 | 45 | ||
2864 | 46 | if(Y.UA.ie) { | 46 | if(Y.UA.ie) { |
2866 | 47 | Y.get('#subscriber-list').set('innerHTML', | 47 | Y.one('#subscriber-list').set('innerHTML', |
2867 | 48 | 'Could not load subscribers, javascript is disabled.'); | 48 | 'Could not load subscribers, javascript is disabled.'); |
2868 | 49 | return; | 49 | return; |
2869 | 50 | } | 50 | } |
2870 | 51 | 51 | ||
2871 | === modified file 'lib/lp/code/templates/branchmergeproposal-generic-listing.pt' | |||
2872 | --- lib/lp/code/templates/branchmergeproposal-generic-listing.pt 2009-09-16 04:29:55 +0000 | |||
2873 | +++ lib/lp/code/templates/branchmergeproposal-generic-listing.pt 2009-11-18 13:45:26 +0000 | |||
2874 | @@ -27,10 +27,10 @@ | |||
2875 | 27 | YUI().use('node', function(Y) { | 27 | YUI().use('node', function(Y) { |
2876 | 28 | 28 | ||
2877 | 29 | function submit_filter() { | 29 | function submit_filter() { |
2879 | 30 | Y.get('#filter_form').submit(); | 30 | Y.one('#filter_form').submit(); |
2880 | 31 | } | 31 | } |
2881 | 32 | Y.on('domready', function () { | 32 | Y.on('domready', function () { |
2883 | 33 | var field = Y.get("[id=field.status]"); | 33 | var field = Y.one("[id=field.status]"); |
2884 | 34 | field.on('change', submit_filter); | 34 | field.on('change', submit_filter); |
2885 | 35 | }); | 35 | }); |
2886 | 36 | 36 | ||
2887 | 37 | 37 | ||
2888 | === modified file 'lib/lp/registry/templates/distributionsourcepackage-index.pt' | |||
2889 | --- lib/lp/registry/templates/distributionsourcepackage-index.pt 2009-11-07 04:37:23 +0000 | |||
2890 | +++ lib/lp/registry/templates/distributionsourcepackage-index.pt 2009-11-18 13:45:26 +0000 | |||
2891 | @@ -271,11 +271,11 @@ | |||
2892 | 271 | // XXX Michael Nelson 20090702 bug=340497 This slider | 271 | // XXX Michael Nelson 20090702 bug=340497 This slider |
2893 | 272 | // needs an integration test. | 272 | // needs an integration test. |
2894 | 273 | // Collapse the body of the slider widget initially. | 273 | // Collapse the body of the slider widget initially. |
2896 | 274 | Y.get('#related-ppa-versions .widget-bd').addClass('lazr-closed'); | 274 | Y.one('#related-ppa-versions .widget-bd').addClass('lazr-closed'); |
2897 | 275 | 275 | ||
2898 | 276 | // Ensure that the widget header uses the correct sprite icon | 276 | // Ensure that the widget header uses the correct sprite icon |
2899 | 277 | // and gets the styling for javascript actions applied. | 277 | // and gets the styling for javascript actions applied. |
2901 | 278 | var widget_header = Y.get('#related-ppa-versions .widget-hd'); | 278 | var widget_header = Y.one('#related-ppa-versions .widget-hd'); |
2902 | 279 | widget_header.addClass('sprite'); | 279 | widget_header.addClass('sprite'); |
2903 | 280 | widget_header.addClass('treeCollapsed'); | 280 | widget_header.addClass('treeCollapsed'); |
2904 | 281 | widget_header.addClass('js-action'); | 281 | widget_header.addClass('js-action'); |
2905 | 282 | 282 | ||
2906 | === modified file 'lib/lp/registry/templates/object-timeline-graph.pt' | |||
2907 | --- lib/lp/registry/templates/object-timeline-graph.pt 2009-09-28 20:48:08 +0000 | |||
2908 | +++ lib/lp/registry/templates/object-timeline-graph.pt 2009-11-18 13:45:26 +0000 | |||
2909 | @@ -48,7 +48,7 @@ | |||
2910 | 48 | 48 | ||
2911 | 49 | // Don't display graph if there are zero milestones or | 49 | // Don't display graph if there are zero milestones or |
2912 | 50 | // releases. | 50 | // releases. |
2914 | 51 | var container = Y.get('#timeline-container'); | 51 | var container = Y.one('#timeline-container'); |
2915 | 52 | container.setStyle('display', 'block'); | 52 | container.setStyle('display', 'block'); |
2916 | 53 | var config = { | 53 | var config = { |
2917 | 54 | timeline: timeline, | 54 | timeline: timeline, |
2918 | @@ -59,7 +59,7 @@ | |||
2919 | 59 | } | 59 | } |
2920 | 60 | var graph = new Y.registry.timeline.TimelineGraph(config); | 60 | var graph = new Y.registry.timeline.TimelineGraph(config); |
2921 | 61 | graph.render(); | 61 | graph.render(); |
2923 | 62 | Y.get('#spinner').setStyle('display', 'none'); | 62 | Y.one('#spinner').setStyle('display', 'none'); |
2924 | 63 | // Scroll to the most recent milestones or | 63 | // Scroll to the most recent milestones or |
2925 | 64 | // releases on the development focus series. | 64 | // releases on the development focus series. |
2926 | 65 | graph.scroll_to_last_development_focus_landmark(); | 65 | graph.scroll_to_last_development_focus_landmark(); |
2927 | 66 | 66 | ||
2928 | === modified file 'lib/lp/registry/templates/person-macros.pt' | |||
2929 | --- lib/lp/registry/templates/person-macros.pt 2009-09-18 19:31:04 +0000 | |||
2930 | +++ lib/lp/registry/templates/person-macros.pt 2009-11-18 13:45:26 +0000 | |||
2931 | @@ -200,7 +200,7 @@ | |||
2932 | 200 | // XXX: Brad Crittenden 2009-01-30 | 200 | // XXX: Brad Crittenden 2009-01-30 |
2933 | 201 | // bug=http://yuilibrary.com/projects/yui3/ticket/2423101 | 201 | // bug=http://yuilibrary.com/projects/yui3/ticket/2423101 |
2934 | 202 | // Dotted CSS selectors not parsed correctly. Therefore not | 202 | // Dotted CSS selectors not parsed correctly. Therefore not |
2936 | 203 | // using Y.get(). | 203 | // using Y.one(). |
2937 | 204 | var name = document.getElementById('field.name'); | 204 | var name = document.getElementById('field.name'); |
2938 | 205 | name.value = prefix + name.value.replace(/^$private_prefix/, ''); | 205 | name.value = prefix + name.value.replace(/^$private_prefix/, ''); |
2939 | 206 | 206 | ||
2940 | 207 | 207 | ||
2941 | === modified file 'lib/lp/registry/templates/product-new.pt' | |||
2942 | --- lib/lp/registry/templates/product-new.pt 2009-10-01 11:53:27 +0000 | |||
2943 | +++ lib/lp/registry/templates/product-new.pt 2009-11-18 13:45:26 +0000 | |||
2944 | @@ -34,11 +34,11 @@ | |||
2945 | 34 | * XXX BarryWarsaw 12-May-2009 | 34 | * XXX BarryWarsaw 12-May-2009 |
2946 | 35 | * http://yuilibrary.com/projects/yui3/ticket/2423101 | 35 | * http://yuilibrary.com/projects/yui3/ticket/2423101 |
2947 | 36 | * Note that we have to use the more verbose way of getting field.name | 36 | * Note that we have to use the more verbose way of getting field.name |
2949 | 37 | * because Y.get() doesn't like the dots in the Zope field names. | 37 | * because Y.one() doesn't like the dots in the Zope field names. |
2950 | 38 | */ | 38 | */ |
2952 | 39 | var url_field = Y.get(Y.DOM.byId('field.name')); | 39 | var url_field = Y.one(Y.DOM.byId('field.name')); |
2953 | 40 | if (url_field) { | 40 | if (url_field) { |
2955 | 41 | var name_field = Y.get(Y.DOM.byId('field.displayname')); | 41 | var name_field = Y.one(Y.DOM.byId('field.displayname')); |
2956 | 42 | function autofill(e) { | 42 | function autofill(e) { |
2957 | 43 | var name_value = name_field.get('value'); | 43 | var name_value = name_field.get('value'); |
2958 | 44 | if (name_value == '') { | 44 | if (name_value == '') { |
2959 | @@ -110,17 +110,17 @@ | |||
2960 | 110 | } | 110 | } |
2961 | 111 | 111 | ||
2962 | 112 | /* Handle the reveals when there are search results. */ | 112 | /* Handle the reveals when there are search results. */ |
2969 | 113 | var details_buttons = Y.get('#registration-details-buttons'); | 113 | var details_buttons = Y.one('#registration-details-buttons'); |
2970 | 114 | var form_actions = Y.get('#launchpad-form-actions'); | 114 | var form_actions = Y.one('#launchpad-form-actions'); |
2971 | 115 | var form_widgets = Y.get('#launchpad-form-widgets'); | 115 | var form_widgets = Y.one('#launchpad-form-widgets'); |
2972 | 116 | var search_results = Y.get('#search-results'); | 116 | var search_results = Y.one('#search-results'); |
2973 | 117 | var step_title = Y.get('#step-title'); | 117 | var step_title = Y.one('#step-title'); |
2974 | 118 | var title = Y.get('#registration-details-title'); | 118 | var title = Y.one('#registration-details-title'); |
2975 | 119 | 119 | ||
2976 | 120 | /* This is the magic hidden widget used by the MultiStepView. */ | 120 | /* This is the magic hidden widget used by the MultiStepView. */ |
2978 | 121 | var marker = Y.get(Y.DOM.byId('field.__visited_steps__')); | 121 | var marker = Y.one(Y.DOM.byId('field.__visited_steps__')); |
2979 | 122 | 122 | ||
2981 | 123 | var separator = Y.get('#registration-separator'); | 123 | var separator = Y.one('#registration-separator'); |
2982 | 124 | function show_separator(flag) { | 124 | function show_separator(flag) { |
2983 | 125 | if (!separator) { | 125 | if (!separator) { |
2984 | 126 | /* The separator is not on the page, because there were no | 126 | /* The separator is not on the page, because there were no |
2985 | @@ -141,14 +141,14 @@ | |||
2986 | 141 | * to leave the search results there. | 141 | * to leave the search results there. |
2987 | 142 | */ | 142 | */ |
2988 | 143 | function complete_registration(e) { | 143 | function complete_registration(e) { |
2990 | 144 | var expander = Y.get('#search-results-expander'); | 144 | var expander = Y.one('#search-results-expander'); |
2991 | 145 | 145 | ||
2992 | 146 | /* Slide in the search results and hide them under a link. */ | 146 | /* Slide in the search results and hide them under a link. */ |
2993 | 147 | expander.removeClass('unseen'); | 147 | expander.removeClass('unseen'); |
2994 | 148 | expander.on('click', function(e) { | 148 | expander.on('click', function(e) { |
2995 | 149 | e.preventDefault(); | 149 | e.preventDefault(); |
2996 | 150 | 150 | ||
2998 | 151 | var arrow = Y.get('#search-results-arrow'); | 151 | var arrow = Y.one('#search-results-arrow'); |
2999 | 152 | if (arrow.getAttribute('src') == '/@@/treeCollapsed') { | 152 | if (arrow.getAttribute('src') == '/@@/treeCollapsed') { |
3000 | 153 | /* The search results are currently hidden. Slide them | 153 | /* The search results are currently hidden. Slide them |
3001 | 154 | * out and turn the arrow to point downward. | 154 | * out and turn the arrow to point downward. |
3002 | 155 | 155 | ||
3003 | === modified file 'lib/lp/registry/templates/productrelease-add-from-series.pt' | |||
3004 | --- lib/lp/registry/templates/productrelease-add-from-series.pt 2009-09-03 22:35:47 +0000 | |||
3005 | +++ lib/lp/registry/templates/productrelease-add-from-series.pt 2009-11-18 13:45:26 +0000 | |||
3006 | @@ -29,12 +29,12 @@ | |||
3007 | 29 | // to be escaped. | 29 | // to be escaped. |
3008 | 30 | 30 | ||
3009 | 31 | var get_by_id = function(id) { | 31 | var get_by_id = function(id) { |
3011 | 32 | return Y.get(Y.DOM.byId(id)); | 32 | return Y.one(Y.DOM.byId(id)); |
3012 | 33 | }; | 33 | }; |
3013 | 34 | 34 | ||
3014 | 35 | var add_milestone_to_menu = function(parameters) { | 35 | var add_milestone_to_menu = function(parameters) { |
3015 | 36 | var select_menu = get_by_id('field.milestone_for_release'); | 36 | var select_menu = get_by_id('field.milestone_for_release'); |
3017 | 37 | var new_milestone_option = Y.get( | 37 | var new_milestone_option = Y.one( |
3018 | 38 | new Option(parameters.name + '*', parameters.name)); | 38 | new Option(parameters.name + '*', parameters.name)); |
3019 | 39 | select_menu.appendChild(new_milestone_option); | 39 | select_menu.appendChild(new_milestone_option); |
3020 | 40 | var children = select_menu.get('children'); | 40 | var children = select_menu.get('children'); |
3021 | 41 | 41 | ||
3022 | === modified file 'lib/lp/registry/templates/teammembership-index.pt' | |||
3023 | --- lib/lp/registry/templates/teammembership-index.pt 2009-10-08 00:26:50 +0000 | |||
3024 | +++ lib/lp/registry/templates/teammembership-index.pt 2009-11-18 13:45:26 +0000 | |||
3025 | @@ -24,9 +24,9 @@ | |||
3026 | 24 | // Ensure that when the picker is used the radio button switches | 24 | // Ensure that when the picker is used the radio button switches |
3027 | 25 | // from 'Never' to 'On' and the expiry field is enabled. | 25 | // from 'Never' to 'On' and the expiry field is enabled. |
3028 | 26 | Y.on("available", function(e) { | 26 | Y.on("available", function(e) { |
3032 | 27 | var choose_link = Y.get("#expiration-widget a.js-action"); | 27 | var choose_link = Y.one("#expiration-widget a.js-action"); |
3033 | 28 | var radio_on = Y.get("#date"); | 28 | var radio_on = Y.one("#date"); |
3034 | 29 | var expiration_date = Y.get( | 29 | var expiration_date = Y.one( |
3035 | 30 | document.getElementById('membership.expirationdate')); | 30 | document.getElementById('membership.expirationdate')); |
3036 | 31 | choose_link.on('click', function(e) { | 31 | choose_link.on('click', function(e) { |
3037 | 32 | expiration_date.set('disabled', false); | 32 | expiration_date.set('disabled', false); |
3038 | 33 | 33 | ||
3039 | === modified file 'lib/lp/registry/templates/timeline-macros.pt' | |||
3040 | --- lib/lp/registry/templates/timeline-macros.pt 2009-10-02 17:20:49 +0000 | |||
3041 | +++ lib/lp/registry/templates/timeline-macros.pt 2009-11-18 13:45:26 +0000 | |||
3042 | @@ -39,9 +39,9 @@ | |||
3043 | 39 | if (Y.UA.ie) { | 39 | if (Y.UA.ie) { |
3044 | 40 | return; | 40 | return; |
3045 | 41 | } | 41 | } |
3047 | 42 | var loading_el = Y.get('#timeline-loading'); | 42 | var loading_el = Y.one('#timeline-loading'); |
3048 | 43 | loading_el.setStyle('display', 'block'); | 43 | loading_el.setStyle('display', 'block'); |
3050 | 44 | var iframe = Y.get('#timeline-iframe'); | 44 | var iframe = Y.one('#timeline-iframe'); |
3051 | 45 | iframe.set('src', timeline_url); | 45 | iframe.set('src', timeline_url); |
3052 | 46 | Y.on('load', function(e) { | 46 | Y.on('load', function(e) { |
3053 | 47 | loading_el.setStyle('display', 'none'); | 47 | loading_el.setStyle('display', 'none'); |
3054 | 48 | 48 | ||
3055 | === modified file 'lib/lp/soyuz/templates/archive-edit-dependencies.pt' | |||
3056 | --- lib/lp/soyuz/templates/archive-edit-dependencies.pt 2009-10-16 13:20:48 +0000 | |||
3057 | +++ lib/lp/soyuz/templates/archive-edit-dependencies.pt 2009-11-18 13:45:26 +0000 | |||
3058 | @@ -69,7 +69,7 @@ | |||
3059 | 69 | // contained by the label. | 69 | // contained by the label. |
3060 | 70 | function highlight_checked (nodes) { | 70 | function highlight_checked (nodes) { |
3061 | 71 | nodes.each(function(input) { | 71 | nodes.each(function(input) { |
3063 | 72 | var label = Y.get(input.get("parentNode")); | 72 | var label = Y.one(input.get("parentNode")); |
3064 | 73 | if (input.get("checked")) { | 73 | if (input.get("checked")) { |
3065 | 74 | label.setStyle("fontWeight", "bold"); | 74 | label.setStyle("fontWeight", "bold"); |
3066 | 75 | } | 75 | } |
3067 | @@ -79,45 +79,38 @@ | |||
3068 | 79 | }); | 79 | }); |
3069 | 80 | }; | 80 | }; |
3070 | 81 | 81 | ||
3072 | 82 | var main_area = Y.get("#mainarea"); | 82 | var main_area = Y.one("#mainarea"); |
3073 | 83 | 83 | ||
3074 | 84 | // Highlight the selected radio button input on page load. | 84 | // Highlight the selected radio button input on page load. |
3076 | 85 | var inputs = main_area.queryAll("input.highlight-selected"); | 85 | var inputs = main_area.all("input.highlight-selected"); |
3077 | 86 | highlight_checked(inputs); | 86 | highlight_checked(inputs); |
3078 | 87 | 87 | ||
3079 | 88 | // Install signal handlers for all radio-button inputs to | 88 | // Install signal handlers for all radio-button inputs to |
3080 | 89 | // recalculate with options should be highlighted when one of | 89 | // recalculate with options should be highlighted when one of |
3081 | 90 | // them is clicked. | 90 | // them is clicked. |
3089 | 91 | inputs.each(function(input) { | 91 | inputs.on("click", function(e) { |
3090 | 92 | input.on("click", function(e) { | 92 | highlight_checked(inputs); |
3091 | 93 | var main_area = Y.get("#mainarea"); | 93 | }, this); |
3085 | 94 | var inputs = main_area.queryAll("input.highlight-selected"); | ||
3086 | 95 | highlight_checked(inputs); | ||
3087 | 96 | }); | ||
3088 | 97 | }); | ||
3092 | 98 | 94 | ||
3093 | 99 | // Install handlers to decorate selected check-box inputs when | 95 | // Install handlers to decorate selected check-box inputs when |
3094 | 100 | // they get clicked. Selected options text (next sibling) will | 96 | // they get clicked. Selected options text (next sibling) will |
3095 | 101 | // be decorated with 'line-through' style and rendered in | 97 | // be decorated with 'line-through' style and rendered in |
3096 | 102 | // 'red'. Options not selected (or unselected) text will be | 98 | // 'red'. Options not selected (or unselected) text will be |
3097 | 103 | // rendered in 'blue' and without any decoration. | 99 | // rendered in 'blue' and without any decoration. |
3113 | 104 | var inputs = main_area.queryAll("input.line-through-when-checked"); | 100 | main_area.all( |
3114 | 105 | if (inputs) { | 101 | "input.line-through-when-checked").on('click', function(e) { |
3115 | 106 | inputs.each(function(input) { | 102 | var input = e.currentTarget; |
3116 | 107 | input.on("click", function(e) { | 103 | var link = input.next(); |
3117 | 108 | var input = e.currentTarget; | 104 | if (input.get("checked")) { |
3118 | 109 | var link = input.next(); | 105 | link.setStyle("color", "red"); |
3119 | 110 | if (input.get("checked")) { | 106 | link.setStyle("textDecoration", "line-through"); |
3120 | 111 | link.setStyle("color", "red"); | 107 | } |
3121 | 112 | link.setStyle("textDecoration", "line-through"); | 108 | else { |
3122 | 113 | } | 109 | link.setStyle("color", "blue"); |
3123 | 114 | else { | 110 | link.setStyle("textDecoration", "none"); |
3124 | 115 | link.setStyle("color", "blue"); | 111 | } |
3110 | 116 | link.setStyle("textDecoration", "none"); | ||
3111 | 117 | } | ||
3112 | 118 | }); | ||
3125 | 119 | }); | 112 | }); |
3127 | 120 | }; | 113 | }); |
3128 | 121 | }); | 114 | }); |
3129 | 122 | </script> | 115 | </script> |
3130 | 123 | 116 | ||
3131 | 124 | 117 | ||
3132 | === modified file 'lib/lp/soyuz/templates/archive-index.pt' | |||
3133 | --- lib/lp/soyuz/templates/archive-index.pt 2009-09-22 04:06:47 +0000 | |||
3134 | +++ lib/lp/soyuz/templates/archive-index.pt 2009-11-18 13:45:26 +0000 | |||
3135 | @@ -148,11 +148,11 @@ | |||
3136 | 148 | }).use('node', 'event', 'lazr.effects', function(Y) { | 148 | }).use('node', 'event', 'lazr.effects', function(Y) { |
3137 | 149 | 149 | ||
3138 | 150 | // Hide the widget body contents. | 150 | // Hide the widget body contents. |
3140 | 151 | Y.get('#ppa-install .widget-body').addClass('lazr-closed'); | 151 | Y.one('#ppa-install .widget-body').addClass('lazr-closed'); |
3141 | 152 | 152 | ||
3142 | 153 | // Ensure that the widget header uses the correct sprite icon | 153 | // Ensure that the widget header uses the correct sprite icon |
3143 | 154 | // and gets the styling for javascript actions applied. | 154 | // and gets the styling for javascript actions applied. |
3145 | 155 | var widget_header = Y.get('#ppa-install .widget-header'); | 155 | var widget_header = Y.one('#ppa-install .widget-header'); |
3146 | 156 | widget_header.addClass('sprite'); | 156 | widget_header.addClass('sprite'); |
3147 | 157 | widget_header.addClass('treeCollapsed'); | 157 | widget_header.addClass('treeCollapsed'); |
3148 | 158 | widget_header.addClass('js-action'); | 158 | widget_header.addClass('js-action'); |
3149 | 159 | 159 | ||
3150 | === modified file 'lib/lp/soyuz/templates/archive-macros.pt' | |||
3151 | --- lib/lp/soyuz/templates/archive-macros.pt 2009-10-16 11:47:55 +0000 | |||
3152 | +++ lib/lp/soyuz/templates/archive-macros.pt 2009-11-18 13:45:26 +0000 | |||
3153 | @@ -88,14 +88,14 @@ | |||
3154 | 88 | * the expander itself. | 88 | * the expander itself. |
3155 | 89 | */ | 89 | */ |
3156 | 90 | function toggleExpandableRow(expander) { | 90 | function toggleExpandableRow(expander) { |
3159 | 91 | var row = Y.get('#' + expander.get('id').replace('-expander', '')); | 91 | var row = Y.one('#' + expander.get('id').replace('-expander', '')); |
3160 | 92 | var icon = expander.query('img'); | 92 | var icon = expander.one('img'); |
3161 | 93 | 93 | ||
3162 | 94 | var row_display = row.getStyle('display'); | 94 | var row_display = row.getStyle('display'); |
3163 | 95 | if (row_display == 'none') { | 95 | if (row_display == 'none') { |
3164 | 96 | row.setStyle('display', 'table-row'); | 96 | row.setStyle('display', 'table-row'); |
3165 | 97 | icon.set('src', '/@@/treeExpanded'); | 97 | icon.set('src', '/@@/treeExpanded'); |
3167 | 98 | var container = Y.get('#' + row.get('id') + '-container'); | 98 | var container = Y.one('#' + row.get('id') + '-container'); |
3168 | 99 | if (trim(container.get('innerHTML')) == ''){ | 99 | if (trim(container.get('innerHTML')) == ''){ |
3169 | 100 | startUpdate(container); | 100 | startUpdate(container); |
3170 | 101 | } | 101 | } |
3171 | 102 | 102 | ||
3172 | === modified file 'lib/lp/soyuz/templates/archive-packages.pt' | |||
3173 | --- lib/lp/soyuz/templates/archive-packages.pt 2009-09-18 21:00:18 +0000 | |||
3174 | +++ lib/lp/soyuz/templates/archive-packages.pt 2009-11-18 13:45:26 +0000 | |||
3175 | @@ -65,7 +65,7 @@ | |||
3176 | 65 | in_progress_message = Y.soyuz.makeInProgressNode( | 65 | in_progress_message = Y.soyuz.makeInProgressNode( |
3177 | 66 | 'Fetching repository size ...') | 66 | 'Fetching repository size ...') |
3178 | 67 | 67 | ||
3180 | 68 | var container = Y.get('#package-counters'); | 68 | var container = Y.one('#package-counters'); |
3181 | 69 | container.set('innerHTML', ''); | 69 | container.set('innerHTML', ''); |
3182 | 70 | container.appendChild(in_progress_message); | 70 | container.appendChild(in_progress_message); |
3183 | 71 | 71 | ||
3184 | 72 | 72 | ||
3185 | === modified file 'lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py' | |||
3186 | --- lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py 2009-09-29 12:09:39 +0000 | |||
3187 | +++ lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py 2009-11-18 13:45:26 +0000 | |||
3188 | @@ -15,13 +15,11 @@ | |||
3189 | 15 | 15 | ||
3190 | 16 | from canonical.launchpad.ftests import login, logout | 16 | from canonical.launchpad.ftests import login, logout |
3191 | 17 | from canonical.launchpad.windmill.testing.lpuser import LaunchpadUser | 17 | from canonical.launchpad.windmill.testing.lpuser import LaunchpadUser |
3192 | 18 | from canonical.launchpad.windmill.testing import constants | ||
3193 | 18 | from lp.registry.interfaces.distribution import IDistributionSet | 19 | from lp.registry.interfaces.distribution import IDistributionSet |
3194 | 19 | from lp.soyuz.windmill.testing import SoyuzWindmillLayer | 20 | from lp.soyuz.windmill.testing import SoyuzWindmillLayer |
3195 | 20 | from lp.testing import TestCaseWithFactory | 21 | from lp.testing import TestCaseWithFactory |
3196 | 21 | 22 | ||
3197 | 22 | WAIT_PAGELOAD = u'30000' | ||
3198 | 23 | WAIT_ELEMENT_COMPLETE = u'30000' | ||
3199 | 24 | WAIT_CHECK_CHANGE = u'1000' | ||
3200 | 25 | ADD_ACCESS_LINK = u'//a[@class="js-action sprite add"]' | 23 | ADD_ACCESS_LINK = u'//a[@class="js-action sprite add"]' |
3201 | 26 | CHOOSE_SUBSCRIBER_LINK = u'//a[@id="show-widget-field-subscriber"]' | 24 | CHOOSE_SUBSCRIBER_LINK = u'//a[@id="show-widget-field-subscriber"]' |
3202 | 27 | SUBSCRIBER_SEARCH_FIELD = ( | 25 | SUBSCRIBER_SEARCH_FIELD = ( |
3203 | @@ -30,6 +28,7 @@ | |||
3204 | 30 | FIRST_SUBSCRIBER_RESULT = ( | 28 | FIRST_SUBSCRIBER_RESULT = ( |
3205 | 31 | u'//div[@id="yui-pretty-overlay-modal"]' | 29 | u'//div[@id="yui-pretty-overlay-modal"]' |
3206 | 32 | '//span[@class="yui-picker-result-title"]') | 30 | '//span[@class="yui-picker-result-title"]') |
3207 | 31 | MESSAGE_WINDOW = u'//div[@class="informational message"]' | ||
3208 | 33 | 32 | ||
3209 | 34 | 33 | ||
3210 | 35 | class TestArchiveSubscribersIndex(TestCaseWithFactory): | 34 | class TestArchiveSubscribersIndex(TestCaseWithFactory): |
3211 | @@ -59,15 +58,16 @@ | |||
3212 | 59 | def test_add_subscriber(self): | 58 | def test_add_subscriber(self): |
3213 | 60 | """Test adding a private PPA subscriber..""" | 59 | """Test adding a private PPA subscriber..""" |
3214 | 61 | client = WindmillTestClient('Adding private PPA subscribers.') | 60 | client = WindmillTestClient('Adding private PPA subscribers.') |
3216 | 62 | 61 | ||
3217 | 63 | self.lpuser.ensure_login(client) | 62 | self.lpuser.ensure_login(client) |
3218 | 64 | 63 | ||
3219 | 65 | client.open(url='http://launchpad.dev:8085/~joe-bloggs/' | 64 | client.open(url='http://launchpad.dev:8085/~joe-bloggs/' |
3220 | 66 | '+archive/myppa/+subscriptions') | 65 | '+archive/myppa/+subscriptions') |
3222 | 67 | client.waits.forPageLoad(timeout=WAIT_PAGELOAD) | 66 | client.waits.forPageLoad(timeout=constants.PAGE_LOAD) |
3223 | 68 | 67 | ||
3224 | 69 | # Click on the JS add access action. | 68 | # Click on the JS add access action. |
3226 | 70 | client.waits.forElement(xpath=ADD_ACCESS_LINK) | 69 | client.waits.forElement( |
3227 | 70 | xpath=ADD_ACCESS_LINK, timeout=constants.FOR_ELEMENT) | ||
3228 | 71 | client.click(xpath=ADD_ACCESS_LINK) | 71 | client.click(xpath=ADD_ACCESS_LINK) |
3229 | 72 | 72 | ||
3230 | 73 | # Open the picker, search for 'launchpad' and choose the first | 73 | # Open the picker, search for 'launchpad' and choose the first |
3231 | @@ -76,15 +76,18 @@ | |||
3232 | 76 | client.type(xpath=SUBSCRIBER_SEARCH_FIELD, text='launchpad') | 76 | client.type(xpath=SUBSCRIBER_SEARCH_FIELD, text='launchpad') |
3233 | 77 | client.click(xpath=SUBSCRIBER_SEARCH_BUTTON) | 77 | client.click(xpath=SUBSCRIBER_SEARCH_BUTTON) |
3234 | 78 | 78 | ||
3236 | 79 | client.waits.forElement(xpath=FIRST_SUBSCRIBER_RESULT) | 79 | client.waits.forElement( |
3237 | 80 | xpath=FIRST_SUBSCRIBER_RESULT, timeout=constants.FOR_ELEMENT) | ||
3238 | 80 | client.click(xpath=FIRST_SUBSCRIBER_RESULT) | 81 | client.click(xpath=FIRST_SUBSCRIBER_RESULT) |
3239 | 81 | 82 | ||
3240 | 82 | # Add the new subscriber. | 83 | # Add the new subscriber. |
3241 | 83 | client.click(id='field.actions.add') | 84 | client.click(id='field.actions.add') |
3243 | 84 | client.waits.forPageLoad(timeout=WAIT_PAGELOAD) | 85 | client.waits.forPageLoad(timeout=constants.PAGE_LOAD) |
3244 | 85 | 86 | ||
3245 | 86 | # And verify that the correct informational message is displayed. | 87 | # And verify that the correct informational message is displayed. |
3246 | 87 | # It would be nice if we could use ... here. | 88 | # It would be nice if we could use ... here. |
3247 | 89 | client.waits.forElement( | ||
3248 | 90 | xpath=MESSAGE_WINDOW, timeout=constants.FOR_ELEMENT) | ||
3249 | 88 | client.asserts.assertText( | 91 | client.asserts.assertText( |
3250 | 89 | xpath=u'//div[@class="informational message"]', | 92 | xpath=u'//div[@class="informational message"]', |
3251 | 90 | validator='You have granted access for Launchpad Developers ' | 93 | validator='You have granted access for Launchpad Developers ' |
3252 | 91 | 94 | ||
3253 | === modified file 'lib/lp/translations/templates/object-templates.pt' | |||
3254 | --- lib/lp/translations/templates/object-templates.pt 2009-10-22 11:49:30 +0000 | |||
3255 | +++ lib/lp/translations/templates/object-templates.pt 2009-11-18 13:45:26 +0000 | |||
3256 | @@ -35,19 +35,17 @@ | |||
3257 | 35 | } | 35 | } |
3258 | 36 | </style> | 36 | </style> |
3259 | 37 | <script language="JavaScript" type="text/javascript"> | 37 | <script language="JavaScript" type="text/javascript"> |
3261 | 38 | YUI().use('node', function(Y) { | 38 | YUI().use('node-base', 'event-delegate', function(Y) { |
3262 | 39 | Y.on('domready', function(e) { | 39 | Y.on('domready', function(e) { |
3274 | 40 | Y.all('.template_links').addClass('inactive_links'); | 40 | Y.all('#template_table .template_links').addClass('inactive_links'); |
3275 | 41 | var template_rows = Y.all('.template_row'); | 41 | |
3276 | 42 | template_rows.each(function(row) { | 42 | Y.delegate('mouseover', function(e) { |
3277 | 43 | var template_links = row.query('.template_links'); | 43 | this.removeClass('inactive_links'); |
3278 | 44 | row.on('mouseover', function(e) { | 44 | }, '#template_table tbody', '.template_links'); |
3279 | 45 | template_links.removeClass('inactive_links'); | 45 | |
3280 | 46 | }); | 46 | Y.delegate('mouseout', function(e) { |
3281 | 47 | row.on('mouseout', function(e) { | 47 | this.addClass('inactive_links'); |
3282 | 48 | template_links.addClass('inactive_links'); | 48 | }, '#template_table tbody', '.template_links'); |
3272 | 49 | }); | ||
3273 | 50 | }); | ||
3283 | 51 | }); | 49 | }); |
3284 | 52 | }); | 50 | }); |
3285 | 53 | </script> | 51 | </script> |
3286 | 54 | 52 | ||
3287 | === modified file 'lib/lp/translations/templates/pofile-export.pt' | |||
3288 | --- lib/lp/translations/templates/pofile-export.pt 2009-11-06 01:16:21 +0000 | |||
3289 | +++ lib/lp/translations/templates/pofile-export.pt 2009-11-18 13:45:26 +0000 | |||
3290 | @@ -16,9 +16,9 @@ | |||
3291 | 16 | YUI().use('node', 'event', function(Y){ | 16 | YUI().use('node', 'event', function(Y){ |
3292 | 17 | Y.on('domready', function(){ | 17 | Y.on('domready', function(){ |
3293 | 18 | // The pochanged option is only available for the PO format. | 18 | // The pochanged option is only available for the PO format. |
3297 | 19 | var formatlist = Y.get('#div_format select'); | 19 | var formatlist = Y.one('#div_format select'); |
3298 | 20 | var checkbox = Y.get('#div_pochanged input'); | 20 | var checkbox = Y.one('#div_pochanged input'); |
3299 | 21 | var changedtext = Y.get('#div_pochanged span'); | 21 | var changedtext = Y.one('#div_pochanged span'); |
3300 | 22 | function toggle_pochanged() { | 22 | function toggle_pochanged() { |
3301 | 23 | if (formatlist.get('value') == 'PO') { | 23 | if (formatlist.get('value') == 'PO') { |
3302 | 24 | changedtext.removeClass('disabledpochanged'); | 24 | changedtext.removeClass('disabledpochanged'); |
3303 | 25 | 25 | ||
3304 | === modified file 'lib/lp/translations/templates/pofile-translate.pt' | |||
3305 | --- lib/lp/translations/templates/pofile-translate.pt 2009-09-14 16:19:15 +0000 | |||
3306 | +++ lib/lp/translations/templates/pofile-translate.pt 2009-11-18 13:45:26 +0000 | |||
3307 | @@ -38,8 +38,8 @@ | |||
3308 | 38 | } | 38 | } |
3309 | 39 | 39 | ||
3310 | 40 | var updateNotificationBox = function(e) { | 40 | var updateNotificationBox = function(e) { |
3313 | 41 | var notice = Y.get('.important-notice-container'); | 41 | var notice = Y.one('.important-notice-container'); |
3314 | 42 | var balloon = notice.query('.important-notice-balloon'); | 42 | var balloon = notice.one('.important-notice-balloon'); |
3315 | 43 | var dismiss_notice_cookie = ('translation-docs-for-' + | 43 | var dismiss_notice_cookie = ('translation-docs-for-' + |
3316 | 44 | documentation_cookie); | 44 | documentation_cookie); |
3317 | 45 | 45 | ||
3318 | @@ -50,7 +50,7 @@ | |||
3319 | 50 | notice.setStyle('display', 'none'); | 50 | notice.setStyle('display', 'none'); |
3320 | 51 | } | 51 | } |
3321 | 52 | 52 | ||
3323 | 53 | var cancel_button = notice.query( | 53 | var cancel_button = notice.one( |
3324 | 54 | '.important-notice-cancel-button'); | 54 | '.important-notice-cancel-button'); |
3325 | 55 | // Cancel button starts out hidden. If user has JavaScript, | 55 | // Cancel button starts out hidden. If user has JavaScript, |
3326 | 56 | // then we want to show it. | 56 | // then we want to show it. |
3327 | 57 | 57 | ||
3328 | === modified file 'lib/lp/translations/templates/translationimportqueueentry-index.pt' | |||
3329 | --- lib/lp/translations/templates/translationimportqueueentry-index.pt 2009-09-01 12:09:27 +0000 | |||
3330 | +++ lib/lp/translations/templates/translationimportqueueentry-index.pt 2009-11-18 13:45:26 +0000 | |||
3331 | @@ -29,7 +29,7 @@ | |||
3332 | 29 | function getElemById(elem_id) { | 29 | function getElemById(elem_id) { |
3333 | 30 | // XXX 'elem_id' is a Zope form field, and triggers | 30 | // XXX 'elem_id' is a Zope form field, and triggers |
3334 | 31 | // YUI bug #2423101. We'll work around it. | 31 | // YUI bug #2423101. We'll work around it. |
3336 | 32 | return Y.get(Y.DOM.byId(elem_id)); | 32 | return Y.one(Y.DOM.byId(elem_id)); |
3337 | 33 | } | 33 | } |
3338 | 34 | 34 | ||
3339 | 35 | function getEnclosingTR(fieldname) { | 35 | function getEnclosingTR(fieldname) { |
3340 | 36 | 36 | ||
3341 | === modified file 'setup.py' | |||
3342 | --- setup.py 2009-10-31 12:07:16 +0000 | |||
3343 | +++ setup.py 2009-11-18 13:45:26 +0000 | |||
3344 | @@ -27,6 +27,7 @@ | |||
3345 | 27 | 'bzr', | 27 | 'bzr', |
3346 | 28 | 'chameleon.core', | 28 | 'chameleon.core', |
3347 | 29 | 'chameleon.zpt', | 29 | 'chameleon.zpt', |
3348 | 30 | 'cssutils', | ||
3349 | 30 | 'feedvalidator', | 31 | 'feedvalidator', |
3350 | 31 | 'funkload', | 32 | 'funkload', |
3351 | 32 | 'launchpadlib', | 33 | 'launchpadlib', |
3352 | @@ -37,6 +38,7 @@ | |||
3353 | 37 | 'lazr.lifecycle', | 38 | 'lazr.lifecycle', |
3354 | 38 | 'lazr.restful', | 39 | 'lazr.restful', |
3355 | 39 | 'lazr.smtptest', | 40 | 'lazr.smtptest', |
3356 | 41 | 'lazr.testing', | ||
3357 | 40 | 'lazr.uri', | 42 | 'lazr.uri', |
3358 | 41 | 'lazr-js', | 43 | 'lazr-js', |
3359 | 42 | 'mechanize', | 44 | 'mechanize', |
3360 | 43 | 45 | ||
3361 | === modified file 'versions.cfg' | |||
3362 | --- versions.cfg 2009-11-17 20:34:27 +0000 | |||
3363 | +++ versions.cfg 2009-11-18 13:45:26 +0000 | |||
3364 | @@ -11,6 +11,7 @@ | |||
3365 | 11 | chameleon.core = 1.0b35 | 11 | chameleon.core = 1.0b35 |
3366 | 12 | chameleon.zpt = 1.0b17 | 12 | chameleon.zpt = 1.0b17 |
3367 | 13 | ClientForm = 0.2.10 | 13 | ClientForm = 0.2.10 |
3368 | 14 | cssutils = 0.9.6 | ||
3369 | 14 | # Required by Windmill to run on 2.4 | 15 | # Required by Windmill to run on 2.4 |
3370 | 15 | ctypes = 1.0.2 | 16 | ctypes = 1.0.2 |
3371 | 16 | docutils = 0.5 | 17 | docutils = 0.5 |
3372 | @@ -32,8 +33,9 @@ | |||
3373 | 32 | lazr.restful = 0.9.17 | 33 | lazr.restful = 0.9.17 |
3374 | 33 | lazr.restfulclient = 0.9.10 | 34 | lazr.restfulclient = 0.9.10 |
3375 | 34 | lazr.smtptest = 1.1 | 35 | lazr.smtptest = 1.1 |
3376 | 36 | lazr.testing = 0.1.1 | ||
3377 | 35 | lazr.uri = 1.0.2 | 37 | lazr.uri = 1.0.2 |
3379 | 36 | lazr-js = 0.9.1 | 38 | lazr-js = 0.9dev-r153 |
3380 | 37 | martian = 0.11 | 39 | martian = 0.11 |
3381 | 38 | mechanize = 0.1.11 | 40 | mechanize = 0.1.11 |
3382 | 39 | mocker = 0.10.1 | 41 | mocker = 0.10.1 |
Hi,
This branch upgrades Launchpad's JavaScript from YUI 3 PR2 to YUI 3.0.0 final.
The branch has a few windmill errors, so it should not be merged quite yet. However, the diff is large, so it is probably in everyone's best interest to review it before it grows more.
There are some changes to the underlying build system that need to be reverted before submission, such as the changes to setup.py, buildout.cfg, etc.