Merge lp:~mars/launchpad/yui-3final-upgrade into lp:launchpad/db-devel

Proposed by Māris Fogels
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
Reviewer Review Type Date Requested Status
Francis J. Lacoste (community) code Approve
Review via email: mp+14838@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Māris Fogels (mars) wrote :

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.

Revision history for this message
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>

0> === modified file 'Makefile'0> === modified file 'Makefile'
11
2> + # We absolutely do not want to include the testing module and its2> + # We absolutely do not want to include the testing module and its
3> + # jsTestDriver test harness hacks. They fiddle with built-in functions!3> + # jsTestDriver test harness hacks. They fiddle with built-in functions!
4> + ${SHHH} bin/jsbuild $(JSFLAGS) -b $(LAZR_BUILT_JS_ROOT) -x testing/4> + ${SHHH} bin/jsbuild $(JSFLAGS) -b $(LAZR_BUILT_JS_ROOT) -x testing/
55
6Please update this comment to make it obvious that this is excluded6Please update this comment to make it obvious that this is excluded
7from the _production roll-ups_.7from the _production roll-ups_.
88
9Also, once landed investigate if the jsTestDriver infrastructure can9Also, once landed investigate if the jsTestDriver infrastructure can
10still be used from within Launchpad to run unit tests. If that's not10still be used from within Launchpad to run unit tests. If that's not
11the case, file a bug to fix it soon.11the case, file a bug to fix it soon.
1212
13> === modified file 'buildout.cfg'13> === modified file 'buildout.cfg'
14> --- buildout.cfg 2009-10-26 13:49:11 +000014> --- buildout.cfg 2009-10-26 13:49:11 +0000
15> +++ buildout.cfg 2009-11-13 15:45:29 +000015> +++ buildout.cfg 2009-11-13 15:45:29 +0000
16> @@ -16,7 +16,7 @@16> @@ -16,7 +16,7 @@
17> # dependencies *other* than those in our download-cache. Once you have the17> # dependencies *other* than those in our download-cache. Once you have the
18> # desired software, reenable this option (and check in the new software to18> # desired software, reenable this option (and check in the new software to
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.)
20> -install-from-cache = true20> -install-from-cache = true
21> +#install-from-cache = true21> +#install-from-cache = true
22> 22>
23> # This also will need to be temporarily disabled or changed for package23> # This also will need to be temporarily disabled or changed for package
24> # upgrades. Newly-added packages should also add their desired version number24> # upgrades. Newly-added packages should also add their desired version number
2525
26This should be reverted.26This should be reverted.
2727
28> === modified file 'lib/canonical/launchpad/javascript/bugs/bugtask-index.js'28> === modified file 'lib/canonical/launchpad/javascript/bugs/bugtask-index.js'
29> + update_dupe_link.on('click', function(e){29> + update_dupe_link.on('click', function(e){
30> // Only go ahead if we have received the form content by the30> // Only go ahead if we have received the form content by the
31> // time the user clicks:31> // time the user clicks:
32> if (duplicate_form_overlay){32> if (duplicate_form_overlay){
3333
34Missing a space between function(e) and {34Missing a space between function(e) and {
3535
3636
37> === modified file 'versions.cfg'37> === modified file 'versions.cfg'
38> --- versions.cfg 2009-11-10 14:41:33 +000038> --- versions.cfg 2009-11-10 14:41:33 +0000
39> +++ versions.cfg 2009-11-13 15:45:29 +000039> +++ versions.cfg 2009-11-13 15:45:29 +0000
40> @@ -32,8 +32,9 @@40> @@ -32,8 +32,9 @@
41> lazr.restful = 0.9.1741> lazr.restful = 0.9.17
42> lazr.restfulclient = 0.9.1042> lazr.restfulclient = 0.9.10
43> lazr.smtptest = 1.143> lazr.smtptest = 1.1
44> +lazr.testing = 0.1.144> +lazr.testing = 0.1.1
45> lazr.uri = 1.0.245> lazr.uri = 1.0.2
46> -lazr-js = 0.9.146> -lazr-js = 0.9.1
47> +lazr-js = 0.9DEV47> +lazr-js = 0.9DEV
48> martian = 0.1148> martian = 0.11
49> mechanize = 0.1.7b49> mechanize = 0.1.7b
50> mocker = 0.10.150> mocker = 0.10.1
51> 51>
5252
53We'll need to add a sdist matching the correct larzr-js revision that we want53We'll need to add a sdist matching the correct larzr-js revision that we want
54to use.54to use.
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile'
--- Makefile 2009-11-17 13:14:18 +0000
+++ Makefile 2009-11-18 13:45:26 +0000
@@ -17,6 +17,7 @@
1717
18LPCONFIG=development18LPCONFIG=development
1919
20JSFLAGS=
20LP_BUILT_JS_ROOT=lib/canonical/launchpad/icing/build21LP_BUILT_JS_ROOT=lib/canonical/launchpad/icing/build
21LAZR_BUILT_JS_ROOT=lazr-js/build22LAZR_BUILT_JS_ROOT=lazr-js/build
2223
@@ -124,12 +125,17 @@
124build: $(BZR_VERSION_INFO) compile apidoc jsbuild125build: $(BZR_VERSION_INFO) compile apidoc jsbuild
125126
126jsbuild_lazr:127jsbuild_lazr:
127 ${SHHH} bin/jsbuild -b lazr-js/build128 # We absolutely do not want to include the lazr.testing module and its
129 # jsTestDriver test harness modifications in the lazr.js and launchpad.js
130 # roll-up files. They fiddle with built-in functions! See Bug 482340.
131 ${SHHH} bin/jsbuild $(JSFLAGS) -b $(LAZR_BUILT_JS_ROOT) -x testing/
128132
129jsbuild: jsbuild_lazr133jsbuild: jsbuild_lazr
130 ${SHHH} bin/jsbuild \134 ${SHHH} bin/jsbuild \
131 -n launchpad -s lib/canonical/launchpad/javascript \135 $(JSFLAGS) \
132 -b lib/canonical/launchpad/icing/build \136 -n launchpad \
137 -s lib/canonical/launchpad/javascript \
138 -b $(LP_BUILT_JS_ROOT) \
133 lib/canonical/launchpad/icing/MochiKit.js \139 lib/canonical/launchpad/icing/MochiKit.js \
134 $(shell $(HERE)/utilities/yui-deps.py) \140 $(shell $(HERE)/utilities/yui-deps.py) \
135 lib/canonical/launchpad/icing/lazr/build/lazr.js141 lib/canonical/launchpad/icing/lazr/build/lazr.js
136142
=== added symlink 'lib/canonical/launchpad/icing/lazr'
=== target is u'../../../../lazr-js'
=== removed symlink 'lib/canonical/launchpad/icing/lazr'
=== target was u'../../../../lazr-js'
=== added symlink 'lib/canonical/launchpad/icing/yui'
=== target is u'../../../../lazr-js/build/yui'
=== removed symlink 'lib/canonical/launchpad/icing/yui'
=== target was u'../../../../lazr-js/build/yui'
=== modified file 'lib/canonical/launchpad/javascript/bugs/bug_tags_entry.js'
--- lib/canonical/launchpad/javascript/bugs/bug_tags_entry.js 2009-07-17 18:46:25 +0000
+++ lib/canonical/launchpad/javascript/bugs/bug_tags_entry.js 2009-11-18 13:45:26 +0000
@@ -42,12 +42,11 @@
42 */42 */
43var populate_tags_input = function() {43var populate_tags_input = function() {
44 var tags = [];44 var tags = [];
45 var anchors = tag_list_span.queryAll(A);45
46 if (anchors != null) {46 tag_list_span.all(A).each(function(anchor) {
47 tag_list_span.queryAll(A).each(function(a) {47 tags.push(anchor.get(INNER_HTML));
48 tags.push(a.get(INNER_HTML));48 });
49 });49
50 }
51 tag_input.set(VALUE, tags.join(' ') + ' ');50 tag_input.set(VALUE, tags.join(' ') + ' ');
52};51};
5352
@@ -68,7 +67,7 @@
68 function(elem) { return elem != ''; });67 function(elem) { return elem != ''; });
69 var bug = new LP.client.Entry(68 var bug = new LP.client.Entry(
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);
71 bug.removeAtt('http_etag');70 bug.removeAttr('http_etag');
72 bug.set('tags', tags);71 bug.set('tags', tags);
73 tags_edit_spinner.setStyle(DISPLAY, INLINE);72 tags_edit_spinner.setStyle(DISPLAY, INLINE);
74 ok_button.setStyle(DISPLAY, NONE);73 ok_button.setStyle(DISPLAY, NONE);
@@ -104,10 +103,10 @@
104 tags_edit_spinner.setStyle(DISPLAY, NONE);103 tags_edit_spinner.setStyle(DISPLAY, NONE);
105 Y.lazr.anim.green_flash({ node: tag_list_span }).run();104 Y.lazr.anim.green_flash({ node: tag_list_span }).run();
106 if (Y.Lang.trim(tags_html) == '') {105 if (Y.Lang.trim(tags_html) == '') {
107 Y.get('#bug-tags').removeClass(TAGS_SHOW);106 Y.one('#bug-tags').removeClass(TAGS_SHOW);
108 Y.get('#bug-tags').addClass(TAGS_HIDE);107 Y.one('#bug-tags').addClass(TAGS_HIDE);
109 Y.get('#add-bug-tags').removeClass(TAGS_HIDE);108 Y.one('#add-bug-tags').removeClass(TAGS_HIDE);
110 Y.get('#add-bug-tags').addClass(TAGS_SHOW);109 Y.one('#add-bug-tags').addClass(TAGS_SHOW);
111 }110 }
112 },111 },
113 failure: function(id, request) {112 failure: function(id, request) {
@@ -132,10 +131,10 @@
132 autocomplete.hide()131 autocomplete.hide()
133 Y.lazr.anim.red_flash({ node: tag_list_span }).run();132 Y.lazr.anim.red_flash({ node: tag_list_span }).run();
134 if (Y.Lang.trim(tag_list_span.get('innerHTML')) == '') {133 if (Y.Lang.trim(tag_list_span.get('innerHTML')) == '') {
135 Y.get('#bug-tags').removeClass(TAGS_SHOW);134 Y.one('#bug-tags').removeClass(TAGS_SHOW);
136 Y.get('#bug-tags').addClass(TAGS_HIDE);135 Y.one('#bug-tags').addClass(TAGS_HIDE);
137 Y.get('#add-bug-tags').removeClass(TAGS_HIDE);136 Y.one('#add-bug-tags').removeClass(TAGS_HIDE);
138 Y.get('#add-bug-tags').addClass(TAGS_SHOW);137 Y.one('#add-bug-tags').addClass(TAGS_SHOW);
139 }138 }
140};139};
141140
@@ -164,15 +163,15 @@
164 if (LP.client.links['me'] === undefined) { return; }163 if (LP.client.links['me'] === undefined) { return; }
165164
166 available_tags = Y.Array(available_official_tags);165 available_tags = Y.Array(available_official_tags);
167 bug_tags_div = Y.get('#bug-tags');166 bug_tags_div = Y.one('#bug-tags');
168 edit_tags_trigger = bug_tags_div.query('#edit-tags-trigger');167 edit_tags_trigger = bug_tags_div.one('#edit-tags-trigger');
169 add_tags_trigger = Y.get('#add-tags-trigger');168 add_tags_trigger = Y.one('#add-tags-trigger');
170 tag_list_span = bug_tags_div.query('#tag-list');169 tag_list_span = bug_tags_div.one('#tag-list');
171 tag_input = bug_tags_div.query('#tag-input');170 tag_input = bug_tags_div.one('#tag-input');
172 ok_button = bug_tags_div.query('#edit-tags-ok');171 ok_button = bug_tags_div.one('#edit-tags-ok');
173 cancel_button = bug_tags_div.query('#edit-tags-cancel');172 cancel_button = bug_tags_div.one('#edit-tags-cancel');
174 tags_edit_spinner = bug_tags_div.query('#tags-edit-spinner');173 tags_edit_spinner = bug_tags_div.one('#tags-edit-spinner');
175 tags_form = bug_tags_div.query('#tags-form');174 tags_form = bug_tags_div.one('#tags-form');
176175
177 edit_tags_trigger.on('click', function(e) {176 edit_tags_trigger.on('click', function(e) {
178 e.halt();177 e.halt();
@@ -181,10 +180,10 @@
181180
182 add_tags_trigger.on('click', function(e) {181 add_tags_trigger.on('click', function(e) {
183 e.halt();182 e.halt();
184 Y.get('#bug-tags').removeClass(TAGS_HIDE);183 Y.one('#bug-tags').removeClass(TAGS_HIDE);
185 Y.get('#bug-tags').addClass(TAGS_SHOW);184 Y.one('#bug-tags').addClass(TAGS_SHOW);
186 Y.get('#add-bug-tags').removeClass(TAGS_SHOW);185 Y.one('#add-bug-tags').removeClass(TAGS_SHOW);
187 Y.get('#add-bug-tags').addClass(TAGS_HIDE);186 Y.one('#add-bug-tags').addClass(TAGS_HIDE);
188 edit();187 edit();
189 });188 });
190189
191190
=== modified file 'lib/canonical/launchpad/javascript/bugs/bugtask-index.js'
--- lib/canonical/launchpad/javascript/bugs/bugtask-index.js 2009-11-14 21:14:40 +0000
+++ lib/canonical/launchpad/javascript/bugs/bugtask-index.js 2009-11-18 13:45:26 +0000
@@ -85,21 +85,21 @@
85Y.bugs.portlet.subscribe('bugs:nameloaded', function(subscription) {85Y.bugs.portlet.subscribe('bugs:nameloaded', function(subscription) {
86 var error_handler = new LP.client.ErrorHandler();86 var error_handler = new LP.client.ErrorHandler();
87 error_handler.clearProgressUI = function() {87 error_handler.clearProgressUI = function() {
88 var temp_link = Y.get('#temp-username');88 var temp_link = Y.one('#temp-username');
89 if (temp_link) {89 if (temp_link) {
90 var temp_parent = temp_link.get('parentNode');90 var temp_parent = temp_link.get('parentNode');
91 temp_parent.removeChild(temp_link);91 temp_parent.removeChild(temp_link);
92 }92 }
93 };93 };
94 error_handler.showError = function(error_msg) {94 error_handler.showError = function(error_msg) {
95 Y.lp.display_error(Y.get('.menu-link-addsubscriber'), error_msg);95 Y.lp.display_error(Y.one('.menu-link-addsubscriber'), error_msg);
96 };96 };
9797
98 var config = {98 var config = {
99 on: {99 on: {
100 success: function() {100 success: function() {
101 var temp_link = Y.get('#temp-username');101 var temp_link = Y.one('#temp-username');
102 var temp_spinner = Y.get('#temp-name-spinner');102 var temp_spinner = Y.one('#temp-name-spinner');
103 temp_link.removeChild(temp_spinner);103 temp_link.removeChild(temp_spinner);
104 var anim = Y.lazr.anim.green_flash({ node: temp_link });104 var anim = Y.lazr.anim.green_flash({ node: temp_link });
105 anim.on('end', function() {105 anim.on('end', function() {
@@ -136,17 +136,14 @@
136136
137 setup_client_and_bug();137 setup_client_and_bug();
138138
139 // First look for 'Mark as duplicate' links.139 // Look for the 'Mark as duplicate' links or the
140 var update_dupe_links = Y.all('.menu-link-mark-dupe');140 // 'change duplicate bug' link.
141141 var update_dupe_link = Y.one(
142 // If there are none, check for any 'change duplicate bug' links.142 '.menu-link-mark-dupe, #change_duplicate_bug');
143 if (!update_dupe_links){143
144 update_dupe_links = Y.all('#change_duplicate_bug');144 if (update_dupe_link) {
145 }
146
147 if (update_dupe_links) {
148 // First things first, pre-load the mark-dupe form.145 // First things first, pre-load the mark-dupe form.
149 update_dupe_url = update_dupe_links.item(0).getAttribute('href');146 update_dupe_url = update_dupe_link.get('href');
150 var mark_dupe_form_url = update_dupe_url + '/++form++';147 var mark_dupe_form_url = update_dupe_url + '/++form++';
151148
152 duplicate_form_overlay = new Y.lazr.FormOverlay({149 duplicate_form_overlay = new Y.lazr.FormOverlay({
@@ -165,7 +162,7 @@
165162
166 // Add an on-click handler to any links found that displays163 // Add an on-click handler to any links found that displays
167 // the form overlay.164 // the form overlay.
168 update_dupe_links.on('click', function(e){165 update_dupe_link.on('click', function(e) {
169 // Only go ahead if we have received the form content by the166 // Only go ahead if we have received the form content by the
170 // time the user clicks:167 // time the user clicks:
171 if (duplicate_form_overlay){168 if (duplicate_form_overlay){
@@ -174,17 +171,17 @@
174 }171 }
175 });172 });
176 // Add a class denoting them as js-action links.173 // Add a class denoting them as js-action links.
177 update_dupe_links.addClass('js-action');174 update_dupe_link.addClass('js-action');
178 }175 }
179176
180 privacy_link = Y.get('#privacy-link');177 privacy_link = Y.one('#privacy-link');
181178
182 if (privacy_link) {179 if (privacy_link) {
183 var privacy_link_url = privacy_link.getAttribute('href') + '/++form++';180 var privacy_link_url = privacy_link.getAttribute('href') + '/++form++';
184 var privacy_div = Y.get('#privacy-text');181 var privacy_div = Y.one('#privacy-text');
185 var privacy_html = privacy_link.get('innerHTML') + ' ';182 var privacy_html = privacy_link.get('innerHTML') + ' ';
186 privacy_div.set('innerHTML', privacy_html);183 privacy_div.set('innerHTML', privacy_html);
187 var privacy_text = Y.get('#privacy-text');184 var privacy_text = Y.one('#privacy-text');
188 privacy_link = Y.Node.create(185 privacy_link = Y.Node.create(
189 '<a id="privacy-link" class="sprite edit" title="[edit]">' +186 '<a id="privacy-link" class="sprite edit" title="[edit]">' +
190 '<span class="invisible-link">edit</span></a>');187 '<span class="invisible-link">edit</span></a>');
@@ -210,7 +207,7 @@
210 e.preventDefault();207 e.preventDefault();
211 privacy_form_overlay.show();208 privacy_form_overlay.show();
212 // XXX Abel Deuring 2009-04-23, bug 365462209 // XXX Abel Deuring 2009-04-23, bug 365462
213 // Y.get('#field.private') returns null.210 // Y.one('#field.private') returns null.
214 // Seems that YUI does not like IDs containing a '.'211 // Seems that YUI does not like IDs containing a '.'
215 document.getElementById('field.private').focus();212 document.getElementById('field.private').focus();
216 }213 }
@@ -230,7 +227,7 @@
230 * @param e {Object} The event object.227 * @param e {Object} The event object.
231 */228 */
232function clear_picker(e) {229function clear_picker(e) {
233 var input = Y.get('.yui-picker-search-box input');230 var input = Y.one('.yui-picker-search-box input');
234 input.set('value', '');231 input.set('value', '');
235 this.set('error', '');232 this.set('error', '');
236 this.set('results', [{}]);233 this.set('results', [{}]);
@@ -258,7 +255,7 @@
258 picker.on('save', clear_picker, picker);255 picker.on('save', clear_picker, picker);
259 picker.on('cancel', clear_picker, picker);256 picker.on('cancel', clear_picker, picker);
260257
261 var subscription_link_someone_else = Y.get('.menu-link-addsubscriber');258 var subscription_link_someone_else = Y.one('.menu-link-addsubscriber');
262 subscription_link_someone_else.on('click', function(e) {259 subscription_link_someone_else.on('click', function(e) {
263 e.halt();260 e.halt();
264 picker.show();261 picker.show();
@@ -278,8 +275,8 @@
278275
279 setup_client_and_bug();276 setup_client_and_bug();
280 var subscription = new Y.lp.Subscription({277 var subscription = new Y.lp.Subscription({
281 link: Y.get('.menu-link-subscription'),278 link: Y.one('.menu-link-subscription'),
282 spinner: Y.get('#sub-unsub-spinner'),279 spinner: Y.one('#sub-unsub-spinner'),
283 subscriber: new Y.lp.Subscriber({280 subscriber: new Y.lp.Subscriber({
284 uri: LP.client.links.me,281 uri: LP.client.links.me,
285 subscriber_ids: subscriber_ids282 subscriber_ids: subscriber_ids
@@ -333,13 +330,11 @@
333 subscriber_ids: subscriber_ids330 subscriber_ids: subscriber_ids
334 })331 })
335 });332 });
336 var unsubscribe_icons = Y.all('.unsub-icon');333
337 if (unsubscribe_icons) {334 Y.on('click', function(e) {
338 unsubscribe_icons.on('click', function(e) {335 e.halt();
339 e.halt();336 unsubscribe_user_via_icon(e.target, subscription);
340 unsubscribe_user_via_icon(e.target, subscription);337 }, '.unsub-icon');
341 });
342 }
343}338}
344339
345/*340/*
@@ -371,13 +366,13 @@
371 // subscribing can be done inline. Named operations366 // subscribing can be done inline. Named operations
372 // don't return new objects, making the cached bug's367 // don't return new objects, making the cached bug's
373 // etag invalid as well.368 // etag invalid as well.
374 lp_bug_entry.removeAtt('http_etag');369 lp_bug_entry.removeAttr('http_etag');
375370
376 // Hide the formoverlay:371 // Hide the formoverlay:
377 duplicate_form_overlay.hide();372 duplicate_form_overlay.hide();
378373
379 // Add the spinner...374 // Add the spinner...
380 var dupe_span = Y.get('#mark-duplicate-text');375 var dupe_span = Y.one('#mark-duplicate-text');
381 dupe_span.addClass('update-in-progress-message');376 dupe_span.addClass('update-in-progress-message');
382377
383 // Set the new duplicate link on the bug entry.378 // Set the new duplicate link on the bug entry.
@@ -403,22 +398,22 @@
403 'Duplicate of <a>bug #</a> ',398 'Duplicate of <a>bug #</a> ',
404 '<a class="menu-link-mark-dupe js-action sprite edit">',399 '<a class="menu-link-mark-dupe js-action sprite edit">',
405 '<span class="invisible-link">edit</span></a>'].join(""));400 '<span class="invisible-link">edit</span></a>'].join(""));
406 dupe_span.queryAll('a').item(0)401 dupe_span.all('a').item(0)
407 .set('href', '/bugs/' + new_dup_id)402 .set('href', '/bugs/' + new_dup_id)
408 .appendChild(document.createTextNode(new_dup_id));403 .appendChild(document.createTextNode(new_dup_id));
409 dupe_span.queryAll('a').item(1)404 dupe_span.all('a').item(1)
410 .set('href', update_dupe_url);405 .set('href', update_dupe_url);
411 show_comment_on_duplicate_warning();406 show_comment_on_duplicate_warning();
412 } else {407 } else {
413 dupe_span.set('innerHTML', [408 dupe_span.set('innerHTML', [
414 '<a class="menu-link-mark-dupe js-action ',409 '<a class="menu-link-mark-dupe js-action ',
415 'sprite bug-dupe">Mark as duplicate</a>'].join(""));410 'sprite bug-dupe">Mark as duplicate</a>'].join(""));
416 dupe_span.query('a').set('href', update_dupe_url);411 dupe_span.one('a').set('href', update_dupe_url);
417 hide_comment_on_duplicate_warning();412 hide_comment_on_duplicate_warning();
418 }413 }
419 Y.lazr.anim.green_flash({node: dupe_span}).run();414 Y.lazr.anim.green_flash({node: dupe_span}).run();
420 // ensure the new link is hooked up correctly:415 // ensure the new link is hooked up correctly:
421 dupe_span.query('a.menu-link-mark-dupe').on(416 dupe_span.one('a.menu-link-mark-dupe').on(
422 'click', function(e){417 'click', function(e){
423 e.preventDefault();418 e.preventDefault();
424 duplicate_form_overlay.show();419 duplicate_form_overlay.show();
@@ -454,9 +449,9 @@
454 * @method show_comment_on_duplicate_warning449 * @method show_comment_on_duplicate_warning
455 */450 */
456var show_comment_on_duplicate_warning = function() {451var show_comment_on_duplicate_warning = function() {
457 var duplicate_warning = Y.get('#warning-comment-on-duplicate');452 var duplicate_warning = Y.one('#warning-comment-on-duplicate');
458 if (duplicate_warning === null) {453 if (duplicate_warning === null) {
459 var container = Y.get('#add-comment-form');454 var container = Y.one('#add-comment-form');
460 var first_node = container.get('firstChild');455 var first_node = container.get('firstChild');
461 duplicate_warning = Y.Node.create(456 duplicate_warning = Y.Node.create(
462 ['<div class="warning message" id="warning-comment-on-duplicate">',457 ['<div class="warning message" id="warning-comment-on-duplicate">',
@@ -474,7 +469,7 @@
474 * @method hide_comment_on_duplicate_warning469 * @method hide_comment_on_duplicate_warning
475 */470 */
476var hide_comment_on_duplicate_warning = function() {471var hide_comment_on_duplicate_warning = function() {
477 var duplicate_warning = Y.get('#warning-comment-on-duplicate');472 var duplicate_warning = Y.one('#warning-comment-on-duplicate');
478 if (duplicate_warning !== null) {473 if (duplicate_warning !== null) {
479 duplicate_warning.ancestor().removeChild(duplicate_warning);474 duplicate_warning.ancestor().removeChild(duplicate_warning);
480 }475 }
@@ -492,12 +487,12 @@
492 // subscribing can be done inline. Named operations487 // subscribing can be done inline. Named operations
493 // don't return new objects, making the cached bug's488 // don't return new objects, making the cached bug's
494 // etag invalid as well.489 // etag invalid as well.
495 lp_bug_entry.removeAtt('http_etag');490 lp_bug_entry.removeAttr('http_etag');
496491
497 privacy_form_overlay.hide();492 privacy_form_overlay.hide();
498493
499 var privacy_text = Y.get('#privacy-text');494 var privacy_text = Y.one('#privacy-text');
500 var privacy_div = Y.get('#privacy');495 var privacy_div = Y.one('#privacy');
501 privacy_link.setStyle('display', 'none');496 privacy_link.setStyle('display', 'none');
502 privacy_spinner.setStyle('display', 'inline');497 privacy_spinner.setStyle('display', 'inline');
503498
@@ -550,7 +545,7 @@
550 privacy_text.appendChild(privacy_link);545 privacy_text.appendChild(privacy_link);
551 privacy_text.appendChild(privacy_spinner);546 privacy_text.appendChild(privacy_spinner);
552547
553 var security_message = Y.get('#security-message');548 var security_message = Y.one('#security-message');
554 if (security_related) {549 if (security_related) {
555 if (security_message === null) {550 if (security_message === null) {
556 var security_message_html = [551 var security_message_html = [
@@ -591,7 +586,7 @@
591 link_branch_link.toggleClass('update-in-progress-message');586 link_branch_link.toggleClass('update-in-progress-message');
592 };587 };
593 error_handler.showError = function(error_msg) {588 error_handler.showError = function(error_msg) {
594 display_error(Y.get('.menu-link-addsubscriber'), error_msg);589 display_error(Y.one('.menu-link-addsubscriber'), error_msg);
595 };590 };
596591
597 function get_branch_and_link_to_bug(data) {592 function get_branch_and_link_to_bug(data) {
@@ -609,7 +604,7 @@
609 }604 }
610605
611 // Set up the picker itself.606 // Set up the picker itself.
612 link_branch_link = Y.get('.menu-link-addbranch');607 link_branch_link = Y.one('.menu-link-addbranch');
613 if (Y.Lang.isValue(link_branch_link)) {608 if (Y.Lang.isValue(link_branch_link)) {
614 var config = {609 var config = {
615 header: 'Link a related branch',610 header: 'Link a related branch',
@@ -642,7 +637,7 @@
642 link_branch_link.toggleClass('update-in-progress-message');637 link_branch_link.toggleClass('update-in-progress-message');
643 };638 };
644 error_handler.showError = function(error_msg) {639 error_handler.showError = function(error_msg) {
645 display_error(Y.get('.menu-link-addsubscriber'), error_msg);640 display_error(Y.one('.menu-link-addsubscriber'), error_msg);
646 };641 };
647642
648 // Call linkBranch() on the bug.643 // Call linkBranch() on the bug.
@@ -683,21 +678,21 @@
683function add_branch_to_linked_branches(branch_html) {678function add_branch_to_linked_branches(branch_html) {
684 var anim;679 var anim;
685 var bug_branch_node = Y.Node.create(branch_html);680 var bug_branch_node = Y.Node.create(branch_html);
686 var bug_branch_list = Y.get('#bug-branches');681 var bug_branch_list = Y.one('#bug-branches');
687 if (!Y.Lang.isValue(bug_branch_list)) {682 if (!Y.Lang.isValue(bug_branch_list)) {
688 bug_branch_list = Y.Node.create(683 bug_branch_list = Y.Node.create(
689 '<div id="bug-branches">' +684 '<div id="bug-branches">' +
690 ' <h2>Related branches</h2>' +685 ' <h2>Related branches</h2>' +
691 '</div>');686 '</div>');
692687
693 var bug_branch_container = Y.get('#bug-branches-container');688 var bug_branch_container = Y.one('#bug-branches-container');
694 bug_branch_container.appendChild(bug_branch_list);689 bug_branch_container.appendChild(bug_branch_list);
695 anim = Y.lazr.anim.green_flash({node: bug_branch_list});690 anim = Y.lazr.anim.green_flash({node: bug_branch_list});
696 } else {691 } else {
697 anim = Y.lazr.anim.green_flash({node: bug_branch_node});692 anim = Y.lazr.anim.green_flash({node: bug_branch_node});
698 }693 }
699694
700 var existing_bug_branch_node = bug_branch_list.query(695 var existing_bug_branch_node = bug_branch_list.one(
701 '#' + bug_branch_node.getAttribute('id'));696 '#' + bug_branch_node.getAttribute('id'));
702 if (!Y.Lang.isValue(existing_bug_branch_node)) {697 if (!Y.Lang.isValue(existing_bug_branch_node)) {
703 // Only add the bug branch to the page if it isn't there698 // Only add the bug branch to the page if it isn't there
@@ -723,7 +718,7 @@
723 // This should be parent_div.firstChild, but because of #text718 // This should be parent_div.firstChild, but because of #text
724 // and cross-browser issues, using the YUI query syntax is719 // and cross-browser issues, using the YUI query syntax is
725 // safer here.720 // safer here.
726 var user_uri = parent_div.query('a').getAttribute('href');721 var user_uri = parent_div.one('a').getAttribute('href');
727722
728 // Strip the domain off. We just want a path.723 // Strip the domain off. We just want a path.
729 var host_start = user_uri.indexOf('//');724 var host_start = user_uri.indexOf('//');
@@ -769,7 +764,7 @@
769 var html = Y.Node.create('<div><a></a></div>');764 var html = Y.Node.create('<div><a></a></div>');
770 html.addClass(terms.css_name);765 html.addClass(terms.css_name);
771766
772 html.query('a')767 html.one('a')
773 .set('href', '/~' + terms.name)768 .set('href', '/~' + terms.name)
774 .set('name', terms.full_name)769 .set('name', terms.full_name)
775 .set('title', 'Subscribed ' + terms.subscribed_by);770 .set('title', 'Subscribed ' + terms.subscribed_by);
@@ -781,7 +776,7 @@
781 span = '<span class="sprite person"></span>';776 span = '<span class="sprite person"></span>';
782 }777 }
783778
784 html.query('a')779 html.one('a')
785 .appendChild(Y.Node.create(span))780 .appendChild(Y.Node.create(span))
786 .appendChild(document.createTextNode(terms.display_name));781 .appendChild(document.createTextNode(terms.display_name));
787782
@@ -793,7 +788,7 @@
793 icon_html788 icon_html
794 .set('id', 'unsubscribe-' + terms.css_name)789 .set('id', 'unsubscribe-' + terms.css_name)
795 .set('title', 'Unsubscribe ' + terms.full_name);790 .set('title', 'Unsubscribe ' + terms.full_name);
796 icon_html.query('img')791 icon_html.one('img')
797 .set('id', 'unsubscribe-icon-' + terms.css_name);792 .set('id', 'unsubscribe-icon-' + terms.css_name);
798 html.appendChild(icon_html);793 html.appendChild(icon_html);
799 }794 }
@@ -834,15 +829,14 @@
834829
835 // Use the list of subscribers pulled from the DOM to have sortable830 // Use the list of subscribers pulled from the DOM to have sortable
836 // lists of unsubscribable vs. not unsubscribale person links.831 // lists of unsubscribable vs. not unsubscribale person links.
837 var subscribers = Y.get('#subscribers-links');832 var all_subscribers = Y.all('#subscribers-links div');
838 var all_subscribers = subscribers.queryAll('div');833 if (all_subscribers.size() > 0) {
839 if (Y.Lang.isValue(all_subscribers)) {
840 all_subscribers.each(function(sub_link) {834 all_subscribers.each(function(sub_link) {
841 if (sub_link.getAttribute('id') != 'temp-username') {835 if (sub_link.getAttribute('id') != 'temp-username') {
842 // User's displayname is found via the link's "name" attribute.836 // User's displayname is found via the link's "name" attribute.
843 var sub_link_name = sub_link.query('a').getAttribute('name');837 var sub_link_name = sub_link.one('a').getAttribute('name');
844 nodes_by_name[sub_link_name] = sub_link;838 nodes_by_name[sub_link_name] = sub_link;
845 if (sub_link.query('img.unsub-icon')) {839 if (sub_link.one('img.unsub-icon')) {
846 unsubscribables.push(sub_link_name);840 unsubscribables.push(sub_link_name);
847 } else {841 } else {
848 not_unsubscribables.push(sub_link_name);842 not_unsubscribables.push(sub_link_name);
@@ -915,7 +909,7 @@
915function add_user_name_link(subscription) {909function add_user_name_link(subscription) {
916 var person = subscription.get('person');910 var person = subscription.get('person');
917 var link_node = build_user_link_html(subscription);911 var link_node = build_user_link_html(subscription);
918 var subscribers = Y.get('#subscribers-links');912 var subscribers = Y.one('#subscribers-links');
919 if (subscription.is_current_user_subscribing()) {913 if (subscription.is_current_user_subscribing()) {
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.
921 subscribers.insertBefore(link_node, subscribers.get('firstChild'));915 subscribers.insertBefore(link_node, subscribers.get('firstChild'));
@@ -925,7 +919,7 @@
925 subscribers.insertBefore(link_node, next);919 subscribers.insertBefore(link_node, next);
926 } else {920 } else {
927 // Handle the case of the displayed "None".921 // Handle the case of the displayed "None".
928 var none_subscribers = Y.get('#none-subscribers');922 var none_subscribers = Y.one('#none-subscribers');
929 if (none_subscribers) {923 if (none_subscribers) {
930 var none_parent = none_subscribers.get('parentNode');924 var none_parent = none_subscribers.get('parentNode');
931 none_parent.removeChild(none_subscribers);925 none_parent.removeChild(none_subscribers);
@@ -936,7 +930,7 @@
936930
937 // Set the click handler if adding a remove icon.931 // Set the click handler if adding a remove icon.
938 if (subscription.can_be_unsubscribed_by_user()) {932 if (subscription.can_be_unsubscribed_by_user()) {
939 var remove_icon = Y.get('#unsubscribe-icon-' + person.get('css_name'));933 var remove_icon = Y.one('#unsubscribe-icon-' + person.get('css_name'));
940 remove_icon.on('click', function(e) {934 remove_icon.on('click', function(e) {
941 e.halt();935 e.halt();
942 unsubscribe_user_via_icon(e.target, subscription);936 unsubscribe_user_via_icon(e.target, subscription);
@@ -974,18 +968,18 @@
974 ' <span>Other Display Name</span>',968 ' <span>Other Display Name</span>',
975 ' <img id="temp-name-spinner" src="/@@/spinner" alt="" ',969 ' <img id="temp-name-spinner" src="/@@/spinner" alt="" ',
976 ' style="position:absolute;right:8px" /></div>'].join(''));970 ' style="position:absolute;right:8px" /></div>'].join(''));
977 link_node.query('img').set('src', img_src);971 link_node.one('img').set('src', img_src);
978 link_node.replaceChild(972 link_node.replaceChild(
979 document.createTextNode(display_name),973 document.createTextNode(display_name),
980 link_node.query('span'));974 link_node.one('span'));
981975
982 var subscribers = Y.get('#subscribers-links');976 var subscribers = Y.one('#subscribers-links');
983 var next = get_next_subscriber_node(subscription);977 var next = get_next_subscriber_node(subscription);
984 if (next) {978 if (next) {
985 subscribers.insertBefore(link_node, next);979 subscribers.insertBefore(link_node, next);
986 } else {980 } else {
987 // Handle the case of the displayed "None".981 // Handle the case of the displayed "None".
988 var none_subscribers = Y.get('#none-subscribers');982 var none_subscribers = Y.one('#none-subscribers');
989 if (none_subscribers) {983 if (none_subscribers) {
990 var none_parent = none_subscribers.get('parentNode');984 var none_parent = none_subscribers.get('parentNode');
991 none_parent.removeChild(none_subscribers);985 none_parent.removeChild(none_subscribers);
@@ -1005,19 +999,19 @@
1005 * @method set_none_for_empty_subscribers999 * @method set_none_for_empty_subscribers
1006 */1000 */
1007function set_none_for_empty_subscribers() {1001function set_none_for_empty_subscribers() {
1008 var subscriber_list = Y.get('#subscribers-links');1002 var subscriber_list = Y.one('#subscribers-links');
1009 // Assume if subscriber_list has no child divs1003 // Assume if subscriber_list has no child divs
1010 // then the list of subscribers is empty.1004 // then the list of subscribers is empty.
1011 if (!Y.Lang.isValue(subscriber_list.query('div')) &&1005 if (!Y.Lang.isValue(subscriber_list.one('div')) &&
1012 !Y.Lang.isValue(Y.get('#none-subscribers'))) {1006 !Y.Lang.isValue(Y.one('#none-subscribers'))) {
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>');
1014 subscriber_list.appendChild(none_div);1008 subscriber_list.appendChild(none_div);
1015 }1009 }
10161010
1017 // Clear the empty duplicate subscribers list if it exists.1011 // Clear the empty duplicate subscribers list if it exists.
1018 var dup_list = Y.get('#subscribers-from-duplicates');1012 var dup_list = Y.one('#subscribers-from-duplicates');
1019 if (Y.Lang.isValue(dup_list) &&1013 if (Y.Lang.isValue(dup_list) &&
1020 !Y.Lang.isValue(dup_list.query('div'))) {1014 !Y.Lang.isValue(dup_list.one('div'))) {
1021 var parent = dup_list.get('parentNode');1015 var parent = dup_list.get('parentNode');
1022 parent.removeChild(dup_list);1016 parent.removeChild(dup_list);
1023 }1017 }
@@ -1088,7 +1082,7 @@
1088 error_handler.clearProgressUI = function () {1082 error_handler.clearProgressUI = function () {
1089 icon.set('src', '/@@/remove');1083 icon.set('src', '/@@/remove');
1090 // Grab the icon again to reset to click handler.1084 // Grab the icon again to reset to click handler.
1091 var unsubscribe_icon = Y.get(1085 var unsubscribe_icon = Y.one(
1092 '#unsubscribe-icon-' + person.get('css_name'));1086 '#unsubscribe-icon-' + person.get('css_name'));
1093 unsubscribe_icon.on('click', function(e) {1087 unsubscribe_icon.on('click', function(e) {
1094 e.halt();1088 e.halt();
@@ -1097,7 +1091,7 @@
10971091
1098 };1092 };
1099 error_handler.showError = function (error_msg) {1093 error_handler.showError = function (error_msg) {
1100 var flash_node = Y.get('.' + person.get('css_name'));1094 var flash_node = Y.one('.' + person.get('css_name'));
1101 Y.lp.display_error(flash_node, error_msg);1095 Y.lp.display_error(flash_node, error_msg);
11021096
1103 };1097 };
@@ -1111,7 +1105,7 @@
1111 anim.on('end', function(e) {1105 anim.on('end', function(e) {
1112 remove_user_name_link(icon_parent_div);1106 remove_user_name_link(icon_parent_div);
1113 set_none_for_empty_subscribers();1107 set_none_for_empty_subscribers();
1114 var person_link = Y.get('.' + person.get('css_name'));1108 var person_link = Y.one('.' + person.get('css_name'));
1115 if (Y.Lang.isNull(person_link) &&1109 if (Y.Lang.isNull(person_link) &&
1116 subscription.is_current_user_subscribing()) {1110 subscription.is_current_user_subscribing()) {
1117 // Current user has been completely unsubscribed.1111 // Current user has been completely unsubscribed.
@@ -1190,7 +1184,7 @@
1190 }1184 }
11911185
1192 // Handle the case where the subscriber's list displays "None".1186 // Handle the case where the subscriber's list displays "None".
1193 var empty_subscribers = Y.get("#none-subscribers");1187 var empty_subscribers = Y.one("#none-subscribers");
1194 if (empty_subscribers) {1188 if (empty_subscribers) {
1195 var parent = empty_subscribers.get('parentNode');1189 var parent = empty_subscribers.get('parentNode');
1196 parent.removeChild(empty_subscribers);1190 parent.removeChild(empty_subscribers);
@@ -1198,7 +1192,7 @@
11981192
1199 add_user_name_link(subscription);1193 add_user_name_link(subscription);
12001194
1201 var flash_node = Y.get('.' + subscriber.get('css_name'));1195 var flash_node = Y.one('.' + subscriber.get('css_name'));
1202 var anim = Y.lazr.anim.green_flash({ node: flash_node });1196 var anim = Y.lazr.anim.green_flash({ node: flash_node });
1203 anim.run();1197 anim.run();
1204 },1198 },
@@ -1258,7 +1252,7 @@
1258 subscription.set('has_dupes', false);1252 subscription.set('has_dupes', false);
1259 }1253 }
12601254
1261 var flash_node = Y.get('.' + subscriber.get('css_name'));1255 var flash_node = Y.one('.' + subscriber.get('css_name'));
1262 var anim = Y.lazr.anim.green_flash({ node: flash_node });1256 var anim = Y.lazr.anim.green_flash({ node: flash_node });
1263 anim.on('end', function(e) {1257 anim.on('end', function(e) {
1264 remove_user_name_link(flash_node);1258 remove_user_name_link(flash_node);
@@ -1291,12 +1285,18 @@
1291 return;1285 return;
1292 }1286 }
12931287
1294 var tr = Y.get('#' + conf.row_id);1288 var tr = Y.one('#' + conf.row_id);
1295 var bugtarget_content = Y.get('#bugtarget-picker-' + conf.row_id);1289 var bugtarget_content = Y.one('#bugtarget-picker-' + conf.row_id);
1296 var status_content = tr.query('.status-content');1290 var status_content = tr.one('.status-content');
1297 var importance_content = tr.query('.importance-content');1291 var importance_content = tr.one('.importance-content');
1298 var assignee_content = Y.get('#assignee-picker-' + conf.row_id);1292 var assignee_content = Y.one('#assignee-picker-' + conf.row_id);
1299 var milestone_content = tr.query('.milestone-content');1293 var milestone_content = tr.one('.milestone-content');
1294
1295 if (status_content === null) {
1296 // Not all table rows have status widgets. If this is one of those
1297 // rows, then bail.
1298 return;
1299 }
13001300
1301 if (Y.Lang.isValue(LP.client.cache.bug) &&1301 if (Y.Lang.isValue(LP.client.cache.bug) &&
1302 Y.Lang.isValue(LP.client.cache.bug.duplicate_of_link)) {1302 Y.Lang.isValue(LP.client.cache.bug.duplicate_of_link)) {
@@ -1316,7 +1316,7 @@
1316 Y.DOM.create(1316 Y.DOM.create(
1317 '<a href="+editstatus" ' +1317 '<a href="+editstatus" ' +
1318 ' class="sprite edit yui-activator-act" />'),1318 ' class="sprite edit yui-activator-act" />'),
1319 bugtarget_content.query('.yui-activator-act'));1319 bugtarget_content.one('.yui-activator-act'));
1320 } else {1320 } else {
1321 var bugtarget_picker = Y.lp.picker.addPickerPatcher(1321 var bugtarget_picker = Y.lp.picker.addPickerPatcher(
1322 'Product',1322 'Product',
@@ -1354,7 +1354,7 @@
1354 });1354 });
1355 // Set the inline form control's value, so that submitting1355 // Set the inline form control's value, so that submitting
1356 // it won't override the value we just set.1356 // it won't override the value we just set.
1357 Y.get(document.getElementById(conf.prefix + '.status')).set(1357 Y.one(document.getElementById(conf.prefix + '.status')).set(
1358 'value', status_choice_edit.get('value'));1358 'value', status_choice_edit.get('value'));
1359 });1359 });
1360 status_choice_edit.plug({1360 status_choice_edit.plug({
@@ -1386,7 +1386,7 @@
1386 });1386 });
1387 // Set the inline form control's value, so that submitting1387 // Set the inline form control's value, so that submitting
1388 // it won't override the value we just set.1388 // it won't override the value we just set.
1389 Y.get(document.getElementById(conf.prefix + '.importance')).set(1389 Y.one(document.getElementById(conf.prefix + '.importance')).set(
1390 'value', importance_choice_edit.get('value'));1390 'value', importance_choice_edit.get('value'));
1391 });1391 });
1392 importance_choice_edit.plug({1392 importance_choice_edit.plug({
@@ -1422,18 +1422,18 @@
1422 // to have a more established way of getting the web URL of1422 // to have a more established way of getting the web URL of
1423 // an API object. Once such a solution is available we should1423 // an API object. Once such a solution is available we should
1424 // fix this.1424 // fix this.
1425 milestone_content.query('.value').setAttribute(1425 milestone_content.one('.value').setAttribute(
1426 'href', new_value.replace('/api/beta', ''));1426 'href', new_value.replace('/api/beta', ''));
1427 }1427 }
1428 // Set the inline form control's value, so that submitting1428 // Set the inline form control's value, so that submitting
1429 // it won't override the value we just set.1429 // it won't override the value we just set.
1430 var inline_combo = Y.get(1430 var inline_combo = Y.one(
1431 document.getElementById(conf.prefix + '.milestone'));1431 document.getElementById(conf.prefix + '.milestone'));
1432 if (Y.Lang.isValue(inline_combo)) {1432 if (Y.Lang.isValue(inline_combo)) {
1433 inline_combo.set('value', null);1433 inline_combo.set('value', null);
1434 Y.Array.each(milestone_choice_edit.get('items'), function(item) {1434 Y.Array.each(milestone_choice_edit.get('items'), function(item) {
1435 if (item.value == milestone_choice_edit.get('value')) {1435 if (item.value == milestone_choice_edit.get('value')) {
1436 inline_combo.queryAll('option').each(function(opt) {1436 inline_combo.all('option').each(function(opt) {
1437 if (opt.get('innerHTML') == item.name) {1437 if (opt.get('innerHTML') == item.name) {
1438 opt.set('selected', true);1438 opt.set('selected', true);
1439 }1439 }
@@ -1444,11 +1444,11 @@
1444 // Force redrawing the UI1444 // Force redrawing the UI
1445 milestone_choice_edit._uiClearWaiting();1445 milestone_choice_edit._uiClearWaiting();
1446 });1446 });
1447 milestone_content.query('.nulltext').on(1447 milestone_content.one('.nulltext').on(
1448 'mousedown',1448 'mousedown',
1449 milestone_choice_edit._onMouseDown,1449 milestone_choice_edit._onMouseDown,
1450 milestone_choice_edit);1450 milestone_choice_edit);
1451 milestone_choice_edit.render(); 1451 milestone_choice_edit.render();
1452 }1452 }
1453 if (Y.Lang.isValue(assignee_content)) {1453 if (Y.Lang.isValue(assignee_content)) {
1454 var assignee_picker = Y.lp.picker.addPickerPatcher(1454 var assignee_picker = Y.lp.picker.addPickerPatcher(
@@ -1480,7 +1480,7 @@
1480 if (Y.UA.ie) {1480 if (Y.UA.ie) {
1481 return;1481 return;
1482 }1482 }
1483 var me_too_content = Y.get('#affectsmetoo');1483 var me_too_content = Y.one('#affectsmetoo');
1484 var me_too_edit = new MeTooChoiceSource({1484 var me_too_edit = new MeTooChoiceSource({
1485 contentBox: me_too_content, value: user_is_affected,1485 contentBox: me_too_content, value: user_is_affected,
1486 elementToFlash: me_too_content,1486 elementToFlash: me_too_content,
@@ -1541,7 +1541,7 @@
1541 * affected by the current bug. Should be automatically calculated1541 * affected by the current bug. Should be automatically calculated
1542 * by HTML_PARSER.1542 * by HTML_PARSER.
1543 *1543 *
1544 * Setter function returns Y.get(parameter) so that you can pass1544 * Setter function returns Y.one(parameter) so that you can pass
1545 * either a Node (as expected) or a selector.1545 * either a Node (as expected) or a selector.
1546 *1546 *
1547 * @attribute value_location1547 * @attribute value_location
@@ -1550,7 +1550,7 @@
1550 flame_icon: {1550 flame_icon: {
1551 value: null,1551 value: null,
1552 set: function(v) {1552 set: function(v) {
1553 return Y.get(v);1553 return Y.one(v);
1554 }1554 }
1555 }1555 }
1556};1556};
@@ -1589,8 +1589,8 @@
1589 // Force the ChoiceSource to be rendered inline.1589 // Force the ChoiceSource to be rendered inline.
1590 this.get('boundingBox').setStyle('display', 'inline');1590 this.get('boundingBox').setStyle('display', 'inline');
1591 // Hide the static content and show the dynamic content.1591 // Hide the static content and show the dynamic content.
1592 this.get('contentBox').query('.static').addClass('unseen');1592 this.get('contentBox').one('.static').addClass('unseen');
1593 this.get('contentBox').query('.dynamic').removeClass('unseen');1593 this.get('contentBox').one('.dynamic').removeClass('unseen');
1594 },1594 },
15951595
1596 _saveData: function() {1596 _saveData: function() {
@@ -1634,7 +1634,7 @@
1634function check_can_be_unsubscribed(subscription) {1634function check_can_be_unsubscribed(subscription) {
1635 var error_handler = new LP.client.ErrorHandler();1635 var error_handler = new LP.client.ErrorHandler();
1636 error_handler.showError = function (error_msg) {1636 error_handler.showError = function (error_msg) {
1637 Y.lp.display_error(Y.get('.menu-link-addsubscriber'), error_msg);1637 Y.lp.display_error(Y.one('.menu-link-addsubscriber'), error_msg);
1638 };1638 };
16391639
1640 var config = {1640 var config = {
@@ -1703,7 +1703,7 @@
17031703
1704 var error_handler = new LP.client.ErrorHandler();1704 var error_handler = new LP.client.ErrorHandler();
1705 error_handler.showError = function(error_msg) {1705 error_handler.showError = function(error_msg) {
1706 Y.lp.display_error(Y.get('.menu-link-addsubscriber'), error_msg);1706 Y.lp.display_error(Y.one('.menu-link-addsubscriber'), error_msg);
1707 };1707 };
17081708
1709 if (subscription.is_already_subscribed()) {1709 if (subscription.is_already_subscribed()) {
@@ -1722,9 +1722,9 @@
1722 * @method setup_add_attachment1722 * @method setup_add_attachment
1723 */1723 */
1724function setup_add_attachment() {1724function setup_add_attachment() {
1725 var attachment_link = Y.get('.menu-link-addcomment');1725 var attachment_link = Y.one('.menu-link-addcomment');
1726 attachment_link.on('click', function(e) {1726 attachment_link.on('click', function(e) {
1727 var comment_input = Y.get('[id="field.comment"]');1727 var comment_input = Y.one('[id="field.comment"]');
1728 if (comment_input.get('value') !== '') {1728 if (comment_input.get('value') !== '') {
1729 var current_url = attachment_link.getAttribute('href');1729 var current_url = attachment_link.getAttribute('href');
1730 var attachment_url = current_url + '?field.comment=' +1730 var attachment_url = current_url + '?field.comment=' +
@@ -1779,10 +1779,10 @@
1779 return null;1779 return null;
1780 }1780 }
17811781
1782 Y.get('#subscribers-portlet-spinner').setStyle('display', 'block');1782 Y.one('#subscribers-portlet-spinner').setStyle('display', 'block');
17831783
1784 function hide_spinner() {1784 function hide_spinner() {
1785 Y.get('#subscribers-portlet-spinner').setStyle('display', 'none');1785 Y.one('#subscribers-portlet-spinner').setStyle('display', 'none');
1786 // Fire a custom event to notify that the initial click1786 // Fire a custom event to notify that the initial click
1787 // handler on subscription_link set above should be1787 // handler on subscription_link set above should be
1788 // cleared.1788 // cleared.
@@ -1794,7 +1794,7 @@
17941794
1795 function on_success(transactionid, response, args) {1795 function on_success(transactionid, response, args) {
1796 hide_spinner();1796 hide_spinner();
1797 var portlet = Y.get('#portlet-subscribers');1797 var portlet = Y.one('#portlet-subscribers');
1798 portlet.set('innerHTML',1798 portlet.set('innerHTML',
1799 portlet.get('innerHTML') + response.responseText);1799 portlet.get('innerHTML') + response.responseText);
18001800
@@ -1805,7 +1805,7 @@
18051805
1806 var config = {on: {success: on_success,1806 var config = {on: {success: on_success,
1807 failure: hide_spinner}};1807 failure: hide_spinner}};
1808 var url = Y.get(1808 var url = Y.one(
1809 '#subscribers-content-link').getAttribute('href').replace('bugs.', '');1809 '#subscribers-content-link').getAttribute('href').replace('bugs.', '');
1810 Y.io(url, config);1810 Y.io(url, config);
1811};1811};
18121812
=== modified file 'lib/canonical/launchpad/javascript/bugs/filebug-dupefinder.js'
--- lib/canonical/launchpad/javascript/bugs/filebug-dupefinder.js 2009-07-22 16:42:10 +0000
+++ lib/canonical/launchpad/javascript/bugs/filebug-dupefinder.js 2009-11-18 13:45:26 +0000
@@ -46,7 +46,7 @@
46 */46 */
47function get_details_div(expander) {47function get_details_div(expander) {
48 var details_div = expander.get(48 var details_div = expander.get(
49 'parentNode').get('parentNode').query('.duplicate-details');49 'parentNode').get('parentNode').one('.duplicate-details');
5050
51 // Check that the details_div actually exists and raise an error if51 // Check that the details_div actually exists and raise an error if
52 // we can't find it.52 // we can't find it.
@@ -77,24 +77,24 @@
77 */77 */
78function show_bug_reporting_form(e) {78function show_bug_reporting_form(e) {
79 // Collapse all the duplicate-details divs.79 // Collapse all the duplicate-details divs.
80 Y.each(bug_already_reported_expanders, function(expander) {80 bug_already_reported_expanders.each(function(expander) {
81 collapse_bug_details(expander);81 collapse_bug_details(expander);
82 });82 });
8383
84 // Show the bug reporting form.84 // Show the bug reporting form.
85 bug_reporting_form.setStyle(DISPLAY, BLOCK);85 bug_reporting_form.setStyle(DISPLAY, BLOCK);
86 Y.get(Y.DOM.byId('field.actions.submit_bug')).focus();86 Y.one(Y.DOM.byId('field.actions.submit_bug')).focus();
87 window.location.href = '#form-start';87 window.location.href = '#form-start';
8888
89 // Focus the relevant elements of the form based on89 // Focus the relevant elements of the form based on
90 // whether the package drop-down is displayed.90 // whether the package drop-down is displayed.
91 var bugtarget_package_btn = Y.get(91 var bugtarget_package_btn = Y.one(
92 Y.DOM.byId('field.bugtarget.option.package'));92 Y.DOM.byId('field.bugtarget.option.package'));
93 if (bugtarget_package_btn !== null &&93 if (bugtarget_package_btn !== null &&
94 bugtarget_package_btn !== undefined) {94 bugtarget_package_btn !== undefined) {
95 Y.get(Y.DOM.byId('field.bugtarget.package')).focus();95 Y.one(Y.DOM.byId('field.bugtarget.package')).focus();
96 } else {96 } else {
97 Y.get(Y.DOM.byId('field.comment')).focus();97 Y.one(Y.DOM.byId('field.comment')).focus();
98 }98 }
99}99}
100100
@@ -106,9 +106,9 @@
106 */106 */
107function create_subscribe_overlay(form) {107function create_subscribe_overlay(form) {
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.
109 var bug_id = form.query(109 var bug_id = form.one(
110 'input.bug-already-reported-as').get('value');110 'input.bug-already-reported-as').get('value');
111 var bug_title = Y.get('#bug-' + bug_id + '-title').get('innerHTML');111 var bug_title = Y.one('#bug-' + bug_id + '-title').get('innerHTML');
112112
113 if (bug_title.length > 35) {113 if (bug_title.length > 35) {
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.
@@ -161,25 +161,16 @@
161161
162 // Add an on-click handler to the radio buttons to ensure that their162 // Add an on-click handler to the radio buttons to ensure that their
163 // labels' styles are set correctly when they're selected.163 // labels' styles are set correctly when they're selected.
164 var radio_buttons = form.queryAll('input.subscribe-option');164 var radio_buttons = form.all('input.subscribe-option');
165 if (radio_buttons !== null && radio_buttons !== undefined) {165 radio_buttons.on('click', function(e) {
166 // Loop over the radio buttons and set their parent
167 // div's font-weight depending on whether they're
168 // checked or not.
166 Y.each(radio_buttons, function(radio_button) {169 Y.each(radio_buttons, function(radio_button) {
167 radio_button.on('click', function(e) {170 var weight = radio_button.get('checked') ? 'bold' : 'normal';
168 // Loop over the radio buttons and set their parent171 radio_button.get('parentNode').setStyle('fontWeight', weight);
169 // div's font-weight depending on whether they're
170 // checked or not.
171 Y.each(radio_buttons, function(radio_button) {
172 if (radio_button.get('checked')) {
173 radio_button.get(
174 'parentNode').setStyle('fontWeight', 'bold');
175 } else {
176 radio_button.get(
177 'parentNode').setStyle('fontWeight', 'normal');
178 }
179 });
180 });
181 });172 });
182 }173 });
183174
184 return subscribe_form_overlay;175 return subscribe_form_overlay;
185}176}
@@ -189,17 +180,16 @@
189 Y.on('domready', function() {180 Y.on('domready', function() {
190 bug_already_reported_expanders = Y.all(181 bug_already_reported_expanders = Y.all(
191 'img.bug-already-reported-expander');182 'img.bug-already-reported-expander');
192 bug_reporting_form = Y.get('#bug_reporting_form');183 bug_reporting_form = Y.one('#bug_reporting_form');
193184
194 if (bug_already_reported_expanders !== null &&185 if (bug_already_reported_expanders.size() !== 0) {
195 bug_already_reported_expanders !== undefined) {
196186
197 // Set up the onclick handlers for the expanders.187 // Set up the onclick handlers for the expanders.
198 Y.each(Y.all('.similar-bug'), function(row) {188 Y.all('.similar-bug').each(function(row) {
199 var bug_details_div = row.query('div.duplicate-details');189 var bug_details_div = row.one('div.duplicate-details');
200 var image = row.query('img.bug-already-reported-expander');190 var image = row.one('img.bug-already-reported-expander');
201 var bug_title_link = row.query('.duplicate-bug-link');191 var bug_title_link = row.one('.duplicate-bug-link');
202 var view_bug_link = row.query('.view-bug-link');192 var view_bug_link = row.one('.view-bug-link');
203193
204 // Grab the initial height of the element and create a194 // Grab the initial height of the element and create a
205 // config for the slide_out animation. This allows us to195 // config for the slide_out animation. This allows us to
@@ -276,13 +266,13 @@
276266
277 // Collapse all the details divs, since we don't want them267 // Collapse all the details divs, since we don't want them
278 // expanded first up.268 // expanded first up.
279 Y.each(Y.all('div.duplicate-details'), function(div) {269 Y.all('div.duplicate-details').each(function(div) {
280 collapse_bug_details(div);270 collapse_bug_details(div);
281 });271 });
282272
283 }273 }
284274
285 bug_not_reported_button = Y.get('#bug-not-already-reported');275 bug_not_reported_button = Y.one('#bug-not-already-reported');
286 if (bug_not_reported_button !== null &&276 if (bug_not_reported_button !== null &&
287 bug_not_reported_button !== undefined) {277 bug_not_reported_button !== undefined) {
288 // The bug_not_reported_button won't show up if there aren't any278 // The bug_not_reported_button won't show up if there aren't any
@@ -291,8 +281,7 @@
291 }281 }
292282
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.
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) {
295 Y.each(this_is_my_bug_forms, function(form) {
296 var subscribe_form_overlay = create_subscribe_overlay(form);285 var subscribe_form_overlay = create_subscribe_overlay(form);
297286
298 form.on('submit', function(e) {287 form.on('submit', function(e) {
299288
=== modified file 'lib/canonical/launchpad/javascript/bugs/offical_bug_tags.js'
--- lib/canonical/launchpad/javascript/bugs/offical_bug_tags.js 2009-06-30 21:06:27 +0000
+++ lib/canonical/launchpad/javascript/bugs/offical_bug_tags.js 2009-11-18 13:45:26 +0000
@@ -129,8 +129,8 @@
129 other_cbs_checked = other_cbs_checked || cb.get('checked');129 other_cbs_checked = other_cbs_checked || cb.get('checked');
130 });130 });
131 }131 }
132 Y.get('#remove-official-tags').set('disabled', !official_cbs_checked);132 Y.one('#remove-official-tags').set('disabled', !official_cbs_checked);
133 Y.get('#add-official-tags').set('disabled', !other_cbs_checked);133 Y.one('#add-official-tags').set('disabled', !other_cbs_checked);
134};134};
135135
136/**136/**
@@ -158,9 +158,9 @@
158 item);158 item);
159 var li_node = Y.Node.create(li_html);159 var li_node = Y.Node.create(li_html);
160 li_node._tag = item;160 li_node._tag = item;
161 li_node.query('input').on('click', function(e) {161 li_node.one('input').on('click', function(e) {
162 enable_arrows();162 enable_arrows();
163 var cb_node = li_node.query('input');163 var cb_node = li_node.one('input');
164 if (cb_node.get('checked')) {164 if (cb_node.get('checked')) {
165 li_node.addClass('selected');165 li_node.addClass('selected');
166 } else {166 } else {
@@ -179,8 +179,8 @@
179 * @method render_tag_lists179 * @method render_tag_lists
180 */180 */
181var render_tag_lists = function() {181var render_tag_lists = function() {
182 var official_tags_ul = Y.get('#official-tags-list');182 var official_tags_ul = Y.one('#official-tags-list');
183 var other_tags_ul = Y.get('#other-tags-list');183 var other_tags_ul = Y.one('#other-tags-list');
184184
185 official_tags_ul.set('innerHTML', '');185 official_tags_ul.set('innerHTML', '');
186 other_tags_ul.set('innerHTML', '');186 other_tags_ul.set('innerHTML', '');
@@ -207,8 +207,8 @@
207 Y.each(official_tags, function(item) {207 Y.each(official_tags, function(item) {
208 tags.push(item.tag);208 tags.push(item.tag);
209 });209 });
210 Y.get('#field-official_bug_tags').set('value', tags.join(' '));210 Y.one('#field-official_bug_tags').set('value', tags.join(' '));
211 Y.get('#save-form').submit();211 Y.one('#save-form').submit();
212};212};
213213
214/**214/**
@@ -219,8 +219,8 @@
219 */219 */
220var get_selected_tags = function(tags_ul) {220var get_selected_tags = function(tags_ul) {
221 var selected_tags = [];221 var selected_tags = [];
222 tags_ul.queryAll('li').each(function(li) {222 tags_ul.all('li').each(function(li) {
223 if (li.query('input').get('checked')) {223 if (li.one('input').get('checked')) {
224 selected_tags.push(li._tag);224 selected_tags.push(li._tag);
225 }225 }
226 });226 });
@@ -276,7 +276,7 @@
276 * @method on_new_tag_add276 * @method on_new_tag_add
277 */277 */
278var on_new_tag_add = function() {278var on_new_tag_add = function() {
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'));
280 var new_tag_already_official = false;280 var new_tag_already_official = false;
281 Y.each(official_tags, function(item) {281 Y.each(official_tags, function(item) {
282 new_tag_already_official = (282 new_tag_already_official = (
@@ -305,9 +305,9 @@
305 }305 }
306 official_tags.push({tag: new_tag, count: 0});306 official_tags.push({tag: new_tag, count: 0});
307 sort_tags(official_tags);307 sort_tags(official_tags);
308 Y.get('#new-tag-text').set('value', '');308 Y.one('#new-tag-text').set('value', '');
309 Y.get('#new-tag-add').set('disabled', true);309 Y.one('#new-tag-add').set('disabled', true);
310 Y.get('#save-button').set('disabled', false);310 Y.one('#save-button').set('disabled', false);
311 } else {311 } else {
312 display_error();312 display_error();
313 }313 }
@@ -330,7 +330,7 @@
330 * @method display_error330 * @method display_error
331 */331 */
332var display_error = function() {332var display_error = function() {
333 var new_tag = Y.get('#new-tag-text').get(333 var new_tag = Y.one('#new-tag-text').get(
334 'value').replace(new RegExp('<', 'g'), '&lt;');334 'value').replace(new RegExp('<', 'g'), '&lt;');
335 var overlay = new Y.lazr.PrettyOverlay({335 var overlay = new Y.lazr.PrettyOverlay({
336 headerContent: '<span class="official-tag-error-message-header">' +336 headerContent: '<span class="official-tag-error-message-header">' +
@@ -356,56 +356,56 @@
356 official_tags = get_official_bug_tags(official_bug_tags);356 official_tags = get_official_bug_tags(official_bug_tags);
357 other_tags = get_other_bug_tags(used_bug_tags);357 other_tags = get_other_bug_tags(used_bug_tags);
358358
359 var layout_table = Y.get('#layout-table');359 var layout_table = Y.one('#layout-table');
360360
361 // The entire dynamic UI is hidden initially, so that clients361 // The entire dynamic UI is hidden initially, so that clients
362 // with no JS don't display it.362 // with no JS don't display it.
363 layout_table.setStyle('display', 'block');363 layout_table.setStyle('display', 'block');
364364
365 var official_tags_ul = Y.get('#official-tags-list');365 var official_tags_ul = Y.one('#official-tags-list');
366 var other_tags_ul = Y.get('#other-tags-list');366 var other_tags_ul = Y.one('#other-tags-list');
367367
368 render_tag_lists();368 render_tag_lists();
369369
370 // Hook an event handler to the arrow button for moving370 // Hook an event handler to the arrow button for moving
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.
372 Y.get('#add-official-tags').on('click', function(e) {372 Y.one('#add-official-tags').on('click', function(e) {
373 var updated_tags = get_updated_tags(373 var updated_tags = get_updated_tags(
374 other_tags_ul, other_tags, official_tags);374 other_tags_ul, other_tags, official_tags);
375 other_tags = updated_tags.from_tags;375 other_tags = updated_tags.from_tags;
376 official_tags = updated_tags.to_tags;376 official_tags = updated_tags.to_tags;
377 render_tag_lists();377 render_tag_lists();
378 enable_arrows();378 enable_arrows();
379 Y.get('#save-button').set('disabled', false);379 Y.one('#save-button').set('disabled', false);
380 });380 });
381381
382 // Hook an event handler to the arrow button for moving382 // Hook an event handler to the arrow button for moving
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.
384 Y.get('#remove-official-tags').on('click', function(e) {384 Y.one('#remove-official-tags').on('click', function(e) {
385 var updated_tags = get_updated_tags(385 var updated_tags = get_updated_tags(
386 official_tags_ul, official_tags, other_tags);386 official_tags_ul, official_tags, other_tags);
387 official_tags = updated_tags.from_tags;387 official_tags = updated_tags.from_tags;
388 other_tags = updated_tags.to_tags;388 other_tags = updated_tags.to_tags;
389 render_tag_lists();389 render_tag_lists();
390 enable_arrows();390 enable_arrows();
391 Y.get('#save-button').set('disabled', false);391 Y.one('#save-button').set('disabled', false);
392 });392 });
393393
394 Y.get('#new-tag-add').on('click', function(e) {394 Y.one('#new-tag-add').on('click', function(e) {
395 on_new_tag_add();395 on_new_tag_add();
396 });396 });
397397
398 // Hook a keypress event handler to the new tag text box. If enter is398 // Hook a keypress event handler to the new tag text box. If enter is
399 // pressed, try adding a new tag.399 // pressed, try adding a new tag.
400 Y.get('#new-tag-text').on('keypress', function(e) {400 Y.one('#new-tag-text').on('keypress', function(e) {
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'));
402 Y.get('#new-tag-add').set('disabled', new_value == '');402 Y.one('#new-tag-add').set('disabled', new_value == '');
403 if (e.keyCode == 13) { // Enter == 13403 if (e.keyCode == 13) { // Enter == 13
404 on_new_tag_add();404 on_new_tag_add();
405 }405 }
406 });406 });
407407
408 Y.get('#save-button').on('click', function(e) {408 Y.one('#save-button').on('click', function(e) {
409 e.halt();409 e.halt();
410 save_tags();410 save_tags();
411 });411 });
412412
=== modified file 'lib/canonical/launchpad/javascript/bugs/subscriber.js'
--- lib/canonical/launchpad/javascript/bugs/subscriber.js 2009-08-03 12:51:30 +0000
+++ lib/canonical/launchpad/javascript/bugs/subscriber.js 2009-11-18 13:45:26 +0000
@@ -75,17 +75,15 @@
75 */75 */
76 'is_already_subscribed': function() {76 'is_already_subscribed': function() {
77 var display_name = this.get('person').get('full_display_name');77 var display_name = this.get('person').get('full_display_name');
78 var subscribers = Y.get('#subscribers-links');
79 var all_subscribers = subscribers.queryAll('div');
80 var already_subscribed = false;78 var already_subscribed = false;
81 if (Y.Lang.isValue(all_subscribers)) {79
82 all_subscribers.each(function(link) {80 Y.all('#subscribers-links div').each(function(link) {
83 var name = link.query('a').getAttribute('name');81 var name = link.one('a').getAttribute('name');
84 if (name == display_name) {82 if (name == display_name) {
85 already_subscribed = true;83 already_subscribed = true;
86 }84 }
87 });85 });
88 }86
89 return already_subscribed;87 return already_subscribed;
90 },88 },
9189
@@ -310,12 +308,12 @@
310 if (Y.Lang.isValue(this.get('user_node'))) {308 if (Y.Lang.isValue(this.get('user_node'))) {
311 user_node = this.get('user_node');309 user_node = this.get('user_node');
312 } else {310 } else {
313 user_node = Y.get('.subscriber-' + this.get('name'));311 user_node = Y.one('.subscriber-' + this.get('name'));
314 }312 }
315313
316 if (Y.Lang.isValue(user_node)) {314 if (Y.Lang.isValue(user_node)) {
317 this.set('user_node', user_node);315 this.set('user_node', user_node);
318 var anchor = this.get('user_node').query('a');316 var anchor = this.get('user_node').one('a');
319 var display_name = anchor.get('name');317 var display_name = anchor.get('name');
320 return display_name;318 return display_name;
321 } else {319 } else {
322320
=== modified file 'lib/canonical/launchpad/javascript/bugs/tests/test_me_too.js'
--- lib/canonical/launchpad/javascript/bugs/tests/test_me_too.js 2009-08-04 16:19:27 +0000
+++ lib/canonical/launchpad/javascript/bugs/tests/test_me_too.js 2009-11-18 13:45:26 +0000
@@ -16,7 +16,7 @@
16 * CSS selectors and Node instances instead of raw nodes.16 * CSS selectors and Node instances instead of raw nodes.
17 */17 */
18function simulate(widget, selector, evtype, options) {18function simulate(widget, selector, evtype, options) {
19 var rawnode = Y.Node.getDOMNode(widget.query(selector));19 var rawnode = Y.Node.getDOMNode(widget.one(selector));
20 Y.Event.simulate(rawnode, evtype, options);20 Y.Event.simulate(rawnode, evtype, options);
21}21}
2222
@@ -68,8 +68,8 @@
68 ' <img src="https://bugs.edge.launchpad.net/@@/flame-icon" alt=""/>',68 ' <img src="https://bugs.edge.launchpad.net/@@/flame-icon" alt=""/>',
69 ' </span>',69 ' </span>',
70 '</span>'].join(''));70 '</span>'].join(''));
71 Y.get("body").appendChild(inpage);71 Y.one("body").appendChild(inpage);
72 var me_too_content = Y.get('#affectsmetoo');72 var me_too_content = Y.one('#affectsmetoo');
73 this.config = {73 this.config = {
74 contentBox: me_too_content, value: null,74 contentBox: me_too_content, value: null,
75 elementToFlash: me_too_content75 elementToFlash: me_too_content
@@ -82,7 +82,7 @@
82 if (this.choice_edit._choice_list) {82 if (this.choice_edit._choice_list) {
83 cleanup_widget(this.choice_edit._choice_list);83 cleanup_widget(this.choice_edit._choice_list);
84 }84 }
85 var status = Y.get("document").query("#affectsmetoo");85 var status = Y.one("document").one("#affectsmetoo");
86 if (status) {86 if (status) {
87 status.get("parentNode").removeChild(status);87 status.get("parentNode").removeChild(status);
88 }88 }
@@ -101,7 +101,7 @@
101 * The .static area should be hidden by adding the "unseen" class.101 * The .static area should be hidden by adding the "unseen" class.
102 */102 */
103 test_hide_static: function() {103 test_hide_static: function() {
104 var static_area = this.choice_edit.get('contentBox').query('.static');104 var static_area = this.choice_edit.get('contentBox').one('.static');
105 Assert.isTrue(105 Assert.isTrue(
106 static_area.hasClass('unseen'), "Static area is not hidden.");106 static_area.hasClass('unseen'), "Static area is not hidden.");
107 },107 },
@@ -110,7 +110,7 @@
110 * The .dynamic area should be shown by removing the "unseen" class.110 * The .dynamic area should be shown by removing the "unseen" class.
111 */111 */
112 test_hide_dynamic: function() {112 test_hide_dynamic: function() {
113 var dynamic_area = this.choice_edit.get('contentBox').query('.dynamic');113 var dynamic_area = this.choice_edit.get('contentBox').one('.dynamic');
114 Assert.isFalse(114 Assert.isFalse(
115 dynamic_area.hasClass('unseen'), "Dynamic area is hidden.");115 dynamic_area.hasClass('unseen'), "Dynamic area is hidden.");
116 },116 },
117117
=== modified file 'lib/canonical/launchpad/javascript/bugs/tests/test_subscriber.js'
--- lib/canonical/launchpad/javascript/bugs/tests/test_subscriber.js 2009-07-24 15:26:14 +0000
+++ lib/canonical/launchpad/javascript/bugs/tests/test_subscriber.js 2009-11-18 13:45:26 +0000
@@ -99,7 +99,7 @@
99 name: 'Subscriber Name When Passed Node',99 name: 'Subscriber Name When Passed Node',
100100
101 setUp: function() {101 setUp: function() {
102 var node = Y.get('.subscriber-tester');102 var node = Y.one('.subscriber-tester');
103 this.config = {103 this.config = {
104 uri: '/~tester',104 uri: '/~tester',
105 user_node: node105 user_node: node
@@ -212,7 +212,7 @@
212 Y.Assert.isFalse(212 Y.Assert.isFalse(
213 this.subscription.is_node(),213 this.subscription.is_node(),
214 'Initially, no node should be supplied to the config.');214 'Initially, no node should be supplied to the config.');
215 var link = Y.get('.menu-link-subscription');215 var link = Y.one('.menu-link-subscription');
216 this.subscription.set('link', link);216 this.subscription.set('link', link);
217 Y.Assert.isTrue(217 Y.Assert.isTrue(
218 this.subscription.is_node(),218 this.subscription.is_node(),
219219
=== modified file 'lib/canonical/launchpad/javascript/client/client.js'
--- lib/canonical/launchpad/javascript/client/client.js 2009-10-26 14:57:22 +0000
+++ lib/canonical/launchpad/javascript/client/client.js 2009-11-18 13:45:26 +0000
@@ -69,8 +69,8 @@
69 result = format(o);69 result = format(o);
70 } else {70 } else {
71 result = '(direct-attributes)\n ' + introspect(o);71 result = '(direct-attributes)\n ' + introspect(o);
72 if (o.getAtts !== undefined) {72 if (o.getAttrs !== undefined) {
73 result += '\n(get()-attributes)\n ' + introspect(o.getAtts());73 result += '\n(get()-attributes)\n ' + introspect(o.getAttrs());
74 }74 }
75 }75 }
76 if (name !== undefined) {76 if (name !== undefined) {
@@ -331,15 +331,19 @@
331 this.dirty_attributes = [];331 this.dirty_attributes = [];
332 var entry = this;332 var entry = this;
333333
334 // Copy the representation keys into our own set of attributes, and add
335 // an attribute-change event listener for caching purposes.
334 for (key in representation) {336 for (key in representation) {
335 if (representation.hasOwnProperty(key)) {337 if (representation.hasOwnProperty(key)) {
336 this.addAtt(key, {value: representation[key]});338 this.addAttr(key, {value: representation[key]});
337 this.on(key + "Change", this.mark_as_dirty);339 this.on(key + "Change", this.mark_as_dirty);
338 }340 }
339 }341 }
340};342};
341343
342LP.client.Entry.prototype = new LP.client.Resource();344LP.client.Entry.prototype = new LP.client.Resource();
345
346// Augment with Attribute so that we can listen for attribute change events.
343Y.augment(LP.client.Entry, Y.Attribute);347Y.augment(LP.client.Entry, Y.Attribute);
344348
345LP.client.Entry.prototype.mark_as_dirty = function(event) {349LP.client.Entry.prototype.mark_as_dirty = function(event) {
@@ -669,7 +673,8 @@
669 }673 }
670};674};
671675
672Y.extend(PATCHPlugin, Y.Plugin, {676
677Y.extend(PATCHPlugin, Y.Plugin.Base, {
673678
674 /**679 /**
675 * Configuration parameters that will be passed through to the LP.client680 * Configuration parameters that will be passed through to the LP.client
@@ -702,7 +707,7 @@
702707
703 // Save a reference to the original _saveData()708 // Save a reference to the original _saveData()
704 //method before wrapping it.709 //method before wrapping it.
705 this.original_save = config.owner._saveData;710 this.original_save = config.host._saveData;
706711
707 // We want to run our PATCH code instead of the original712 // We want to run our PATCH code instead of the original
708 // 'save' method. Using doBefore() means that713 // 'save' method. Using doBefore() means that
@@ -713,10 +718,10 @@
713 var self = this;718 var self = this;
714 this.error_handler = new LP.client.ErrorHandler();719 this.error_handler = new LP.client.ErrorHandler();
715 this.error_handler.clearProgressUI = function () {720 this.error_handler.clearProgressUI = function () {
716 self._owner._uiClearWaiting();721 config.host._uiClearWaiting();
717 };722 };
718 this.error_handler.showError = function (error_msg) {723 this.error_handler.showError = function (error_msg) {
719 self._owner.showError(error_msg);724 config.host.showError(error_msg);
720 };725 };
721 },726 },
722727
@@ -732,7 +737,7 @@
732 * @method doPATCH737 * @method doPATCH
733 */738 */
734 doPATCH: function() {739 doPATCH: function() {
735 var owner = this._owner,740 var owner = this.get("host"),
736 original_save = this.original_save;741 original_save = this.original_save;
737742
738 // Set the widget in 'waiting' state.743 // Set the widget in 'waiting' state.
739744
=== modified file 'lib/canonical/launchpad/javascript/code/branchlinks.js'
--- lib/canonical/launchpad/javascript/code/branchlinks.js 2009-08-13 13:16:04 +0000
+++ lib/canonical/launchpad/javascript/code/branchlinks.js 2009-11-18 13:45:26 +0000
@@ -44,7 +44,7 @@
44 });44 });
45 link_bug_overlay.render();45 link_bug_overlay.render();
46 link_bug_overlay.loadFormContentAndRender('+linkbug/++form++');46 link_bug_overlay.loadFormContentAndRender('+linkbug/++form++');
47 var linkbug_handle = Y.get('#linkbug');47 var linkbug_handle = Y.one('#linkbug');
48 linkbug_handle.addClass('js-action');48 linkbug_handle.addClass('js-action');
49 linkbug_handle.on('click', function(e) {49 linkbug_handle.on('click', function(e) {
50 e.preventDefault();50 e.preventDefault();
@@ -59,14 +59,11 @@
59 * remove the links.59 * remove the links.
60 */60 */
61function connect_remove_links() {61function connect_remove_links() {
62 var linked_bugs = Y.all('.delete-buglink');62 Y.on('click', function(e) {
63 if (Y.Lang.isValue(linked_bugs)) {63 e.preventDefault();
64 linked_bugs.on('click', function(e) {64 var bugnumber = get_bugnumber_from_id(e.currentTarget.get('id'));
65 e.preventDefault();65 unlink_bug_from_branch(bugnumber);
66 var bugnumber = get_bugnumber_from_id(e.currentTarget.get('id'));66 }, '.delete-buglink');
67 unlink_bug_from_branch(bugnumber);
68 });
69 }
70}67}
7168
72/*69/*
@@ -78,7 +75,7 @@
78 create_temporary_spinner();75 create_temporary_spinner();
7976
80 var bugnumber = data['field.bug'];77 var bugnumber = data['field.bug'];
81 var existing = Y.get('#buglink-' + bugnumber);78 var existing = Y.one('#buglink-' + bugnumber);
82 if (Y.Lang.isValue(existing)) {79 if (Y.Lang.isValue(existing)) {
83 // Bug is already linked, don't do unneccessary requests.80 // Bug is already linked, don't do unneccessary requests.
84 Y.lazr.anim.green_flash({node: existing}).run();81 Y.lazr.anim.green_flash({node: existing}).run();
@@ -124,10 +121,10 @@
124 on: {121 on: {
125 success: function(id, response) {122 success: function(id, response) {
126 destroy_temporary_spinner();123 destroy_temporary_spinner();
127 Y.get('#linkbug').set(124 Y.one('#linkbug').set(
128 'innerHTML', 'Link to another bug report');125 'innerHTML', 'Link to another bug report');
129 Y.get('#buglink-list').set('innerHTML', response.responseText);126 Y.one('#buglink-list').set('innerHTML', response.responseText);
130 var new_buglink = Y.get('#buglink-' + bug.get('id'));127 var new_buglink = Y.one('#buglink-' + bug.get('id'));
131 var anim = Y.lazr.anim.green_flash({node: new_buglink});128 var anim = Y.lazr.anim.green_flash({node: new_buglink});
132 anim.on('end', connect_remove_links);129 anim.on('end', connect_remove_links);
133 anim.run();130 anim.run();
@@ -150,14 +147,14 @@
150function unlink_bug_from_branch(bugnumber) {147function unlink_bug_from_branch(bugnumber) {
151 link_bug_overlay.hide();148 link_bug_overlay.hide();
152149
153 Y.get('#delete-buglink-' + bugnumber).get('children').set(150 Y.one('#delete-buglink-' + bugnumber).get('children').set(
154 'src', '/@@/spinner');151 'src', '/@@/spinner');
155 get_bug_from_bugnumber(bugnumber, function(bug) {152 get_bug_from_bugnumber(bugnumber, function(bug) {
156153
157 config = {154 config = {
158 on: {155 on: {
159 success: function(updated_entry) {156 success: function(updated_entry) {
160 var element = Y.get('#buglink-' + bugnumber);157 var element = Y.one('#buglink-' + bugnumber);
161 var parent_element = element.get('parentNode');158 var parent_element = element.get('parentNode');
162 anim = Y.lazr.anim.red_flash({node: element});159 anim = Y.lazr.anim.red_flash({node: element});
163 anim.on('end', function() {160 anim.on('end', function() {
@@ -165,8 +162,8 @@
165162
166 // Check to see if that was the only bug linked.163 // Check to see if that was the only bug linked.
167 var buglinks = Y.all(".bug-branch-summary");164 var buglinks = Y.all(".bug-branch-summary");
168 if (!buglinks) {165 if (buglinks.size() == 0) {
169 Y.get('#linkbug').set('innerHTML',166 Y.one('#linkbug').set('innerHTML',
170 'Link to a bug report');167 'Link to a bug report');
171 }168 }
172 });169 });
@@ -174,7 +171,7 @@
174 },171 },
175 failure: function(id, response) {172 failure: function(id, response) {
176 alert('An unexpected error has occurred.');173 alert('An unexpected error has occurred.');
177 Y.get('#delete-buglink-' + bugnumber).get('children').set(174 Y.one('#delete-buglink-' + bugnumber).get('children').set(
178 'src', '/@@/remove');175 'src', '/@@/remove');
179 Y.log(response.responseText);176 Y.log(response.responseText);
180 }177 }
@@ -237,8 +234,8 @@
237 '<div id="temp-spinner">',234 '<div id="temp-spinner">',
238 '<img src="/@@/spinner"/>Linking...',235 '<img src="/@@/spinner"/>Linking...',
239 '</div>'].join(''));236 '</div>'].join(''));
240 var buglinks = Y.get('#buglinks');237 var buglinks = Y.one('#buglinks');
241 var last = Y.get('#linkbug').get('parentNode');238 var last = Y.one('#linkbug').get('parentNode');
242 if (last) {239 if (last) {
243 buglinks.insertBefore(temp_spinner, last);240 buglinks.insertBefore(temp_spinner, last);
244 }241 }
@@ -249,7 +246,7 @@
249 */246 */
250function destroy_temporary_spinner() {247function destroy_temporary_spinner() {
251248
252 var temp_spinner = Y.get('#temp-spinner');249 var temp_spinner = Y.one('#temp-spinner');
253 var spinner_parent = temp_spinner.get('parentNode');250 var spinner_parent = temp_spinner.get('parentNode');
254 spinner_parent.removeChild(temp_spinner);251 spinner_parent.removeChild(temp_spinner);
255252
256253
=== modified file 'lib/canonical/launchpad/javascript/code/branchstatus.js'
--- lib/canonical/launchpad/javascript/code/branchstatus.js 2009-11-10 05:12:59 +0000
+++ lib/canonical/launchpad/javascript/code/branchstatus.js 2009-11-18 13:45:26 +0000
@@ -15,7 +15,7 @@
15 */15 */
16Y.branchstatus.connect_status = function(conf) {16Y.branchstatus.connect_status = function(conf) {
1717
18 var status_content = Y.get('#branch-details-status-value');18 var status_content = Y.one('#branch-details-status-value');
1919
20 if20 if
21 (conf.user_can_edit_status) {21 (conf.user_can_edit_status) {
@@ -31,9 +31,9 @@
31 var cb = status_choice_edit.get('contentBox');31 var cb = status_choice_edit.get('contentBox');
32 Y.Array.each(conf.status_widget_items, function(item) {32 Y.Array.each(conf.status_widget_items, function(item) {
33 if (item.value == status_choice_edit.get('value')) {33 if (item.value == status_choice_edit.get('value')) {
34 cb.query('span').addClass(item.css_class);34 cb.one('span').addClass(item.css_class);
35 } else {35 } else {
36 cb.query('span').removeClass(item.css_class);36 cb.one('span').removeClass(item.css_class);
37 }37 }
38 });38 });
39 });39 });
4040
=== modified file 'lib/canonical/launchpad/javascript/code/branchsubscription.js'
--- lib/canonical/launchpad/javascript/code/branchsubscription.js 2009-08-13 13:47:24 +0000
+++ lib/canonical/launchpad/javascript/code/branchsubscription.js 2009-11-18 13:45:26 +0000
@@ -38,15 +38,15 @@
38 Y.io('+branch-portlet-subscriber-content', {38 Y.io('+branch-portlet-subscriber-content', {
39 on: {39 on: {
40 success: function(id, response) {40 success: function(id, response) {
41 Y.get('#subscriber-list').set(41 Y.one('#subscriber-list').set(
42 'innerHTML', response.responseText);42 'innerHTML', response.responseText);
43 Y.get('#subscriber-list').setStyle('display', 'block');43 Y.one('#subscriber-list').setStyle('display', 'block');
44 if (highlight) {44 if (highlight) {
45 animate_subscription_update();45 animate_subscription_update();
46 }46 }
47 },47 },
48 failure: function(id, response) {48 failure: function(id, response) {
49 Y.get('#subscriber-list').set(49 Y.one('#subscriber-list').set(
50 'innerHTML', 'A problem has occurred.');50 'innerHTML', 'A problem has occurred.');
51 Y.log(reponse.responseText);51 Y.log(reponse.responseText);
52 },52 },
@@ -77,7 +77,7 @@
77 subscription_form_overlay.hide();77 subscription_form_overlay.hide();
7878
79 me = LP.client.links.me;79 me = LP.client.links.me;
80 var selfsubscriptioncontainer = Y.get('#selfsubscriptioncontainer');80 var selfsubscriptioncontainer = Y.one('#selfsubscriptioncontainer');
81 selfsubscriptioncontainer.set('innerHTML',81 selfsubscriptioncontainer.set('innerHTML',
82 '<img src="/@@/spinner">Subscribing...');82 '<img src="/@@/spinner">Subscribing...');
8383
@@ -104,7 +104,7 @@
104104
105 // XXX: rockstar: bug=336866 The etag returned by lp_save() is105 // XXX: rockstar: bug=336866 The etag returned by lp_save() is
106 // totally wrong.106 // totally wrong.
107 lp_subscription_entry.removeAtt('http_etag');107 lp_subscription_entry.removeAttr('http_etag');
108108
109 selfsubscriptioncontainer.setStyle('display', 'none');109 selfsubscriptioncontainer.setStyle('display', 'none');
110 Y.code.branchsubscription.update_subscriber_list(true);110 Y.code.branchsubscription.update_subscriber_list(true);
@@ -133,7 +133,7 @@
133 */133 */
134function set_up_self_subscription_formoverlay(element_id) {134function set_up_self_subscription_formoverlay(element_id) {
135135
136 var subscribe_yourself = Y.get('#selfsubscription');136 var subscribe_yourself = Y.one('#selfsubscription');
137137
138 if (subscribe_yourself !== null) {138 if (subscribe_yourself !== null) {
139139
@@ -158,8 +158,8 @@
158 /* XXX: rockstar - bug=389185 - The form is a bit wide for the current158 /* XXX: rockstar - bug=389185 - The form is a bit wide for the current
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.
160 */160 */
161 Y.get('#shadow').setStyle('width', '562px');161 Y.one('#shadow').setStyle('width', '562px');
162 Y.get('div#yui-pretty-overlay-modal.content_box_container').setStyle(162 Y.one('div#yui-pretty-overlay-modal.content_box_container').setStyle(
163 'width', '500px');163 'width', '500px');
164 subscribe_yourself.addClass('js-action');164 subscribe_yourself.addClass('js-action');
165 subscribe_yourself.on('click', function(e) {165 subscribe_yourself.on('click', function(e) {
@@ -176,7 +176,7 @@
176 * Hides the "Edit your subscription" link.176 * Hides the "Edit your subscription" link.
177 */177 */
178function hide_edit_your_subscription() {178function hide_edit_your_subscription() {
179 var element = Y.get('#selfsubscription');179 var element = Y.one('#selfsubscription');
180 if (element !== null) {180 if (element !== null) {
181 if (element.get('innerHTML') == 'Edit your subscription') {181 if (element.get('innerHTML') == 'Edit your subscription') {
182 element.setStyle('display', 'none');182 element.setStyle('display', 'none');
@@ -203,13 +203,13 @@
203 ' style="position:absolute;right:8px" /></div>'].join('');203 ' style="position:absolute;right:8px" /></div>'].join('');
204 var link_node = Y.Node.create(html);204 var link_node = Y.Node.create(html);
205205
206 var subscribers = Y.get('#subscriber-list');206 var subscribers = Y.one('#subscriber-list');
207 var next = subscribers.query('div')[0];207 var next = subscribers.one('div')[0];
208 if (next) {208 if (next) {
209 subscribers.insertBefore(link_node, next);209 subscribers.insertBefore(link_node, next);
210 } else {210 } else {
211 // Handle the case of the displayed "None".211 // Handle the case of the displayed "None".
212 var none_subscribers = Y.get('#none-subscribers');212 var none_subscribers = Y.one('#none-subscribers');
213 if (none_subscribers) {213 if (none_subscribers) {
214 var none_parent = none_subscribers.get('parentNode');214 var none_parent = none_subscribers.get('parentNode');
215 none_parent.removeChild(none_subscribers);215 none_parent.removeChild(none_subscribers);
@@ -261,7 +261,7 @@
261261
262262
263function animate_subscription_update() {263function animate_subscription_update() {
264 var element = Y.get('#subscriber-' + user_name);264 var element = Y.one('#subscriber-' + user_name);
265 var anim = Y.lazr.anim.green_flash({node: element});265 var anim = Y.lazr.anim.green_flash({node: element});
266 anim.run();266 anim.run();
267}267}
268268
=== modified file 'lib/canonical/launchpad/javascript/code/codereview.js'
--- lib/canonical/launchpad/javascript/code/codereview.js 2009-10-28 16:49:59 +0000
+++ lib/canonical/launchpad/javascript/code/codereview.js 2009-11-18 13:45:26 +0000
@@ -18,7 +18,7 @@
18 */18 */
19Y.codereview.connect_links = function() {19Y.codereview.connect_links = function() {
2020
21 var link = Y.get('#request-review');21 var link = Y.one('#request-review');
22 if (link !== null) {22 if (link !== null) {
23 link.addClass('js-action');23 link.addClass('js-action');
24 link.on('click', show_request_review_form);24 link.on('click', show_request_review_form);
@@ -39,7 +39,7 @@
39 reviewer_picker = Y.lp.picker.create(39 reviewer_picker = Y.lp.picker.create(
40 'ValidPersonOrTeam',40 'ValidPersonOrTeam',
41 function(result) {41 function(result) {
42 var review_type = Y.get("[id=field.review_type]").get('value');42 var review_type = Y.one("[id=field.review_type]").get('value');
43 request_reviewer(result, review_type);43 request_reviewer(result, review_type);
44 },44 },
45 config);45 config);
@@ -67,7 +67,7 @@
67 '<img src="/@@/spinner" />',67 '<img src="/@@/spinner" />',
68 'Requesting review...',68 'Requesting review...',
69 '</td></tr>'].join(""));69 '</td></tr>'].join(""));
70 var last_element = Y.get('#email-review');70 var last_element = Y.one('#email-review');
71 var reviewer_table = last_element.get('parentNode');71 var reviewer_table = last_element.get('parentNode');
72 reviewer_table.insertBefore(table_row, last_element);72 reviewer_table.insertBefore(table_row, last_element);
7373
@@ -110,11 +110,11 @@
110 Y.io(VOTES_TABLE_PATH, {110 Y.io(VOTES_TABLE_PATH, {
111 on: {111 on: {
112 success: function(id, response) {112 success: function(id, response) {
113 var target = Y.get('#votes-target');113 var target = Y.one('#votes-target');
114 target.set('innerHTML', response.responseText);114 target.set('innerHTML', response.responseText);
115115
116 Y.codereview.connect_links();116 Y.codereview.connect_links();
117 var new_reviewer = Y.get('#review-' + username);117 var new_reviewer = Y.one('#review-' + username);
118 var anim = Y.lazr.anim.green_flash({node: new_reviewer});118 var anim = Y.lazr.anim.green_flash({node: new_reviewer});
119 anim.run();119 anim.run();
120 },120 },
@@ -147,11 +147,11 @@
147 var ui = Y.Node.create('<li><label>' +147 var ui = Y.Node.create('<li><label>' +
148 '<input type="checkbox" checked="checked" id="show-no"/>' +148 '<input type="checkbox" checked="checked" id="show-no"/>' +
149 '&nbsp;Show line numbers</label></li>');149 '&nbsp;Show line numbers</label></li>');
150 var ul = Y.get('#review-diff div div ul.horizontal');150 var ul = Y.one('#review-diff div div ul.horizontal');
151 ul.appendChild(ui);151 ul.appendChild(ui);
152 },152 },
153 bindUI: function(){153 bindUI: function(){
154 Y.get('#show-no').on('click', update_nos);154 Y.one('#show-no').on('click', update_nos);
155 }155 }
156});156});
157157
158158
=== modified file 'lib/canonical/launchpad/javascript/lp/calendar.js'
--- lib/canonical/launchpad/javascript/lp/calendar.js 2009-07-17 00:26:05 +0000
+++ lib/canonical/launchpad/javascript/lp/calendar.js 2009-11-18 13:45:26 +0000
@@ -125,7 +125,7 @@
125125
126 // Ensure that when the ok button is click, the calendar's126 // Ensure that when the ok button is click, the calendar's
127 // selectEvent is fired and the calendar closed.127 // selectEvent is fired and the calendar closed.
128 var ok_button = time_selector_node.query('.lazr-btn');128 var ok_button = time_selector_node.one('.lazr-btn');
129 Y.on("click", function(e) {129 Y.on("click", function(e) {
130 calendar_widget.selectEvent.fire();130 calendar_widget.selectEvent.fire();
131 calendar_widget.hide();131 calendar_widget.hide();
@@ -153,9 +153,9 @@
153153
154 if (is_datetime_widget) {154 if (is_datetime_widget) {
155 hours = pad_with_zero(155 hours = pad_with_zero(
156 time_selector_node.query('.hours').get('value'));156 time_selector_node.one('.hours').get('value'));
157 minutes = pad_with_zero(157 minutes = pad_with_zero(
158 time_selector_node.query('.minutes').get('value'));158 time_selector_node.one('.minutes').get('value'));
159 value_string += " " + hours + ":" + minutes;159 value_string += " " + hours + ":" + minutes;
160 }160 }
161161
162162
=== modified file 'lib/canonical/launchpad/javascript/lp/comment.js'
--- lib/canonical/launchpad/javascript/lp/comment.js 2009-10-28 14:56:45 +0000
+++ lib/canonical/launchpad/javascript/lp/comment.js 2009-11-18 13:45:26 +0000
@@ -20,7 +20,7 @@
20 */20 */
21 initializer: function() {21 initializer: function() {
22 this.submit_button = this.get_submit();22 this.submit_button = this.get_submit();
23 this.comment_input = Y.get('[id="field.comment"]');23 this.comment_input = Y.one('[id="field.comment"]');
24 this.lp_client = new LP.client.Launchpad();24 this.lp_client = new LP.client.Launchpad();
25 this.error_handler = new LP.client.ErrorHandler();25 this.error_handler = new LP.client.ErrorHandler();
26 this.error_handler.clearProgressUI = bind(this.clearProgressUI, this);26 this.error_handler.clearProgressUI = bind(this.clearProgressUI, this);
@@ -39,7 +39,7 @@
39 * @method get_submit39 * @method get_submit
40 */40 */
41 get_submit: function(){41 get_submit: function(){
42 return Y.get('[id="field.actions.save"]');42 return Y.one('[id="field.actions.save"]');
43 },43 },
44 /**44 /**
45 * Implementation of Widget.renderUI.45 * Implementation of Widget.renderUI.
@@ -131,7 +131,7 @@
131 * @param message_html The HTML of the comment to insert.131 * @param message_html The HTML of the comment to insert.
132 */132 */
133 insert_comment_HTML: function(message_html) {133 insert_comment_HTML: function(message_html) {
134 var fieldset = Y.get('#add-comment-form');134 var fieldset = Y.one('#add-comment-form');
135 var comment = Y.Node.create(message_html);135 var comment = Y.Node.create(message_html);
136 fieldset.get('parentNode').insertBefore(comment, fieldset);136 fieldset.get('parentNode').insertBefore(comment, fieldset);
137 this.reset_contents();137 this.reset_contents();
@@ -209,8 +209,8 @@
209 * @method initializer209 * @method initializer
210 */210 */
211 initializer: function() {211 initializer: function() {
212 this.vote_input = Y.get('[id="field.vote"]');212 this.vote_input = Y.one('[id="field.vote"]');
213 this.review_type = Y.get('[id="field.review_type"]');213 this.review_type = Y.one('[id="field.review_type"]');
214 this.in_reply_to = null;214 this.in_reply_to = null;
215 },215 },
216 /**216 /**
@@ -219,7 +219,7 @@
219 * @method get_submit219 * @method get_submit
220 */220 */
221 get_submit: function(){221 get_submit: function(){
222 return Y.get('[id="field.actions.add"]');222 return Y.one('[id="field.actions.add"]');
223 },223 },
224 /**224 /**
225 * Return the vote value selected, or null if none is selected.225 * Return the vote value selected, or null if none is selected.
@@ -313,7 +313,7 @@
313 reply_link.length - '+reply'.length);313 reply_link.length - '+reply'.length);
314 var object_url = '/api/beta' + root_url;314 var object_url = '/api/beta' + root_url;
315 this.activateProgressUI('Loading...');315 this.activateProgressUI('Loading...');
316 window.scrollTo(0, Y.get('label [for=field.vote]').getY());316 window.scrollTo(0, Y.one('label [for=field.vote]').getY());
317 this.lp_client.get(object_url, {317 this.lp_client.get(object_url, {
318 on: {318 on: {
319 success: bind(function(comment){319 success: bind(function(comment){
@@ -352,7 +352,7 @@
352 * @param message_html The HTML of the comment to insert.352 * @param message_html The HTML of the comment to insert.
353 */353 */
354 insert_comment_HTML: function(message_html){354 insert_comment_HTML: function(message_html){
355 var conversation = Y.get('[id=conversation]');355 var conversation = Y.one('[id=conversation]');
356 var comment = Y.Node.create(message_html);356 var comment = Y.Node.create(message_html);
357 conversation.appendChild(comment);357 conversation.appendChild(comment);
358 this.reset_contents();358 this.reset_contents();
@@ -360,7 +360,7 @@
360 },360 },
361 renderUI: function() {361 renderUI: function() {
362 CodeReviewComment.superclass.renderUI.apply(this);362 CodeReviewComment.superclass.renderUI.apply(this);
363 Y.get('#inline-add-comment').setStyle('display', 'block');363 Y.one('#inline-add-comment').setStyle('display', 'block');
364 },364 },
365 /**365 /**
366 * Implementation of Widget.bindUI: Bind events to methods.366 * Implementation of Widget.bindUI: Bind events to methods.
367367
=== modified file 'lib/canonical/launchpad/javascript/lp/lp.js'
--- lib/canonical/launchpad/javascript/lp/lp.js 2009-07-24 12:32:28 +0000
+++ lib/canonical/launchpad/javascript/lp/lp.js 2009-11-18 13:45:26 +0000
@@ -61,8 +61,8 @@
61 */61 */
62 Y.lp.toggle_collapsible = function(collapsible) {62 Y.lp.toggle_collapsible = function(collapsible) {
63 // Find the collapse icon and wrapper div for this collapsible.63 // Find the collapse icon and wrapper div for this collapsible.
64 var icon = collapsible.query('.collapseIcon');64 var icon = collapsible.one('.collapseIcon');
65 var wrapper_div = collapsible.query('.collapseWrapper');65 var wrapper_div = collapsible.one('.collapseWrapper');
6666
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.
68 if (wrapper_div === null) {68 if (wrapper_div === null) {
@@ -102,131 +102,129 @@
102 */102 */
103 Y.lp.activate_collapsibles = function() {103 Y.lp.activate_collapsibles = function() {
104 // Grab the collapsibles.104 // Grab the collapsibles.
105 var collapsibles = Y.all('.collapsible');105 Y.all('.collapsible').each(function(collapsible) {
106 if (collapsibles !== null) {106
107 Y.each(collapsibles, function(collapsible) {107 var legend = collapsible.one('legend');
108 var legend = collapsible.query('legend');108 if (legend === null ||
109 if (legend === null ||109 legend.one('.collapseIcon') !== null) {
110 legend.query('.collapseIcon') !== null) {110 // If there's no legend there's not much we can do,
111 // If there's no legend there's not much we can do,111 // so just exit this iteration. If there's a
112 // so just exit this iteration. If there's a112 // collapseIcon in there we consider the collapsible
113 // collapseIcon in there we consider the collapsible113 // to already have been set up and therefore ignore
114 // to already have been set up and therefore ignore114 // it this time around.
115 // it this time around.115 return;
116 return;116 }
117 }117
118118 var icon = Y.Node.create(
119 var icon = Y.Node.create(119 '<img src="/@@/treeExpanded" class="collapseIcon" />');
120 '<img src="/@@/treeExpanded" class="collapseIcon" />');120
121121 // We use javascript:void(0) here (though it will cause
122 // We use javascript:void(0) here (though it will cause122 // lint to complain) because it prevents clicking on the
123 // lint to complain) because it prevents clicking on the123 // anchor from altering the page URL, which can subtly
124 // anchor from altering the page URL, which can subtly124 // break things.
125 // break things.125 var anchor = Y.Node.create(
126 var anchor = Y.Node.create(126 '<a href="javascript:void(0);"></a>');
127 '<a href="javascript:void(0);"></a>');127 anchor.appendChild(icon);
128 anchor.appendChild(icon);128
129129 // Move the contents of the legend into the span. We use
130 // Move the contents of the legend into the span. We use130 // the verbose version of <span /> to avoid silly
131 // the verbose version of <span /> to avoid silly131 // breakages in Firefox.
132 // breakages in Firefox.132 var span = Y.Node.create('<span></span>');
133 var span = Y.Node.create('<span></span>');133 var legend_children = legend.get('children');
134 var legend_children = legend.get('children');134 var len;
135 var len;135
136136 if (Y.Lang.isValue(legend_children)) {
137 if (Y.Lang.isValue(legend_children)) {137 // XXX 2009-07-06 gmb Account for oddness from
138 // XXX 2009-07-06 gmb Account for oddness from138 // Node.get('children'); (see YUI ticket 2528028 for
139 // Node.get('children'); (see YUI ticket 2528028 for139 // details).
140 // details).140 len = legend_children.size ?
141 len = legend_children.size ?141 legend_children.size() : legend_children.length;
142 legend_children.size() : legend_children.length;142 } else {
143 } else {143 len = 0;
144 len = 0;144 }
145 }145
146146 if (len > 0) {
147 if (len > 0) {147 // If the legend has child elements, move them
148 // If the legend has child elements, move them148 // across one by one.
149 // across one by one.149 Y.each(legend_children, function(child_node) {
150 Y.each(legend_children, function(child_node) {150 if (child_node.get('tagName') == 'A') {
151 if (child_node.get('tagName') == 'A') {151 // If this child is an anchor, add only its
152 // If this child is an anchor, add only its152 // contents to the span.
153 // contents to the span.153 new_node = Y.Node.create(
154 new_node = Y.Node.create(154 child_node.get('innerHTML'));
155 child_node.get('innerHTML'));155 span.appendChild(new_node);
156 span.appendChild(new_node);156 legend.removeChild(child_node);
157 legend.removeChild(child_node);157 } else {
158 } else {158 // Otherwise, add the node to the span as it
159 // Otherwise, add the node to the span as it159 // is.
160 // is.160 span.appendChild(child_node);
161 span.appendChild(child_node);161 }
162 }
163 });
164 } else {
165 // Otherwise just move the innerHTML across as a
166 // block. Once the span is appended to the anchor,
167 // this will essentially turn the contents of the
168 // legend into a link.
169 span.set('innerHTML', legend.get('innerHTML'));
170 legend.set('innerHTML', '');
171 }
172
173 // Replace the contents of the legend with the anchor.
174 anchor.appendChild(span);
175 legend.appendChild(anchor);
176
177 // Put a wrapper around the fieldset contents for ease
178 // of hiding.
179 var wrapper_div = Y.Node.create(
180 '<div class="collapseWrapper" />');
181
182 // Loop over the children of the collapsible and move them
183 // into the wrapper div. We remove the legend from the
184 // collapsible at this point to make sure it gets left
185 // outside the wrapper div; we'll add it again later.
186 collapsible.removeChild(legend);
187
188 // "Why do this as a while?" I hear you cry. Well, it's
189 // because using Y.each() leads to interesting results
190 // in FF3.5, Opera and Chrome, since by doing
191 // appendChild() with each child node (and thus removing
192 // them from the collapsible) means you're altering the
193 // collection as you're looping over it, which is a Bad
194 // Thing. This isn't as pretty but it actually works.
195 var first_child = collapsible.query(':first-child');
196 while (Y.Lang.isValue(first_child)) {
197 wrapper_div.appendChild(first_child);
198 first_child = collapsible.query(':first-child');
199 }
200
201 // Put the legend and the new wrapper div into the
202 // collapsible in the right order.
203 collapsible.appendChild(legend);
204 collapsible.appendChild(wrapper_div);
205
206 // If the collapsible is to be collapsed on pageload, do
207 // so.
208 if (collapsible.hasClass('collapsed')) {
209 // Strip out the 'collapsed' class as it's no longer
210 // needed.
211 collapsible.removeClass('collapsed');
212
213 // We use the slide_in effect to hide the
214 // collapsible because it sets up all the properties
215 // and classes for the element properly and saves us
216 // from embarrasment later on.
217 var slide_in = Y.lazr.effects.slide_in(wrapper_div);
218 slide_in.run();
219
220 icon.set('src', '/@@/treeCollapsed');
221 }
222
223 // Finally, add toggle_collapsible() as an onclick
224 // handler to the anchor.
225 anchor.on('click', function(e) {
226 Y.lp.toggle_collapsible(collapsible);
227 });162 });
163 } else {
164 // Otherwise just move the innerHTML across as a
165 // block. Once the span is appended to the anchor,
166 // this will essentially turn the contents of the
167 // legend into a link.
168 span.set('innerHTML', legend.get('innerHTML'));
169 legend.set('innerHTML', '');
170 }
171
172 // Replace the contents of the legend with the anchor.
173 anchor.appendChild(span);
174 legend.appendChild(anchor);
175
176 // Put a wrapper around the fieldset contents for ease
177 // of hiding.
178 var wrapper_div = Y.Node.create(
179 '<div class="collapseWrapper" />');
180
181 // Loop over the children of the collapsible and move them
182 // into the wrapper div. We remove the legend from the
183 // collapsible at this point to make sure it gets left
184 // outside the wrapper div; we'll add it again later.
185 collapsible.removeChild(legend);
186
187 // "Why do this as a while?" I hear you cry. Well, it's
188 // because using Y.each() leads to interesting results
189 // in FF3.5, Opera and Chrome, since by doing
190 // appendChild() with each child node (and thus removing
191 // them from the collapsible) means you're altering the
192 // collection as you're looping over it, which is a Bad
193 // Thing. This isn't as pretty but it actually works.
194 var first_child = collapsible.one(':first-child');
195 while (Y.Lang.isValue(first_child)) {
196 wrapper_div.appendChild(first_child);
197 first_child = collapsible.one(':first-child');
198 }
199
200 // Put the legend and the new wrapper div into the
201 // collapsible in the right order.
202 collapsible.appendChild(legend);
203 collapsible.appendChild(wrapper_div);
204
205 // If the collapsible is to be collapsed on pageload, do
206 // so.
207 if (collapsible.hasClass('collapsed')) {
208 // Strip out the 'collapsed' class as it's no longer
209 // needed.
210 collapsible.removeClass('collapsed');
211
212 // We use the slide_in effect to hide the
213 // collapsible because it sets up all the properties
214 // and classes for the element properly and saves us
215 // from embarrasment later on.
216 var slide_in = Y.lazr.effects.slide_in(wrapper_div);
217 slide_in.run();
218
219 icon.set('src', '/@@/treeCollapsed');
220 }
221
222 // Finally, add toggle_collapsible() as an onclick
223 // handler to the anchor.
224 anchor.on('click', function(e) {
225 Y.lp.toggle_collapsible(collapsible);
228 });226 });
229 }227 });
230 };228 };
231229
232}, '0.1', {requires:['cookie', 'lazr.effects']});230}, '0.1', {requires:['cookie', 'lazr.effects']});
233231
=== modified file 'lib/canonical/launchpad/javascript/lp/mapping.js'
--- lib/canonical/launchpad/javascript/lp/mapping.js 2009-10-16 09:25:45 +0000
+++ lib/canonical/launchpad/javascript/lp/mapping.js 2009-11-18 13:45:26 +0000
@@ -102,16 +102,16 @@
102 */102 */
103 mapping.setLocation = function(lat, lng, geoname,103 mapping.setLocation = function(lat, lng, geoname,
104 tz_name, lat_name, lng_name) {104 tz_name, lat_name, lng_name) {
105 Y.get(Y.DOM.byId(lat_name)).set('value', lat);105 Y.one(Y.DOM.byId(lat_name)).set('value', lat);
106 Y.get(Y.DOM.byId(lng_name)).set('value', lng);106 Y.one(Y.DOM.byId(lng_name)).set('value', lng);
107 var spinner = Y.get('#tz_spinner');107 var spinner = Y.one('#tz_spinner');
108 spinner.set('src', '/@@/spinner');108 spinner.set('src', '/@@/spinner');
109109
110 function succeeded() {110 function succeeded() {
111 if (request.readyState == 4) {111 if (request.readyState == 4) {
112 if (request.responseText) {112 if (request.responseText) {
113 var tz = request.responseJSON.timezoneId;113 var tz = request.responseJSON.timezoneId;
114 Y.get(Y.DOM.byId(tz_name)).set('value', tz);114 Y.one(Y.DOM.byId(tz_name)).set('value', tz);
115 spinner.set('src', '/@@/nospin');115 spinner.set('src', '/@@/nospin');
116 }116 }
117 }117 }
@@ -164,7 +164,7 @@
164 var label = Y.Node.create('<label></label>');164 var label = Y.Node.create('<label></label>');
165 label.appendChild(checkbox);165 label.appendChild(checkbox);
166 label.appendChild(label_text);166 label.appendChild(label_text);
167 var action_div = Y.get(div_id);167 var action_div = Y.one(div_id);
168 action_div.appendChild(label);168 action_div.appendChild(label);
169 if (!show_small_maps) {169 if (!show_small_maps) {
170 mapping.toggleShowSmallMaps(checkbox);170 mapping.toggleShowSmallMaps(checkbox);
171171
=== modified file 'lib/canonical/launchpad/javascript/lp/picker.js'
--- lib/canonical/launchpad/javascript/lp/picker.js 2009-09-28 11:51:08 +0000
+++ lib/canonical/launchpad/javascript/lp/picker.js 2009-11-18 13:45:26 +0000
@@ -42,7 +42,7 @@
42 }42 }
43 }43 }
4444
45 var content_box = Y.get('#' + content_box_id);45 var content_box = Y.one('#' + content_box_id);
4646
47 var activator = new Y.lazr.activator.Activator(47 var activator = new Y.lazr.activator.Activator(
48 {contentBox: content_box});48 {contentBox: content_box});
@@ -56,7 +56,7 @@
56 };56 };
5757
58 var show_hide_buttons = function () {58 var show_hide_buttons = function () {
59 var link = content_box.query('.yui-activator-data-box a');59 var link = content_box.one('.yui-activator-data-box a');
60 if (remove_button) {60 if (remove_button) {
61 if (link === null || !show_remove_button) {61 if (link === null || !show_remove_button) {
62 remove_button.addClass('yui-picker-hidden');62 remove_button.addClass('yui-picker-hidden');
@@ -89,7 +89,7 @@
89 if (element.tagName == 'DD') {89 if (element.tagName == 'DD') {
90 if (current_field == attribute_name) {90 if (current_field == attribute_name) {
91 // The field value is found91 // The field value is found
92 node = Y.get(element).query('span');92 node = Y.one(element).one('span');
93 } else if (current_field == 'self_link') {93 } else if (current_field == 'self_link') {
94 picker._resource_uri = element.innerHTML;94 picker._resource_uri = element.innerHTML;
95 }95 }
@@ -230,7 +230,7 @@
230230
231 picker.subscribe('save', function (e) {231 picker.subscribe('save', function (e) {
232 Y.log('Got save event.');232 Y.log('Got save event.');
233 // Y.get() uses CSS3 selectors which don't work with ids containing233 // Y.one() uses CSS3 selectors which don't work with ids containing
234 // a period, so we have to use Y.DOM.byId().234 // a period, so we have to use Y.DOM.byId().
235 save(e.details[Y.Picker.SAVE_RESULT]);235 save(e.details[Y.Picker.SAVE_RESULT]);
236 });236 });
237237
=== modified file 'lib/canonical/launchpad/javascript/lp/tests/test_lp_collapsibles.js'
--- lib/canonical/launchpad/javascript/lp/tests/test_lp_collapsibles.js 2009-07-08 17:21:50 +0000
+++ lib/canonical/launchpad/javascript/lp/tests/test_lp_collapsibles.js 2009-11-18 13:45:26 +0000
@@ -39,7 +39,7 @@
39 this.default_fieldset_content_node));39 this.default_fieldset_content_node));
4040
41 // Reset the container to its default contents.41 // Reset the container to its default contents.
42 this.container = Y.get('#container-of-stuff');42 this.container = Y.one('#container-of-stuff');
43 this.container.set('innerHTML', '');43 this.container.set('innerHTML', '');
44 this.container.appendChild(44 this.container.appendChild(
45 this.default_fieldset_node.cloneNode(45 this.default_fieldset_node.cloneNode(
@@ -51,7 +51,7 @@
51 // business of toggling the collapsible open and shut.51 // business of toggling the collapsible open and shut.
52 Y.lp.activate_collapsibles();52 Y.lp.activate_collapsibles();
5353
54 var anchor = this.container.query('a');54 var anchor = this.container.one('a');
55 Assert.isNotNull(55 Assert.isNotNull(
56 anchor, "activate_collapsibles() should create an anchor");56 anchor, "activate_collapsibles() should create an anchor");
5757
@@ -65,8 +65,8 @@
65 // creates.65 // creates.
66 Y.lp.activate_collapsibles();66 Y.lp.activate_collapsibles();
6767
68 var anchor = this.container.query('a');68 var anchor = this.container.one('a');
69 var icon = anchor.query('img');69 var icon = anchor.one('img');
7070
71 Assert.isNotNull(71 Assert.isNotNull(
72 icon,72 icon,
@@ -83,8 +83,8 @@
83 // activate_collapsibles() adds a span to the anchor it creates.83 // activate_collapsibles() adds a span to the anchor it creates.
84 Y.lp.activate_collapsibles();84 Y.lp.activate_collapsibles();
8585
86 var anchor = this.container.query('a');86 var anchor = this.container.one('a');
87 var span = anchor.query('span');87 var span = anchor.one('span');
8888
89 Assert.isNotNull(89 Assert.isNotNull(
90 span,90 span,
@@ -108,22 +108,22 @@
108 wrapper_div,108 wrapper_div,
109 "activate_collapsibles() should add a wrapper div");109 "activate_collapsibles() should add a wrapper div");
110110
111 var collapsible = this.container.query('.collapsible');111 var collapsible = this.container.one('.collapsible');
112 Assert.isNotNull(112 Assert.isNotNull(
113 collapsible.query('.collapseWrapper'),113 collapsible.one('.collapseWrapper'),
114 "The collapseWrapper div should be within the collapsible.");114 "The collapseWrapper div should be within the collapsible.");
115 },115 },
116116
117 test_activate_collapsibles_collapses_collapsed: function() {117 test_activate_collapsibles_collapses_collapsed: function() {
118 // If a collapsible has the class 'collapsed',118 // If a collapsible has the class 'collapsed',
119 // activate_collapsibles() will pre-collapse it.119 // activate_collapsibles() will pre-collapse it.
120 var collapsible = this.container.query('.collapsible');120 var collapsible = this.container.one('.collapsible');
121 collapsible.addClass('collapsed');121 collapsible.addClass('collapsed');
122122
123 Y.lp.activate_collapsibles();123 Y.lp.activate_collapsibles();
124124
125 var icon = collapsible.query('img');125 var icon = collapsible.one('img');
126 var wrapper_div = collapsible.query('.collapseWrapper');126 var wrapper_div = collapsible.one('.collapseWrapper');
127 this.wait(function() {127 this.wait(function() {
128 Assert.isTrue(wrapper_div.hasClass('lazr-closed'));128 Assert.isTrue(wrapper_div.hasClass('lazr-closed'));
129 Assert.areNotEqual(129 Assert.areNotEqual(
@@ -136,9 +136,9 @@
136 // won't be pre-collapsed.136 // won't be pre-collapsed.
137 Y.lp.activate_collapsibles();137 Y.lp.activate_collapsibles();
138138
139 var collapsible = this.container.query('.collapsible');139 var collapsible = this.container.one('.collapsible');
140 var icon = collapsible.query('img');140 var icon = collapsible.one('img');
141 var wrapper_div = collapsible.query('.collapseWrapper');141 var wrapper_div = collapsible.one('.collapseWrapper');
142 this.wait(function() {142 this.wait(function() {
143 Assert.isFalse(wrapper_div.hasClass('lazr-closed'));143 Assert.isFalse(wrapper_div.hasClass('lazr-closed'));
144 Assert.areNotEqual(144 Assert.areNotEqual(
@@ -149,7 +149,7 @@
149 test_toggle_collapsible_opens_collapsed_collapsible: function() {149 test_toggle_collapsible_opens_collapsed_collapsible: function() {
150 // Calling toggle_collapsible() on a collapsed collapsible will150 // Calling toggle_collapsible() on a collapsed collapsible will
151 // toggle its state to open.151 // toggle its state to open.
152 var collapsible = this.container.query('.collapsible');152 var collapsible = this.container.one('.collapsible');
153 collapsible.addClass('collapsed');153 collapsible.addClass('collapsed');
154154
155 Y.lp.activate_collapsibles();155 Y.lp.activate_collapsibles();
@@ -157,8 +157,8 @@
157 this.wait(function() {157 this.wait(function() {
158158
159 // The collapsible's wrapper div will now be open.159 // The collapsible's wrapper div will now be open.
160 var icon = collapsible.query('img');160 var icon = collapsible.one('img');
161 var wrapper_div = collapsible.query('.collapseWrapper');161 var wrapper_div = collapsible.one('.collapseWrapper');
162 Assert.isTrue(wrapper_div.hasClass('lazr-open'));162 Assert.isTrue(wrapper_div.hasClass('lazr-open'));
163 Assert.areNotEqual(163 Assert.areNotEqual(
164 -1, icon.get('src').indexOf('/@@/treeExpanded');164 -1, icon.get('src').indexOf('/@@/treeExpanded');
@@ -168,15 +168,15 @@
168 test_toggle_collapsible_closes_open_collapsible: function() {168 test_toggle_collapsible_closes_open_collapsible: function() {
169 // Calling toggle_collapsible() on an open collapsible will169 // Calling toggle_collapsible() on an open collapsible will
170 // toggle its state to closed.170 // toggle its state to closed.
171 var collapsible = this.container.query('.collapsible');171 var collapsible = this.container.one('.collapsible');
172172
173 Y.lp.activate_collapsibles();173 Y.lp.activate_collapsibles();
174 Y.lp.toggle_collapsible(collapsible);174 Y.lp.toggle_collapsible(collapsible);
175175
176 this.wait(function() {176 this.wait(function() {
177 // The collapsible's wrapper div will now be closed.177 // The collapsible's wrapper div will now be closed.
178 var icon = collapsible.query('img');178 var icon = collapsible.one('img');
179 var wrapper_div = collapsible.query('.collapseWrapper');179 var wrapper_div = collapsible.one('.collapseWrapper');
180 Assert.isTrue(wrapper_div.hasClass('lazr-closed'));180 Assert.isTrue(wrapper_div.hasClass('lazr-closed'));
181 Assert.areNotEqual(181 Assert.areNotEqual(
182 -1, icon.get('src').indexOf('/@@/treeCollapsed'));182 -1, icon.get('src').indexOf('/@@/treeCollapsed'));
@@ -220,13 +220,13 @@
220 ' <p>No legend!</p>' +220 ' <p>No legend!</p>' +
221 '</fieldset>');221 '</fieldset>');
222222
223 var valid_collapsible = this.container.query('.collapsible');223 var valid_collapsible = this.container.one('.collapsible');
224 this.container.insertBefore(invalid_collapsible, valid_collapsible);224 this.container.insertBefore(invalid_collapsible, valid_collapsible);
225 Y.lp.activate_collapsibles();225 Y.lp.activate_collapsibles();
226226
227 // The standard, valid collapsible is still set up correctly.227 // The standard, valid collapsible is still set up correctly.
228 Assert.isNotNull(228 Assert.isNotNull(
229 valid_collapsible.query('.collapseWrapper'),229 valid_collapsible.one('.collapseWrapper'),
230 "activate_collapsibles() should have added a wrapper div for " +230 "activate_collapsibles() should have added a wrapper div for " +
231 "the valid collapsible.");231 "the valid collapsible.");
232 },232 },
@@ -243,9 +243,9 @@
243 }243 }
244244
245 Y.lp.activate_collapsibles();245 Y.lp.activate_collapsibles();
246 Y.each(Y.all('.collapsible'), function(collapsible) {246 Y.all('.collapsible').each(function(collapsible) {
247 Assert.isNotNull(247 Assert.isNotNull(
248 collapsible.query('.collapseWrapper'),248 collapsible.one('.collapseWrapper'),
249 "activate_collapsibles() should have added a wrapper div " +249 "activate_collapsibles() should have added a wrapper div " +
250 "to all collapsibles.");250 "to all collapsibles.");
251 });251 });
@@ -279,9 +279,9 @@
279 this.container.appendChild(new_collapsible);279 this.container.appendChild(new_collapsible);
280 Y.lp.activate_collapsibles();280 Y.lp.activate_collapsibles();
281281
282 var collapsible = this.container.query('.collapsible');282 var collapsible = this.container.one('.collapsible');
283 Assert.isNull(283 Assert.isNull(
284 this.container.query('#should-be-removed'),284 this.container.one('#should-be-removed'),
285 "The should-be-removed link should have been removed");285 "The should-be-removed link should have been removed");
286 },286 },
287287
@@ -289,24 +289,24 @@
289 // If activate_collapsibles() has already been called, calling289 // If activate_collapsibles() has already been called, calling
290 // it again won't break the existing collapsibles.290 // it again won't break the existing collapsibles.
291 Y.lp.activate_collapsibles();291 Y.lp.activate_collapsibles();
292 var collapsible = this.container.query('.collapsible');292 var collapsible = this.container.one('.collapsible');
293 var anchor = collapsible.query('a');293 var anchor = collapsible.one('a');
294 var span = anchor.query('span');294 var span = anchor.one('span');
295 var original_span_contents = span.get('innerHTML');295 var original_span_contents = span.get('innerHTML');
296 var wrapper = collapsible.query('.collapseWrapper');296 var wrapper = collapsible.one('.collapseWrapper');
297 var original_wrapper_contents = wrapper.get('innerHTML');297 var original_wrapper_contents = wrapper.get('innerHTML');
298298
299 // Calling activate_collapsibles() shouldn't break things.299 // Calling activate_collapsibles() shouldn't break things.
300 Y.lp.activate_collapsibles();300 Y.lp.activate_collapsibles();
301 collapsible = this.container.query('.collapsible');301 collapsible = this.container.one('.collapsible');
302 anchor = collapsible.query('a');302 anchor = collapsible.one('a');
303 span = anchor.query('span');303 span = anchor.one('span');
304 wrapper = collapsible.query('.collapseWrapper');304 wrapper = collapsible.one('.collapseWrapper');
305305
306 Assert.isNotNull(306 Assert.isNotNull(
307 anchor, "Existing collapsibles' anchors should be intact.");307 anchor, "Existing collapsibles' anchors should be intact.");
308308
309 var icon = anchor.query('img');309 var icon = anchor.one('img');
310 Assert.isNotNull(310 Assert.isNotNull(
311 icon,311 icon,
312 "Existing collapsibles' icons should be intact.");312 "Existing collapsibles' icons should be intact.");
313313
=== modified file 'lib/canonical/launchpad/javascript/registry/milestone_table.js'
--- lib/canonical/launchpad/javascript/registry/milestone_table.js 2009-06-19 20:35:13 +0000
+++ lib/canonical/launchpad/javascript/registry/milestone_table.js 2009-11-18 13:45:26 +0000
@@ -101,7 +101,7 @@
101 "Undefined properties in setup config for milestonetable.");101 "Undefined properties in setup config for milestonetable.");
102 }102 }
103 self._milestone_row_uri_template = config.milestone_row_uri_template;103 self._milestone_row_uri_template = config.milestone_row_uri_template;
104 self._tbody = Y.get(config.milestone_rows_id);104 self._tbody = Y.one(config.milestone_rows_id);
105 if (self._tbody === null) {105 if (self._tbody === null) {
106 throw new Error(106 throw new Error(
107 Y.substitute("'{milestone_rows_id}' not in page.", config));107 Y.substitute("'{milestone_rows_id}' not in page.", config));
108108
=== modified file 'lib/canonical/launchpad/javascript/registry/milestoneoverlay.js'
--- lib/canonical/launchpad/javascript/registry/milestoneoverlay.js 2009-08-13 13:36:02 +0000
+++ lib/canonical/launchpad/javascript/registry/milestoneoverlay.js 2009-11-18 13:45:26 +0000
@@ -32,7 +32,7 @@
32 milestone_form.clearError();32 milestone_form.clearError();
33 milestone_form.hide();33 milestone_form.hide();
34 // Reset the HTML form inside the widget.34 // Reset the HTML form inside the widget.
35 milestone_form.get('contentBox').query('form').reset();35 milestone_form.get('contentBox').one('form').reset();
36 next_step(parameters);36 next_step(parameters);
37 };37 };
3838
@@ -42,7 +42,7 @@
42 on: {42 on: {
43 success: finish_new_milestone,43 success: finish_new_milestone,
44 failure: function (ignore, response, args) {44 failure: function (ignore, response, args) {
45 var error_box = Y.get('#milestone-error');45 var error_box = Y.one('#milestone-error');
46 var error_message = '<strong>' + response.statusText +46 var error_message = '<strong>' + response.statusText +
47 '</strong><p>' +47 '</strong><p>' +
48 response.responseText +48 response.responseText +
4949
=== modified file 'lib/canonical/launchpad/javascript/registry/tests/test_milestone_table.js'
--- lib/canonical/launchpad/javascript/registry/tests/test_milestone_table.js 2009-06-19 18:31:25 +0000
+++ lib/canonical/launchpad/javascript/registry/tests/test_milestone_table.js 2009-11-18 13:45:26 +0000
@@ -21,7 +21,7 @@
21 },21 },
2222
23 setUp: function() {23 setUp: function() {
24 this.tbody = Y.get('#milestone-rows');24 this.tbody = Y.one('#milestone-rows');
25 },25 },
2626
27 tearDown: function() {27 tearDown: function() {
@@ -71,7 +71,7 @@
71 name: '_setup_milestone_event_data',71 name: '_setup_milestone_event_data',
7272
73 setUp: function() {73 setUp: function() {
74 this.tbody = Y.get('#milestone-rows');74 this.tbody = Y.one('#milestone-rows');
75 },75 },
7676
77 tearDown: function() {77 tearDown: function() {
@@ -155,7 +155,7 @@
155155
156 setUp: function() {156 setUp: function() {
157 this.data = milestonetable._setup_milestone_event_data(157 this.data = milestonetable._setup_milestone_event_data(
158 {name: '0.1'}, Y.get('#milestone-rows'));158 {name: '0.1'}, Y.one('#milestone-rows'));
159 },159 },
160160
161 tearDown: function() {161 tearDown: function() {
@@ -181,7 +181,7 @@
181 this.response = {181 this.response = {
182 responseText: " <tr><td>" + this.success + "<td></tr> "};182 responseText: " <tr><td>" + this.success + "<td></tr> "};
183 this.data = milestonetable._setup_milestone_event_data(183 this.data = milestonetable._setup_milestone_event_data(
184 {name: '0.1'}, Y.get('#milestone-rows'));184 {name: '0.1'}, Y.one('#milestone-rows'));
185 // Needed to reset the DOM.185 // Needed to reset the DOM.
186 this.table = this.data.tbody.ancestor();186 this.table = this.data.tbody.ancestor();
187 this.tbody_markup = this.table.get('innerHTML');187 this.tbody_markup = this.table.get('innerHTML');
188188
=== modified file 'lib/canonical/launchpad/javascript/registry/tests/timeline.js'
--- lib/canonical/launchpad/javascript/registry/tests/timeline.js 2009-10-06 22:11:50 +0000
+++ lib/canonical/launchpad/javascript/registry/tests/timeline.js 2009-11-18 13:45:26 +0000
@@ -76,7 +76,7 @@
76 */76 */
77function simulate(widget, selector, evtype, options) {77function simulate(widget, selector, evtype, options) {
78 var bounding_box = widget.get('boundingBox');78 var bounding_box = widget.get('boundingBox');
79 var rawnode = Y.Node.getDOMNode(bounding_box.query(selector));79 var rawnode = Y.Node.getDOMNode(bounding_box.one(selector));
80 Y.Event.simulate(rawnode, evtype, options);80 Y.Event.simulate(rawnode, evtype, options);
81}81}
8282
@@ -104,24 +104,24 @@
104 "TimelineGraph was not created.");104 "TimelineGraph was not created.");
105105
106 Assert.isNotNull(106 Assert.isNotNull(
107 this.content_box.query('canvas'),107 this.content_box.one('canvas'),
108 "A canvas should have been created.");108 "A canvas should have been created.");
109 },109 },
110110
111 test_zoom_buttons: function() {111 test_zoom_buttons: function() {
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');
113 Assert.isNotNull(113 Assert.isNotNull(
114 zoom_in,114 zoom_in,
115 'zoom_in link not found.');115 'zoom_in link not found.');
116116
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');
118 Assert.isNotNull(118 Assert.isNotNull(
119 zoom_in,119 zoom_in,
120 'zoom_out link not found.');120 'zoom_out link not found.');
121 },121 },
122122
123 test_series_label: function() {123 test_series_label: function() {
124 var label = this.content_box.query('div#trunk');124 var label = this.content_box.one('div#trunk');
125 Assert.isNotNull(125 Assert.isNotNull(
126 label,126 label,
127 "Series label not found.");127 "Series label not found.");
@@ -130,7 +130,7 @@
130 label.get('title'),130 label.get('title'),
131 "Unexpected series label title.");131 "Unexpected series label title.");
132132
133 var link = label.query('a');133 var link = label.one('a');
134 Assert.isNotNull(134 Assert.isNotNull(
135 link,135 link,
136 "Series label does not contain a link.");136 "Series label does not contain a link.");
@@ -163,8 +163,8 @@
163 },163 },
164164
165 test_milestone_label_second_line: function() {165 test_milestone_label_second_line: function() {
166 var label = this.content_box.query('div#ski');166 var label = this.content_box.one('div#ski');
167 var second_line = label.query('div');167 var second_line = label.one('div');
168 Assert.areEqual(168 Assert.areEqual(
169 '2200-05-26',169 '2200-05-26',
170 second_line.get('innerHTML'),170 second_line.get('innerHTML'),
@@ -180,7 +180,7 @@
180 'This test must be run in an iframe with id=' +180 'This test must be run in an iframe with id=' +
181 this.timeline_graph.resize_frame + '.');181 this.timeline_graph.resize_frame + '.');
182182
183 var canvas = this.content_box.query('canvas');183 var canvas = this.content_box.one('canvas');
184 var first_canvas_height = canvas.get('offsetHeight');184 var first_canvas_height = canvas.get('offsetHeight');
185 Assert.areEqual(1, this.timeline_graph.graph_scale);185 Assert.areEqual(1, this.timeline_graph.graph_scale);
186 Assert.areEqual(186 Assert.areEqual(
@@ -192,7 +192,7 @@
192192
193 // The canvas is recreated in order to193 // The canvas is recreated in order to
194 // resize correctly in all browsers.194 // resize correctly in all browsers.
195 canvas = this.content_box.query('canvas');195 canvas = this.content_box.one('canvas');
196 Assert.areEqual(1.1, this.timeline_graph.graph_scale);196 Assert.areEqual(1.1, this.timeline_graph.graph_scale);
197 Assert.areEqual(197 Assert.areEqual(
198 canvas.get('offsetHeight'), frame.height,198 canvas.get('offsetHeight'), frame.height,
@@ -204,7 +204,7 @@
204 simulate(204 simulate(
205 this.timeline_graph, '.yui-timelinegraph-zoom-out', 'click');205 this.timeline_graph, '.yui-timelinegraph-zoom-out', 'click');
206206
207 canvas = this.content_box.query('canvas');207 canvas = this.content_box.one('canvas');
208 Assert.areEqual(1, this.timeline_graph.graph_scale);208 Assert.areEqual(1, this.timeline_graph.graph_scale);
209 Assert.areEqual(209 Assert.areEqual(
210 canvas.get('offsetHeight'), frame.height,210 canvas.get('offsetHeight'), frame.height,
@@ -230,7 +230,7 @@
230 },230 },
231231
232 test_milestone_label: function() {232 test_milestone_label: function() {
233 var label = this.content_box.query('div#alpha');233 var label = this.content_box.one('div#alpha');
234 Assert.isNotNull(234 Assert.isNotNull(
235 label,235 label,
236 "Milestone label not found.");236 "Milestone label not found.");
@@ -239,7 +239,7 @@
239 label.get('title'),239 label.get('title'),
240 "Unexpected milestone label title.");240 "Unexpected milestone label title.");
241241
242 var link = label.query('a');242 var link = label.one('a');
243 Assert.isNotNull(243 Assert.isNotNull(
244 link,244 link,
245 "Milestone label does not contain a link.");245 "Milestone label does not contain a link.");
@@ -253,7 +253,7 @@
253 link.get('href'),253 link.get('href'),
254 "Unexpected milestone link href.");254 "Unexpected milestone link href.");
255255
256 var second_line = label.query('div');256 var second_line = label.one('div');
257 Assert.isNull(257 Assert.isNull(
258 second_line,258 second_line,
259 "There should be no second line for landmarks when " +259 "There should be no second line for landmarks when " +
260260
=== modified file 'lib/canonical/launchpad/javascript/soyuz/archivesubscribers_index.js'
--- lib/canonical/launchpad/javascript/soyuz/archivesubscribers_index.js 2009-09-29 07:26:40 +0000
+++ lib/canonical/launchpad/javascript/soyuz/archivesubscribers_index.js 2009-11-18 13:45:26 +0000
@@ -18,22 +18,22 @@
18Y.soyuz.setup_archivesubscribers_index = function() {18Y.soyuz.setup_archivesubscribers_index = function() {
19 // If there are no errors then we hide the add-subscriber row and19 // If there are no errors then we hide the add-subscriber row and
20 // potentially the whole table if there are no subscribers.20 // potentially the whole table if there are no subscribers.
21 if (Y.Lang.isNull(Y.get('p.error.message'))) {21 if (Y.Lang.isNull(Y.one('p.error.message'))) {
2222
23 // Hide the add-subscriber row.23 // Hide the add-subscriber row.
24 var add_subscriber_row = Y.get(24 var add_subscriber_row = Y.one(
25 '#archive-subscribers .add-subscriber');25 '#archive-subscribers .add-subscriber');
26 add_subscriber_row.setStyle('display', 'none');26 add_subscriber_row.setStyle('display', 'none');
2727
28 // If there are no subscribers, then hide the complete section.28 // If there are no subscribers, then hide the complete section.
29 var subscribers = Y.get('#subscribers');29 var subscribers = Y.one('#subscribers');
30 if (Y.Lang.isObject(Y.get('#no-subscribers'))) {30 if (Y.Lang.isObject(Y.one('#no-subscribers'))) {
31 subscribers.setStyle('display', 'none');31 subscribers.setStyle('display', 'none');
32 }32 }
33 }33 }
3434
35 // Add a link to open the add-subscriber row.35 // Add a link to open the add-subscriber row.
36 var placeholder = Y.get('#add-subscriber-placeholder');36 var placeholder = Y.one('#add-subscriber-placeholder');
37 placeholder.set(37 placeholder.set(
38 'innerHTML',38 'innerHTML',
39 '<a class="js-action sprite add" href="#">Add access</a>');39 '<a class="js-action sprite add" href="#">Add access</a>');
4040
=== modified file 'lib/canonical/launchpad/javascript/soyuz/lp_dynamic_dom_updater.js'
--- lib/canonical/launchpad/javascript/soyuz/lp_dynamic_dom_updater.js 2009-06-30 21:06:27 +0000
+++ lib/canonical/launchpad/javascript/soyuz/lp_dynamic_dom_updater.js 2009-11-18 13:45:26 +0000
@@ -19,7 +19,7 @@
19 * expected format.19 * expected format.
20 *20 *
21 * For example:21 * For example:
22 * var table = Y.get('table#build-count-table');22 * var table = Y.one('table#build-count-table');
23 * var config = {23 * var config = {
24 * domUpdateFunction: updateArchiveBuildStatusSummary24 * domUpdateFunction: updateArchiveBuildStatusSummary
25 * }25 * }
@@ -93,7 +93,7 @@
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.
94 *94 *
95 * For example:95 * For example:
96 * var table = Y.get('table#build-count-table');96 * var table = Y.one('table#build-count-table');
97 * var config = {97 * var config = {
98 * domUpdateFunction: updateArchiveBuildStatusSummary,98 * domUpdateFunction: updateArchiveBuildStatusSummary,
99 * uri: LP.client.cache.context.self_link,99 * uri: LP.client.cache.context.self_link,
100100
=== modified file 'lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.js'
--- lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.js 2009-09-30 06:40:29 +0000
+++ lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.js 2009-11-18 13:45:26 +0000
@@ -17,12 +17,12 @@
17 name: 'add-subscriber',17 name: 'add-subscriber',
1818
19 setUp: function() {19 setUp: function() {
20 this.add_subscriber_placeholder = Y.get(20 this.add_subscriber_placeholder = Y.one(
21 '#add-subscriber-placeholder');21 '#add-subscriber-placeholder');
22 this.archive_subscribers_table_body = Y.get(22 this.archive_subscribers_table_body = Y.one(
23 '#archive-subscribers').query('tbody');23 '#archive-subscribers').one('tbody');
24 this.error_div = Y.get('#errors');24 this.error_div = Y.one('#errors');
25 this.subscribers_div = Y.get('#subscribers');25 this.subscribers_div = Y.one('#subscribers');
2626
2727
28 // Ensure there are no errors displayed.28 // Ensure there are no errors displayed.
@@ -48,7 +48,7 @@
48 '</tr>'48 '</tr>'
49 ].join(''));49 ].join(''));
5050
51 this.add_subscriber_row = Y.get(51 this.add_subscriber_row = Y.one(
52 '#archive-subscribers .add-subscriber');52 '#archive-subscribers .add-subscriber');
53 },53 },
5454
@@ -120,7 +120,7 @@
120 test_click_add_access_displays_add_row: function() {120 test_click_add_access_displays_add_row: function() {
121 // The add subscriber row is displayed after clicking 'Add access'.121 // The add subscriber row is displayed after clicking 'Add access'.
122 Y.soyuz.setup_archivesubscribers_index();122 Y.soyuz.setup_archivesubscribers_index();
123 var link_node = this.add_subscriber_placeholder.query('a');123 var link_node = this.add_subscriber_placeholder.one('a');
124 Assert.areEqual(124 Assert.areEqual(
125 'Add access', link_node.get('innerHTML'));125 'Add access', link_node.get('innerHTML'));
126126
127127
=== modified file 'lib/canonical/launchpad/javascript/soyuz/update_archive_build_statuses.js'
--- lib/canonical/launchpad/javascript/soyuz/update_archive_build_statuses.js 2009-08-28 16:06:56 +0000
+++ lib/canonical/launchpad/javascript/soyuz/update_archive_build_statuses.js 2009-11-18 13:45:26 +0000
@@ -36,16 +36,14 @@
36 * @config domUpdateFunction36 * @config domUpdateFunction
37 */37 */
38 domUpdateFunction: function(portlet_node, data_object){38 domUpdateFunction: function(portlet_node, data_object){
39 var counter_nodelist = portlet_node.queryAll('.build-count');
40
41 // For each node of the counter node in the portlet:39 // For each node of the counter node in the portlet:
42 counter_nodelist.each(function(node){40 portlet_node.all('.build-count').each(function(node){
43 // Check whether the node has a class matching the data name41 // Check whether the node has a class matching the data name
44 // of the passed in data, and if so, set the innerHTML to42 // of the passed in data, and if so, set the innerHTML to
45 // the corresponding value.43 // the corresponding value.
46 Y.each(data_object, function(data_value, data_name){44 Y.each(data_object, function(data_value, data_name){
47 if (node.hasClass(data_name)){45 if (node.hasClass(data_name)){
48 previous_value = node.get("innerHTML");46 var previous_value = node.get("innerHTML");
49 node.set("innerHTML", data_value);47 node.set("innerHTML", data_value);
50 // If the value changed, just put a quick anim48 // If the value changed, just put a quick anim
51 // on the parent row.49 // on the parent row.
@@ -69,7 +67,7 @@
69 */67 */
70 stopUpdatesCheckFunction: function(portlet_node){68 stopUpdatesCheckFunction: function(portlet_node){
71 // Stop updating only when there are zero pending builds:69 // Stop updating only when there are zero pending builds:
72 var pending_elem = portlet_node.query(".pending");70 var pending_elem = portlet_node.one(".pending");
73 if (pending_elem === null){71 if (pending_elem === null){
74 return true;72 return true;
75 }73 }
@@ -85,7 +83,7 @@
85 Y.on("domready", function(){83 Y.on("domready", function(){
86 // Grab the Archive build count portlet and tell it how to84 // Grab the Archive build count portlet and tell it how to
87 // update itself:85 // update itself:
88 var portlet = Y.get('div#build-status-summary');86 var portlet = Y.one('div#build-status-summary');
89 build_summary_portlet_dynamic_update_config.uri =87 build_summary_portlet_dynamic_update_config.uri =
90 LP.client.cache.context.self_link;88 LP.client.cache.context.self_link;
91 portlet.plug(Y.lp.DynamicDomUpdater,89 portlet.plug(Y.lp.DynamicDomUpdater,
@@ -114,7 +112,7 @@
114 Y.each(data_object, function(build_summary, source_id){112 Y.each(data_object, function(build_summary, source_id){
115 // Grab the related td element (and fail silently if it doesn't113 // Grab the related td element (and fail silently if it doesn't
116 // exist).114 // exist).
117 var td_elem = Y.get("#pubstatus" + source_id);115 var td_elem = Y.one("#pubstatus" + source_id);
118 if (td_elem === null) {116 if (td_elem === null) {
119 return;117 return;
120 }118 }
@@ -122,7 +120,7 @@
122 // We'll need to remember whether we've change the UI so that120 // We'll need to remember whether we've change the UI so that
123 // we can add a flash at the end if we do:121 // we can add a flash at the end if we do:
124 var td_ui_changed = false;122 var td_ui_changed = false;
125 var img_node = td_elem.query('img');123 var img_node = td_elem.one('img');
126124
127 // If the status has changed then we need to update the td125 // If the status has changed then we need to update the td
128 // element's class and image:126 // element's class and image:
@@ -145,12 +143,12 @@
145 switch(build_summary.status) {143 switch(build_summary.status) {
146 case 'BUILDING':144 case 'BUILDING':
147 new_src = '/@@/processing';145 new_src = '/@@/processing';
148 new_title = 'There are some builds currently ' + 146 new_title = 'There are some builds currently ' +
149 'building.';147 'building.';
150 break;148 break;
151 case 'NEEDSBUILD':149 case 'NEEDSBUILD':
152 new_src = '/@@/build-needed';150 new_src = '/@@/build-needed';
153 new_title = 'There are some builds waiting to ' + 151 new_title = 'There are some builds waiting to ' +
154 'be built.';152 'be built.';
155 break;153 break;
156 case 'FAILEDTOBUILD':154 case 'FAILEDTOBUILD':
@@ -215,7 +213,7 @@
215 },213 },
216214
217 /**215 /**
218 * This function evaluates the parameters required for the 216 * This function evaluates the parameters required for the
219 * getBuildSummariesForSourceIds api function, using the current217 * getBuildSummariesForSourceIds api function, using the current
220 * state of the DOM subtree (ie. It finds the ids of builds in the218 * state of the DOM subtree (ie. It finds the ids of builds in the
221 * subtree that are have a class of either NEEDSBUILD or BUILDING.)219 * subtree that are have a class of either NEEDSBUILD or BUILDING.)
@@ -225,14 +223,14 @@
225 parameterEvaluatorFunction: function(table_node){223 parameterEvaluatorFunction: function(table_node){
226 // Grab all the td's with the class 'build_status' and an additional224 // Grab all the td's with the class 'build_status' and an additional
227 // class of either 'NEEDSBUILD' or 'BUILDING':225 // class of either 'NEEDSBUILD' or 'BUILDING':
228 // Note: filter('.NEEDSBUILD, .BUILDING') returns []226 var td_list = table_node.all('td.build_status');
229 var td_list = table_node.queryAll('td.build_status');
230 var tds_needsbuild = td_list.filter(".NEEDSBUILD");227 var tds_needsbuild = td_list.filter(".NEEDSBUILD");
231 var tds_building = td_list.filter(".BUILDING");228 var tds_building = td_list.filter(".BUILDING");
232 var tds_fullybuilt_pending = td_list.filter(".FULLYBUILT_PENDING");229 var tds_fullybuilt_pending = td_list.filter(".FULLYBUILT_PENDING");
233230
234 if (tds_needsbuild.length === 0 && tds_building.length === 0 &&231 if (tds_needsbuild.size() === 0 &&
235 tds_fullybuilt_pending.length === 0) {232 tds_building.size() === 0 &&
233 tds_fullybuilt_pending.size() === 0) {
236 return null;234 return null;
237 }235 }
238236
@@ -259,10 +257,10 @@
259 */257 */
260 stopUpdatesCheckFunction: function(table_node){258 stopUpdatesCheckFunction: function(table_node){
261 // Stop updating only when there aren't any sources to update:259 // Stop updating only when there aren't any sources to update:
262 var td_list = table_node.queryAll('td.build_status');260 var td_list = table_node.all('td.build_status');
263 return (td_list.filter(".NEEDSBUILD").length === 0 &&261 return (td_list.filter(".NEEDSBUILD").size() === 0 &&
264 td_list.filter(".BUILDING").length === 0 &&262 td_list.filter(".BUILDING").size() === 0 &&
265 td_list.filter(".FULLYBUILT_PENDING").length === 0);263 td_list.filter(".FULLYBUILT_PENDING").size() === 0);
266 }264 }
267 };265 };
268266
@@ -273,7 +271,7 @@
273 // Grab the packages table and tell it how to update itself.271 // Grab the packages table and tell it how to update itself.
274 // Note: there are situations, such as displaying empty result272 // Note: there are situations, such as displaying empty result
275 // sets, when the table will not be on the page.273 // sets, when the table will not be on the page.
276 var table = Y.get('table#packages_list');274 var table = Y.one('table#packages_list');
277 if (table !== null) {275 if (table !== null) {
278 source_package_table_dynamic_update_config.uri =276 source_package_table_dynamic_update_config.uri =
279 LP.client.cache.context.self_link;277 LP.client.cache.context.self_link;
280278
=== modified file 'lib/canonical/launchpad/javascript/translations/translations.js'
--- lib/canonical/launchpad/javascript/translations/translations.js 2009-10-01 11:10:51 +0000
+++ lib/canonical/launchpad/javascript/translations/translations.js 2009-11-18 13:45:26 +0000
@@ -103,7 +103,7 @@
103 table.insertBefore(output, row.next());103 table.insertBefore(output, row.next());
104104
105 var entry_uri = '+imports/' + entry_id;105 var entry_uri = '+imports/' + entry_id;
106 var div = output.query('div');106 var div = output.one('div');
107 var lp = new LP.client.Launchpad();107 var lp = new LP.client.Launchpad();
108 lp.get(entry_uri, output_loader(div));108 lp.get(entry_uri, output_loader(div));
109};109};
110110
=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
--- lib/lp/app/templates/base-layout-macros.pt 2009-11-10 21:49:38 +0000
+++ lib/lp/app/templates/base-layout-macros.pt 2009-11-18 13:45:26 +0000
@@ -43,7 +43,7 @@
43 rooturl modules/canonical.launchpad.webapp.vhosts/allvhosts/configs/mainsite/rooturl;43 rooturl modules/canonical.launchpad.webapp.vhosts/allvhosts/configs/mainsite/rooturl;
44 icingroot string:${rooturl}+icing/rev${revno};44 icingroot string:${rooturl}+icing/rev${revno};
45 devmode modules/canonical.config/config/devmode;45 devmode modules/canonical.config/config/devmode;
46 yui string:${icingroot}/yui/3.0.0pr2/build;46 yui string:${icingroot}/yui/current/build;
47 lazr_js string:${icingroot}/lazr/build;47 lazr_js string:${icingroot}/lazr/build;
48 lp_js string:${icingroot}/build"48 lp_js string:${icingroot}/build"
49 >49 >
@@ -53,17 +53,45 @@
53 </tal:comment>53 </tal:comment>
5454
55 <tal:devmode condition="devmode">55 <tal:devmode condition="devmode">
56 <script type="text/javascript"56
57 tal:attributes="src string:${yui}/yui/yui.js"></script>57 <tal:comment replace="nothing">
58 Instead of loading the yui.js seed we will load three of it's five
59 sub-components.
60
61 We leave out get.js and loader.js, effectively disabling
62 dynamic loading of modules.
63
64 XXX mars 2009-11-03
65 To see what modules are missing you have to change yui-base.js to
66 yui-base-debug.js and move the <script/> node outside of this block.
67
68 This will hopefully be fixed in YUI itself.
69 See http://yuilibrary.com/projects/yui3/ticket/2528368
70 </tal:comment>
71 <script type="text/javascript"
72 tal:attributes="src string:${yui}/yui/yui-base.js"></script>
73 <script type="text/javascript"
74 tal:attributes="src string:${yui}/yui/yui-log.js"></script>
75 <script type="text/javascript"
76 tal:attributes="src string:${yui}/yui/yui-later.js"></script>
77
58 <script type="text/javascript"78 <script type="text/javascript"
59 tal:attributes="src string:${yui}/oop/oop.js"></script>79 tal:attributes="src string:${yui}/oop/oop.js"></script>
60 <script type="text/javascript"80 <script type="text/javascript"
61 tal:attributes="src string:${yui}/event/event.js"></script>81 tal:attributes="src string:${yui}/event/event.js"></script>
62 <script type="text/javascript"82 <script type="text/javascript"
83 tal:attributes="src string:${yui}/event-custom/event-custom.js"></script>
84 <script type="text/javascript"
85 tal:attributes="src string:${yui}/event-simulate/event-simulate.js"></script>
86 <script type="text/javascript"
63 tal:attributes="src string:${yui}/dom/dom.js"></script>87 tal:attributes="src string:${yui}/dom/dom.js"></script>
64 <script type="text/javascript"88 <script type="text/javascript"
65 tal:attributes="src string:${yui}/node/node.js"></script>89 tal:attributes="src string:${yui}/node/node.js"></script>
66 <script type="text/javascript"90 <script type="text/javascript"
91 tal:attributes="src string:${yui}/node-focusmanager/node-focusmanager.js"></script>
92 <script type="text/javascript"
93 tal:attributes="src string:${yui}/node/node-event-simulate.js"></script>
94 <script type="text/javascript"
67 tal:attributes="src string:${yui}/dump/dump.js"></script>95 tal:attributes="src string:${yui}/dump/dump.js"></script>
68 <script type="text/javascript"96 <script type="text/javascript"
69 tal:attributes="src string:${yui}/io/io.js"></script>97 tal:attributes="src string:${yui}/io/io.js"></script>
@@ -82,6 +110,8 @@
82 <script type="text/javascript"110 <script type="text/javascript"
83 tal:attributes="src string:${yui}/plugin/plugin.js"></script>111 tal:attributes="src string:${yui}/plugin/plugin.js"></script>
84 <script type="text/javascript"112 <script type="text/javascript"
113 tal:attributes="src string:${yui}/pluginhost/pluginhost.js"></script>
114 <script type="text/javascript"
85 tal:attributes="src string:${yui}/widget/widget.js"></script>115 tal:attributes="src string:${yui}/widget/widget.js"></script>
86 <script type="text/javascript"116 <script type="text/javascript"
87 tal:attributes="src string:${yui}/widget/widget-position-ext.js"></script>117 tal:attributes="src string:${yui}/widget/widget-position-ext.js"></script>
@@ -267,7 +297,7 @@
267 revno modules/canonical.launchpad.versioninfo/revno | string:unknown;297 revno modules/canonical.launchpad.versioninfo/revno | string:unknown;
268 rooturl modules/canonical.launchpad.webapp.vhosts/allvhosts/configs/mainsite/rooturl;298 rooturl modules/canonical.launchpad.webapp.vhosts/allvhosts/configs/mainsite/rooturl;
269 icingroot string:${rooturl}+icing/rev${revno};299 icingroot string:${rooturl}+icing/rev${revno};
270 yui string:${icingroot}/yui/3.0.0pr2/build;300 yui string:${icingroot}/yui/current/build;
271 devmode modules/canonical.config/config/devmode">301 devmode modules/canonical.config/config/devmode">
272 <tal:comment replace="nothing">302 <tal:comment replace="nothing">
273 This macro loads the old stylesheet, then the YUI CSS, and finally303 This macro loads the old stylesheet, then the YUI CSS, and finally
274304
=== modified file 'lib/lp/app/templates/base-layout.pt'
--- lib/lp/app/templates/base-layout.pt 2009-09-23 10:17:34 +0000
+++ lib/lp/app/templates/base-layout.pt 2009-11-18 13:45:26 +0000
@@ -24,7 +24,7 @@
24 xmlns:i18n="http://xml.zope.org/namespaces/i18n"24 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
25 xml:lang="en" lang="en" dir="ltr">25 xml:lang="en" lang="en" dir="ltr">
26 <head tal:define="26 <head tal:define="
27 yui string:${icingroot}/yui/3.0.0pr2/build;27 yui string:${icingroot}/yui/current/build;
28 lazr_js string:${icingroot}/lazr/build;28 lazr_js string:${icingroot}/lazr/build;
29 lp_js string:${icingroot}/build">29 lp_js string:${icingroot}/build">
30 <title tal:content="view/fmt:pagetitle">Page Title</title>30 <title tal:content="view/fmt:pagetitle">Page Title</title>
3131
=== modified file 'lib/lp/bugs/templates/bug-portlet-subscribers.pt'
--- lib/lp/bugs/templates/bug-portlet-subscribers.pt 2009-11-05 14:56:01 +0000
+++ lib/lp/bugs/templates/bug-portlet-subscribers.pt 2009-11-18 13:45:26 +0000
@@ -25,7 +25,7 @@
25 YUI().use('io-base', 'node', 'bugs.bugtask_index', function(Y) {25 YUI().use('io-base', 'node', 'bugs.bugtask_index', function(Y) {
26 // Must be done inline here to ensure the load event fires.26 // Must be done inline here to ensure the load event fires.
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.
28 var subscription_link = Y.get('.menu-link-subscription');28 var subscription_link = Y.one('.menu-link-subscription');
29 var subscription_link_handler;29 var subscription_link_handler;
30 if (subscription_link) {30 if (subscription_link) {
31 subscription_link_handler = subscription_link.on('click', function(e) {31 subscription_link_handler = subscription_link.on('click', function(e) {
3232
=== modified file 'lib/lp/bugs/templates/bugtarget-portlet-bugfilters.pt'
--- lib/lp/bugs/templates/bugtarget-portlet-bugfilters.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/bugs/templates/bugtarget-portlet-bugfilters.pt 2009-11-18 13:45:25 +0000
@@ -14,11 +14,11 @@
14 <script type="text/javascript">14 <script type="text/javascript">
15 YUI().use('io-base', 'node', function(Y) {15 YUI().use('io-base', 'node', function(Y) {
16 Y.on('domready', function() {16 Y.on('domready', function() {
17 var portlet = Y.get('#portlet-bugfilters');17 var portlet = Y.one('#portlet-bugfilters');
18 Y.get('#bugfilters-portlet-spinner').setStyle('display', 'block');18 Y.one('#bugfilters-portlet-spinner').setStyle('display', 'block');
1919
20 function hide_spinner() {20 function hide_spinner() {
21 Y.get('#bugfilters-portlet-spinner').setStyle('display', 'none');21 Y.one('#bugfilters-portlet-spinner').setStyle('display', 'none');
22 }22 }
2323
24 function on_success(transactionid, response, arguments) {24 function on_success(transactionid, response, arguments) {
@@ -29,7 +29,7 @@
2929
30 var config = {on: {success: on_success,30 var config = {on: {success: on_success,
31 failure: hide_spinner}};31 failure: hide_spinner}};
32 var url = Y.get('#bugtarget-bugfilters-link').getAttribute('href');32 var url = Y.one('#bugtarget-bugfilters-link').getAttribute('href');
33 var request = Y.io(url, config);33 var request = Y.io(url, config);
34 });34 });
35 });35 });
3636
=== modified file 'lib/lp/bugs/templates/bugtarget-portlet-bugtags.pt'
--- lib/lp/bugs/templates/bugtarget-portlet-bugtags.pt 2009-09-13 20:39:15 +0000
+++ lib/lp/bugs/templates/bugtarget-portlet-bugtags.pt 2009-11-18 13:45:26 +0000
@@ -11,15 +11,15 @@
11 <script type="text/javascript">11 <script type="text/javascript">
12 YUI().use('io-base', 'node', function(Y) {12 YUI().use('io-base', 'node', function(Y) {
13 Y.on('domready', function() {13 Y.on('domready', function() {
14 Y.get('#tags-portlet-spinner').setStyle('display', 'block');14 Y.one('#tags-portlet-spinner').setStyle('display', 'block');
1515
16 function hide_spinner() {16 function hide_spinner() {
17 Y.get('#tags-portlet-spinner').setStyle('display', 'none');17 Y.one('#tags-portlet-spinner').setStyle('display', 'none');
18 }18 }
1919
20 function on_success(transactionid, response, arguments) {20 function on_success(transactionid, response, arguments) {
21 hide_spinner();21 hide_spinner();
22 var portlet = Y.get('#portlet-tags');22 var portlet = Y.one('#portlet-tags');
23 if (Y.Lang.trim(response.responseText).length == 0) {23 if (Y.Lang.trim(response.responseText).length == 0) {
24 portlet.setStyle('display', 'none')24 portlet.setStyle('display', 'none')
25 }25 }
@@ -31,7 +31,7 @@
3131
32 var config = {on: {success: on_success,32 var config = {on: {success: on_success,
33 failure: hide_spinner}};33 failure: hide_spinner}};
34 var url = Y.get('#tags-content-link').getAttribute('href').replace('bugs.', '');34 var url = Y.one('#tags-content-link').getAttribute('href').replace('bugs.', '');
35 Y.io(url, config);35 Y.io(url, config);
36 });36 });
37 });37 });
3838
=== modified file 'lib/lp/bugs/templates/bugtask-index.pt'
--- lib/lp/bugs/templates/bugtask-index.pt 2009-10-28 06:08:11 +0000
+++ lib/lp/bugs/templates/bugtask-index.pt 2009-11-18 13:45:26 +0000
@@ -157,7 +157,7 @@
157 // non-JS form, we first disable the link. This is awful and157 // non-JS form, we first disable the link. This is awful and
158 // must be fixed as soon as YUI3 is fixed.158 // must be fixed as soon as YUI3 is fixed.
159 if (LP.client.links['me'] !== undefined) {159 if (LP.client.links['me'] !== undefined) {
160 Y.get('#edit-tags-trigger').on('click', function(e) {160 Y.one('#edit-tags-trigger').on('click', function(e) {
161 e.halt();161 e.halt();
162 });162 });
163 }163 }
164164
=== modified file 'lib/lp/code/templates/branch-import-details.pt'
--- lib/lp/code/templates/branch-import-details.pt 2009-09-15 04:21:59 +0000
+++ lib/lp/code/templates/branch-import-details.pt 2009-11-18 13:45:26 +0000
@@ -33,7 +33,7 @@
33 </a>33 </a>
34 <script type="text/javascript">34 <script type="text/javascript">
35 YUI().use('event', 'node', function(Y) {35 YUI().use('event', 'node', function(Y) {
36 Y.on("domready", function () { Y.get('#tryagainlink').setStyle('display', 'inline') });36 Y.on("domready", function () { Y.one('#tryagainlink').setStyle('display', 'inline') });
37 });37 });
38 </script>38 </script>
39 </form>39 </form>
4040
=== modified file 'lib/lp/code/templates/branch-listing.pt'
--- lib/lp/code/templates/branch-listing.pt 2009-10-28 23:40:13 +0000
+++ lib/lp/code/templates/branch-listing.pt 2009-11-18 13:45:26 +0000
@@ -64,7 +64,7 @@
6464
65 spark_div = branch_sparks[spark_div][0];65 spark_div = branch_sparks[spark_div][0];
6666
67 if (Y.get('#' + spark_div) !== null) {67 if (Y.one('#' + spark_div) !== null) {
68 json_url = branch_sparks[0][1];68 json_url = branch_sparks[0][1];
69 var container = spark_div;69 var container = spark_div;
70 var uri = json_url;70 var uri = json_url;
7171
=== modified file 'lib/lp/code/templates/branch-portlet-subscribers.pt'
--- lib/lp/code/templates/branch-portlet-subscribers.pt 2009-09-15 03:34:45 +0000
+++ lib/lp/code/templates/branch-portlet-subscribers.pt 2009-11-18 13:45:26 +0000
@@ -44,7 +44,7 @@
44 YUI().use('io-base', 'node', 'code.branchsubscription', function(Y) {44 YUI().use('io-base', 'node', 'code.branchsubscription', function(Y) {
4545
46 if(Y.UA.ie) {46 if(Y.UA.ie) {
47 Y.get('#subscriber-list').set('innerHTML',47 Y.one('#subscriber-list').set('innerHTML',
48 'Could not load subscribers, javascript is disabled.');48 'Could not load subscribers, javascript is disabled.');
49 return;49 return;
50 }50 }
5151
=== modified file 'lib/lp/code/templates/branchmergeproposal-generic-listing.pt'
--- lib/lp/code/templates/branchmergeproposal-generic-listing.pt 2009-09-16 04:29:55 +0000
+++ lib/lp/code/templates/branchmergeproposal-generic-listing.pt 2009-11-18 13:45:26 +0000
@@ -27,10 +27,10 @@
27YUI().use('node', function(Y) {27YUI().use('node', function(Y) {
2828
29 function submit_filter() {29 function submit_filter() {
30 Y.get('#filter_form').submit();30 Y.one('#filter_form').submit();
31 }31 }
32 Y.on('domready', function () {32 Y.on('domready', function () {
33 var field = Y.get("[id=field.status]");33 var field = Y.one("[id=field.status]");
34 field.on('change', submit_filter);34 field.on('change', submit_filter);
35 });35 });
3636
3737
=== modified file 'lib/lp/registry/templates/distributionsourcepackage-index.pt'
--- lib/lp/registry/templates/distributionsourcepackage-index.pt 2009-11-07 04:37:23 +0000
+++ lib/lp/registry/templates/distributionsourcepackage-index.pt 2009-11-18 13:45:26 +0000
@@ -271,11 +271,11 @@
271 // XXX Michael Nelson 20090702 bug=340497 This slider271 // XXX Michael Nelson 20090702 bug=340497 This slider
272 // needs an integration test.272 // needs an integration test.
273 // Collapse the body of the slider widget initially.273 // Collapse the body of the slider widget initially.
274 Y.get('#related-ppa-versions .widget-bd').addClass('lazr-closed');274 Y.one('#related-ppa-versions .widget-bd').addClass('lazr-closed');
275275
276 // Ensure that the widget header uses the correct sprite icon276 // Ensure that the widget header uses the correct sprite icon
277 // and gets the styling for javascript actions applied.277 // and gets the styling for javascript actions applied.
278 var widget_header = Y.get('#related-ppa-versions .widget-hd');278 var widget_header = Y.one('#related-ppa-versions .widget-hd');
279 widget_header.addClass('sprite');279 widget_header.addClass('sprite');
280 widget_header.addClass('treeCollapsed');280 widget_header.addClass('treeCollapsed');
281 widget_header.addClass('js-action');281 widget_header.addClass('js-action');
282282
=== modified file 'lib/lp/registry/templates/object-timeline-graph.pt'
--- lib/lp/registry/templates/object-timeline-graph.pt 2009-09-28 20:48:08 +0000
+++ lib/lp/registry/templates/object-timeline-graph.pt 2009-11-18 13:45:26 +0000
@@ -48,7 +48,7 @@
4848
49 // Don't display graph if there are zero milestones or49 // Don't display graph if there are zero milestones or
50 // releases.50 // releases.
51 var container = Y.get('#timeline-container');51 var container = Y.one('#timeline-container');
52 container.setStyle('display', 'block');52 container.setStyle('display', 'block');
53 var config = {53 var config = {
54 timeline: timeline,54 timeline: timeline,
@@ -59,7 +59,7 @@
59 }59 }
60 var graph = new Y.registry.timeline.TimelineGraph(config);60 var graph = new Y.registry.timeline.TimelineGraph(config);
61 graph.render();61 graph.render();
62 Y.get('#spinner').setStyle('display', 'none');62 Y.one('#spinner').setStyle('display', 'none');
63 // Scroll to the most recent milestones or63 // Scroll to the most recent milestones or
64 // releases on the development focus series.64 // releases on the development focus series.
65 graph.scroll_to_last_development_focus_landmark();65 graph.scroll_to_last_development_focus_landmark();
6666
=== modified file 'lib/lp/registry/templates/person-macros.pt'
--- lib/lp/registry/templates/person-macros.pt 2009-09-18 19:31:04 +0000
+++ lib/lp/registry/templates/person-macros.pt 2009-11-18 13:45:26 +0000
@@ -200,7 +200,7 @@
200 // XXX: Brad Crittenden 2009-01-30200 // XXX: Brad Crittenden 2009-01-30
201 // bug=http://yuilibrary.com/projects/yui3/ticket/2423101201 // bug=http://yuilibrary.com/projects/yui3/ticket/2423101
202 // Dotted CSS selectors not parsed correctly. Therefore not202 // Dotted CSS selectors not parsed correctly. Therefore not
203 // using Y.get().203 // using Y.one().
204 var name = document.getElementById('field.name');204 var name = document.getElementById('field.name');
205 name.value = prefix + name.value.replace(/^$private_prefix/, '');205 name.value = prefix + name.value.replace(/^$private_prefix/, '');
206206
207207
=== modified file 'lib/lp/registry/templates/product-new.pt'
--- lib/lp/registry/templates/product-new.pt 2009-10-01 11:53:27 +0000
+++ lib/lp/registry/templates/product-new.pt 2009-11-18 13:45:26 +0000
@@ -34,11 +34,11 @@
34 * XXX BarryWarsaw 12-May-200934 * XXX BarryWarsaw 12-May-2009
35 * http://yuilibrary.com/projects/yui3/ticket/242310135 * http://yuilibrary.com/projects/yui3/ticket/2423101
36 * Note that we have to use the more verbose way of getting field.name36 * Note that we have to use the more verbose way of getting field.name
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.
38 */38 */
39 var url_field = Y.get(Y.DOM.byId('field.name'));39 var url_field = Y.one(Y.DOM.byId('field.name'));
40 if (url_field) {40 if (url_field) {
41 var name_field = Y.get(Y.DOM.byId('field.displayname'));41 var name_field = Y.one(Y.DOM.byId('field.displayname'));
42 function autofill(e) {42 function autofill(e) {
43 var name_value = name_field.get('value');43 var name_value = name_field.get('value');
44 if (name_value == '') {44 if (name_value == '') {
@@ -110,17 +110,17 @@
110 }110 }
111111
112 /* Handle the reveals when there are search results. */112 /* Handle the reveals when there are search results. */
113 var details_buttons = Y.get('#registration-details-buttons');113 var details_buttons = Y.one('#registration-details-buttons');
114 var form_actions = Y.get('#launchpad-form-actions');114 var form_actions = Y.one('#launchpad-form-actions');
115 var form_widgets = Y.get('#launchpad-form-widgets');115 var form_widgets = Y.one('#launchpad-form-widgets');
116 var search_results = Y.get('#search-results');116 var search_results = Y.one('#search-results');
117 var step_title = Y.get('#step-title');117 var step_title = Y.one('#step-title');
118 var title = Y.get('#registration-details-title');118 var title = Y.one('#registration-details-title');
119119
120 /* This is the magic hidden widget used by the MultiStepView. */120 /* This is the magic hidden widget used by the MultiStepView. */
121 var marker = Y.get(Y.DOM.byId('field.__visited_steps__'));121 var marker = Y.one(Y.DOM.byId('field.__visited_steps__'));
122122
123 var separator = Y.get('#registration-separator');123 var separator = Y.one('#registration-separator');
124 function show_separator(flag) {124 function show_separator(flag) {
125 if (!separator) {125 if (!separator) {
126 /* The separator is not on the page, because there were no126 /* The separator is not on the page, because there were no
@@ -141,14 +141,14 @@
141 * to leave the search results there.141 * to leave the search results there.
142 */142 */
143 function complete_registration(e) {143 function complete_registration(e) {
144 var expander = Y.get('#search-results-expander');144 var expander = Y.one('#search-results-expander');
145145
146 /* Slide in the search results and hide them under a link. */146 /* Slide in the search results and hide them under a link. */
147 expander.removeClass('unseen');147 expander.removeClass('unseen');
148 expander.on('click', function(e) {148 expander.on('click', function(e) {
149 e.preventDefault();149 e.preventDefault();
150150
151 var arrow = Y.get('#search-results-arrow');151 var arrow = Y.one('#search-results-arrow');
152 if (arrow.getAttribute('src') == '/@@/treeCollapsed') {152 if (arrow.getAttribute('src') == '/@@/treeCollapsed') {
153 /* The search results are currently hidden. Slide them153 /* The search results are currently hidden. Slide them
154 * out and turn the arrow to point downward.154 * out and turn the arrow to point downward.
155155
=== modified file 'lib/lp/registry/templates/productrelease-add-from-series.pt'
--- lib/lp/registry/templates/productrelease-add-from-series.pt 2009-09-03 22:35:47 +0000
+++ lib/lp/registry/templates/productrelease-add-from-series.pt 2009-11-18 13:45:26 +0000
@@ -29,12 +29,12 @@
29 // to be escaped.29 // to be escaped.
3030
31 var get_by_id = function(id) {31 var get_by_id = function(id) {
32 return Y.get(Y.DOM.byId(id));32 return Y.one(Y.DOM.byId(id));
33 };33 };
3434
35 var add_milestone_to_menu = function(parameters) {35 var add_milestone_to_menu = function(parameters) {
36 var select_menu = get_by_id('field.milestone_for_release');36 var select_menu = get_by_id('field.milestone_for_release');
37 var new_milestone_option = Y.get(37 var new_milestone_option = Y.one(
38 new Option(parameters.name + '*', parameters.name));38 new Option(parameters.name + '*', parameters.name));
39 select_menu.appendChild(new_milestone_option);39 select_menu.appendChild(new_milestone_option);
40 var children = select_menu.get('children');40 var children = select_menu.get('children');
4141
=== modified file 'lib/lp/registry/templates/teammembership-index.pt'
--- lib/lp/registry/templates/teammembership-index.pt 2009-10-08 00:26:50 +0000
+++ lib/lp/registry/templates/teammembership-index.pt 2009-11-18 13:45:26 +0000
@@ -24,9 +24,9 @@
24 // Ensure that when the picker is used the radio button switches24 // Ensure that when the picker is used the radio button switches
25 // from 'Never' to 'On' and the expiry field is enabled.25 // from 'Never' to 'On' and the expiry field is enabled.
26 Y.on("available", function(e) {26 Y.on("available", function(e) {
27 var choose_link = Y.get("#expiration-widget a.js-action");27 var choose_link = Y.one("#expiration-widget a.js-action");
28 var radio_on = Y.get("#date");28 var radio_on = Y.one("#date");
29 var expiration_date = Y.get(29 var expiration_date = Y.one(
30 document.getElementById('membership.expirationdate'));30 document.getElementById('membership.expirationdate'));
31 choose_link.on('click', function(e) {31 choose_link.on('click', function(e) {
32 expiration_date.set('disabled', false);32 expiration_date.set('disabled', false);
3333
=== modified file 'lib/lp/registry/templates/timeline-macros.pt'
--- lib/lp/registry/templates/timeline-macros.pt 2009-10-02 17:20:49 +0000
+++ lib/lp/registry/templates/timeline-macros.pt 2009-11-18 13:45:26 +0000
@@ -39,9 +39,9 @@
39 if (Y.UA.ie) {39 if (Y.UA.ie) {
40 return;40 return;
41 }41 }
42 var loading_el = Y.get('#timeline-loading');42 var loading_el = Y.one('#timeline-loading');
43 loading_el.setStyle('display', 'block');43 loading_el.setStyle('display', 'block');
44 var iframe = Y.get('#timeline-iframe');44 var iframe = Y.one('#timeline-iframe');
45 iframe.set('src', timeline_url);45 iframe.set('src', timeline_url);
46 Y.on('load', function(e) {46 Y.on('load', function(e) {
47 loading_el.setStyle('display', 'none');47 loading_el.setStyle('display', 'none');
4848
=== modified file 'lib/lp/soyuz/templates/archive-edit-dependencies.pt'
--- lib/lp/soyuz/templates/archive-edit-dependencies.pt 2009-10-16 13:20:48 +0000
+++ lib/lp/soyuz/templates/archive-edit-dependencies.pt 2009-11-18 13:45:26 +0000
@@ -69,7 +69,7 @@
69 // contained by the label.69 // contained by the label.
70 function highlight_checked (nodes) {70 function highlight_checked (nodes) {
71 nodes.each(function(input) {71 nodes.each(function(input) {
72 var label = Y.get(input.get("parentNode"));72 var label = Y.one(input.get("parentNode"));
73 if (input.get("checked")) {73 if (input.get("checked")) {
74 label.setStyle("fontWeight", "bold");74 label.setStyle("fontWeight", "bold");
75 }75 }
@@ -79,45 +79,38 @@
79 });79 });
80 };80 };
8181
82 var main_area = Y.get("#mainarea");82 var main_area = Y.one("#mainarea");
8383
84 // Highlight the selected radio button input on page load.84 // Highlight the selected radio button input on page load.
85 var inputs = main_area.queryAll("input.highlight-selected");85 var inputs = main_area.all("input.highlight-selected");
86 highlight_checked(inputs);86 highlight_checked(inputs);
8787
88 // Install signal handlers for all radio-button inputs to88 // Install signal handlers for all radio-button inputs to
89 // recalculate with options should be highlighted when one of89 // recalculate with options should be highlighted when one of
90 // them is clicked.90 // them is clicked.
91 inputs.each(function(input) {91 inputs.on("click", function(e) {
92 input.on("click", function(e) {92 highlight_checked(inputs);
93 var main_area = Y.get("#mainarea");93 }, this);
94 var inputs = main_area.queryAll("input.highlight-selected");
95 highlight_checked(inputs);
96 });
97 });
9894
99 // Install handlers to decorate selected check-box inputs when95 // Install handlers to decorate selected check-box inputs when
100 // they get clicked. Selected options text (next sibling) will96 // they get clicked. Selected options text (next sibling) will
101 // be decorated with 'line-through' style and rendered in97 // be decorated with 'line-through' style and rendered in
102 // 'red'. Options not selected (or unselected) text will be98 // 'red'. Options not selected (or unselected) text will be
103 // rendered in 'blue' and without any decoration.99 // rendered in 'blue' and without any decoration.
104 var inputs = main_area.queryAll("input.line-through-when-checked");100 main_area.all(
105 if (inputs) {101 "input.line-through-when-checked").on('click', function(e) {
106 inputs.each(function(input) {102 var input = e.currentTarget;
107 input.on("click", function(e) {103 var link = input.next();
108 var input = e.currentTarget;104 if (input.get("checked")) {
109 var link = input.next();105 link.setStyle("color", "red");
110 if (input.get("checked")) {106 link.setStyle("textDecoration", "line-through");
111 link.setStyle("color", "red");107 }
112 link.setStyle("textDecoration", "line-through");108 else {
113 }109 link.setStyle("color", "blue");
114 else {110 link.setStyle("textDecoration", "none");
115 link.setStyle("color", "blue");111 }
116 link.setStyle("textDecoration", "none");
117 }
118 });
119 });112 });
120 };113 });
121 });114 });
122</script>115</script>
123116
124117
=== modified file 'lib/lp/soyuz/templates/archive-index.pt'
--- lib/lp/soyuz/templates/archive-index.pt 2009-09-22 04:06:47 +0000
+++ lib/lp/soyuz/templates/archive-index.pt 2009-11-18 13:45:26 +0000
@@ -148,11 +148,11 @@
148 }).use('node', 'event', 'lazr.effects', function(Y) {148 }).use('node', 'event', 'lazr.effects', function(Y) {
149149
150 // Hide the widget body contents.150 // Hide the widget body contents.
151 Y.get('#ppa-install .widget-body').addClass('lazr-closed');151 Y.one('#ppa-install .widget-body').addClass('lazr-closed');
152152
153 // Ensure that the widget header uses the correct sprite icon153 // Ensure that the widget header uses the correct sprite icon
154 // and gets the styling for javascript actions applied.154 // and gets the styling for javascript actions applied.
155 var widget_header = Y.get('#ppa-install .widget-header');155 var widget_header = Y.one('#ppa-install .widget-header');
156 widget_header.addClass('sprite');156 widget_header.addClass('sprite');
157 widget_header.addClass('treeCollapsed');157 widget_header.addClass('treeCollapsed');
158 widget_header.addClass('js-action');158 widget_header.addClass('js-action');
159159
=== modified file 'lib/lp/soyuz/templates/archive-macros.pt'
--- lib/lp/soyuz/templates/archive-macros.pt 2009-10-16 11:47:55 +0000
+++ lib/lp/soyuz/templates/archive-macros.pt 2009-11-18 13:45:26 +0000
@@ -88,14 +88,14 @@
88 * the expander itself.88 * the expander itself.
89 */89 */
90function toggleExpandableRow(expander) {90function toggleExpandableRow(expander) {
91 var row = Y.get('#' + expander.get('id').replace('-expander', ''));91 var row = Y.one('#' + expander.get('id').replace('-expander', ''));
92 var icon = expander.query('img');92 var icon = expander.one('img');
9393
94 var row_display = row.getStyle('display');94 var row_display = row.getStyle('display');
95 if (row_display == 'none') {95 if (row_display == 'none') {
96 row.setStyle('display', 'table-row');96 row.setStyle('display', 'table-row');
97 icon.set('src', '/@@/treeExpanded');97 icon.set('src', '/@@/treeExpanded');
98 var container = Y.get('#' + row.get('id') + '-container');98 var container = Y.one('#' + row.get('id') + '-container');
99 if (trim(container.get('innerHTML')) == ''){99 if (trim(container.get('innerHTML')) == ''){
100 startUpdate(container);100 startUpdate(container);
101 }101 }
102102
=== modified file 'lib/lp/soyuz/templates/archive-packages.pt'
--- lib/lp/soyuz/templates/archive-packages.pt 2009-09-18 21:00:18 +0000
+++ lib/lp/soyuz/templates/archive-packages.pt 2009-11-18 13:45:26 +0000
@@ -65,7 +65,7 @@
65 in_progress_message = Y.soyuz.makeInProgressNode(65 in_progress_message = Y.soyuz.makeInProgressNode(
66 'Fetching repository size ...')66 'Fetching repository size ...')
6767
68 var container = Y.get('#package-counters');68 var container = Y.one('#package-counters');
69 container.set('innerHTML', '');69 container.set('innerHTML', '');
70 container.appendChild(in_progress_message);70 container.appendChild(in_progress_message);
7171
7272
=== modified file 'lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py'
--- lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py 2009-09-29 12:09:39 +0000
+++ lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py 2009-11-18 13:45:26 +0000
@@ -15,13 +15,11 @@
1515
16from canonical.launchpad.ftests import login, logout16from canonical.launchpad.ftests import login, logout
17from canonical.launchpad.windmill.testing.lpuser import LaunchpadUser17from canonical.launchpad.windmill.testing.lpuser import LaunchpadUser
18from canonical.launchpad.windmill.testing import constants
18from lp.registry.interfaces.distribution import IDistributionSet19from lp.registry.interfaces.distribution import IDistributionSet
19from lp.soyuz.windmill.testing import SoyuzWindmillLayer20from lp.soyuz.windmill.testing import SoyuzWindmillLayer
20from lp.testing import TestCaseWithFactory21from lp.testing import TestCaseWithFactory
2122
22WAIT_PAGELOAD = u'30000'
23WAIT_ELEMENT_COMPLETE = u'30000'
24WAIT_CHECK_CHANGE = u'1000'
25ADD_ACCESS_LINK = u'//a[@class="js-action sprite add"]'23ADD_ACCESS_LINK = u'//a[@class="js-action sprite add"]'
26CHOOSE_SUBSCRIBER_LINK = u'//a[@id="show-widget-field-subscriber"]'24CHOOSE_SUBSCRIBER_LINK = u'//a[@id="show-widget-field-subscriber"]'
27SUBSCRIBER_SEARCH_FIELD = (25SUBSCRIBER_SEARCH_FIELD = (
@@ -30,6 +28,7 @@
30FIRST_SUBSCRIBER_RESULT = (28FIRST_SUBSCRIBER_RESULT = (
31 u'//div[@id="yui-pretty-overlay-modal"]'29 u'//div[@id="yui-pretty-overlay-modal"]'
32 '//span[@class="yui-picker-result-title"]')30 '//span[@class="yui-picker-result-title"]')
31MESSAGE_WINDOW = u'//div[@class="informational message"]'
3332
3433
35class TestArchiveSubscribersIndex(TestCaseWithFactory):34class TestArchiveSubscribersIndex(TestCaseWithFactory):
@@ -59,15 +58,16 @@
59 def test_add_subscriber(self):58 def test_add_subscriber(self):
60 """Test adding a private PPA subscriber.."""59 """Test adding a private PPA subscriber.."""
61 client = WindmillTestClient('Adding private PPA subscribers.')60 client = WindmillTestClient('Adding private PPA subscribers.')
62 61
63 self.lpuser.ensure_login(client)62 self.lpuser.ensure_login(client)
6463
65 client.open(url='http://launchpad.dev:8085/~joe-bloggs/'64 client.open(url='http://launchpad.dev:8085/~joe-bloggs/'
66 '+archive/myppa/+subscriptions')65 '+archive/myppa/+subscriptions')
67 client.waits.forPageLoad(timeout=WAIT_PAGELOAD)66 client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
6867
69 # Click on the JS add access action.68 # Click on the JS add access action.
70 client.waits.forElement(xpath=ADD_ACCESS_LINK)69 client.waits.forElement(
70 xpath=ADD_ACCESS_LINK, timeout=constants.FOR_ELEMENT)
71 client.click(xpath=ADD_ACCESS_LINK)71 client.click(xpath=ADD_ACCESS_LINK)
7272
73 # Open the picker, search for 'launchpad' and choose the first73 # Open the picker, search for 'launchpad' and choose the first
@@ -76,15 +76,18 @@
76 client.type(xpath=SUBSCRIBER_SEARCH_FIELD, text='launchpad')76 client.type(xpath=SUBSCRIBER_SEARCH_FIELD, text='launchpad')
77 client.click(xpath=SUBSCRIBER_SEARCH_BUTTON)77 client.click(xpath=SUBSCRIBER_SEARCH_BUTTON)
7878
79 client.waits.forElement(xpath=FIRST_SUBSCRIBER_RESULT)79 client.waits.forElement(
80 xpath=FIRST_SUBSCRIBER_RESULT, timeout=constants.FOR_ELEMENT)
80 client.click(xpath=FIRST_SUBSCRIBER_RESULT)81 client.click(xpath=FIRST_SUBSCRIBER_RESULT)
8182
82 # Add the new subscriber.83 # Add the new subscriber.
83 client.click(id='field.actions.add')84 client.click(id='field.actions.add')
84 client.waits.forPageLoad(timeout=WAIT_PAGELOAD)85 client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
8586
86 # And verify that the correct informational message is displayed.87 # And verify that the correct informational message is displayed.
87 # It would be nice if we could use ... here.88 # It would be nice if we could use ... here.
89 client.waits.forElement(
90 xpath=MESSAGE_WINDOW, timeout=constants.FOR_ELEMENT)
88 client.asserts.assertText(91 client.asserts.assertText(
89 xpath=u'//div[@class="informational message"]',92 xpath=u'//div[@class="informational message"]',
90 validator='You have granted access for Launchpad Developers '93 validator='You have granted access for Launchpad Developers '
9194
=== modified file 'lib/lp/translations/templates/object-templates.pt'
--- lib/lp/translations/templates/object-templates.pt 2009-10-22 11:49:30 +0000
+++ lib/lp/translations/templates/object-templates.pt 2009-11-18 13:45:26 +0000
@@ -35,19 +35,17 @@
35 }35 }
36 </style>36 </style>
37 <script language="JavaScript" type="text/javascript">37 <script language="JavaScript" type="text/javascript">
38 YUI().use('node', function(Y) {38 YUI().use('node-base', 'event-delegate', function(Y) {
39 Y.on('domready', function(e) {39 Y.on('domready', function(e) {
40 Y.all('.template_links').addClass('inactive_links');40 Y.all('#template_table .template_links').addClass('inactive_links');
41 var template_rows = Y.all('.template_row');41
42 template_rows.each(function(row) {42 Y.delegate('mouseover', function(e) {
43 var template_links = row.query('.template_links');43 this.removeClass('inactive_links');
44 row.on('mouseover', function(e) {44 }, '#template_table tbody', '.template_links');
45 template_links.removeClass('inactive_links');45
46 });46 Y.delegate('mouseout', function(e) {
47 row.on('mouseout', function(e) {47 this.addClass('inactive_links');
48 template_links.addClass('inactive_links');48 }, '#template_table tbody', '.template_links');
49 });
50 });
51 });49 });
52 });50 });
53 </script>51 </script>
5452
=== modified file 'lib/lp/translations/templates/pofile-export.pt'
--- lib/lp/translations/templates/pofile-export.pt 2009-11-06 01:16:21 +0000
+++ lib/lp/translations/templates/pofile-export.pt 2009-11-18 13:45:26 +0000
@@ -16,9 +16,9 @@
16 YUI().use('node', 'event', function(Y){16 YUI().use('node', 'event', function(Y){
17 Y.on('domready', function(){17 Y.on('domready', function(){
18 // The pochanged option is only available for the PO format.18 // The pochanged option is only available for the PO format.
19 var formatlist = Y.get('#div_format select');19 var formatlist = Y.one('#div_format select');
20 var checkbox = Y.get('#div_pochanged input');20 var checkbox = Y.one('#div_pochanged input');
21 var changedtext = Y.get('#div_pochanged span');21 var changedtext = Y.one('#div_pochanged span');
22 function toggle_pochanged() {22 function toggle_pochanged() {
23 if (formatlist.get('value') == 'PO') {23 if (formatlist.get('value') == 'PO') {
24 changedtext.removeClass('disabledpochanged');24 changedtext.removeClass('disabledpochanged');
2525
=== modified file 'lib/lp/translations/templates/pofile-translate.pt'
--- lib/lp/translations/templates/pofile-translate.pt 2009-09-14 16:19:15 +0000
+++ lib/lp/translations/templates/pofile-translate.pt 2009-11-18 13:45:26 +0000
@@ -38,8 +38,8 @@
38 }38 }
3939
40 var updateNotificationBox = function(e) {40 var updateNotificationBox = function(e) {
41 var notice = Y.get('.important-notice-container');41 var notice = Y.one('.important-notice-container');
42 var balloon = notice.query('.important-notice-balloon');42 var balloon = notice.one('.important-notice-balloon');
43 var dismiss_notice_cookie = ('translation-docs-for-' +43 var dismiss_notice_cookie = ('translation-docs-for-' +
44 documentation_cookie);44 documentation_cookie);
4545
@@ -50,7 +50,7 @@
50 notice.setStyle('display', 'none');50 notice.setStyle('display', 'none');
51 }51 }
5252
53 var cancel_button = notice.query(53 var cancel_button = notice.one(
54 '.important-notice-cancel-button');54 '.important-notice-cancel-button');
55 // Cancel button starts out hidden. If user has JavaScript,55 // Cancel button starts out hidden. If user has JavaScript,
56 // then we want to show it.56 // then we want to show it.
5757
=== modified file 'lib/lp/translations/templates/translationimportqueueentry-index.pt'
--- lib/lp/translations/templates/translationimportqueueentry-index.pt 2009-09-01 12:09:27 +0000
+++ lib/lp/translations/templates/translationimportqueueentry-index.pt 2009-11-18 13:45:26 +0000
@@ -29,7 +29,7 @@
29 function getElemById(elem_id) {29 function getElemById(elem_id) {
30 // XXX 'elem_id' is a Zope form field, and triggers30 // XXX 'elem_id' is a Zope form field, and triggers
31 // YUI bug #2423101. We'll work around it.31 // YUI bug #2423101. We'll work around it.
32 return Y.get(Y.DOM.byId(elem_id));32 return Y.one(Y.DOM.byId(elem_id));
33 }33 }
3434
35 function getEnclosingTR(fieldname) {35 function getEnclosingTR(fieldname) {
3636
=== modified file 'setup.py'
--- setup.py 2009-10-31 12:07:16 +0000
+++ setup.py 2009-11-18 13:45:26 +0000
@@ -27,6 +27,7 @@
27 'bzr',27 'bzr',
28 'chameleon.core',28 'chameleon.core',
29 'chameleon.zpt',29 'chameleon.zpt',
30 'cssutils',
30 'feedvalidator',31 'feedvalidator',
31 'funkload',32 'funkload',
32 'launchpadlib',33 'launchpadlib',
@@ -37,6 +38,7 @@
37 'lazr.lifecycle',38 'lazr.lifecycle',
38 'lazr.restful',39 'lazr.restful',
39 'lazr.smtptest',40 'lazr.smtptest',
41 'lazr.testing',
40 'lazr.uri',42 'lazr.uri',
41 'lazr-js',43 'lazr-js',
42 'mechanize',44 'mechanize',
4345
=== modified file 'versions.cfg'
--- versions.cfg 2009-11-17 20:34:27 +0000
+++ versions.cfg 2009-11-18 13:45:26 +0000
@@ -11,6 +11,7 @@
11chameleon.core = 1.0b3511chameleon.core = 1.0b35
12chameleon.zpt = 1.0b1712chameleon.zpt = 1.0b17
13ClientForm = 0.2.1013ClientForm = 0.2.10
14cssutils = 0.9.6
14# Required by Windmill to run on 2.415# Required by Windmill to run on 2.4
15ctypes = 1.0.216ctypes = 1.0.2
16docutils = 0.517docutils = 0.5
@@ -32,8 +33,9 @@
32lazr.restful = 0.9.1733lazr.restful = 0.9.17
33lazr.restfulclient = 0.9.1034lazr.restfulclient = 0.9.10
34lazr.smtptest = 1.135lazr.smtptest = 1.1
36lazr.testing = 0.1.1
35lazr.uri = 1.0.237lazr.uri = 1.0.2
36lazr-js = 0.9.138lazr-js = 0.9dev-r153
37martian = 0.1139martian = 0.11
38mechanize = 0.1.1140mechanize = 0.1.11
39mocker = 0.10.141mocker = 0.10.1

Subscribers

People subscribed via source and target branches

to status/vote changes: