This is a good improvement. I ran into an annoying problem running the tests.
The tests use the combined javascript file, but "make jsbuild" was not getting
run automatically. I also noticed that translationmessage-translate.pt and
pofile-translate.pt load pofile.js directly, when the <script> tag really
should be added to lib/lp/app/templates/base-layout-macros.pt next to all
the other js files in the ${lp_js} directory.
Since I was confused by some of your changes that I don't think were
necessary, I'm marking this
needs-fixing
Since Y.one() is expected to return null when the element is not found,
the preferred if-statement is:
if (notice !== null)
>+ // We have no notice container on this page, this is why there is
>+ // nothing more to be done by this function.
>+ return;
>+ }
> var balloon = notice.one('.important-notice-balloon');
> var dismiss_notice_cookie = ('translation-docs-for-' +
> documentation_cookie);
>@@ -74,6 +79,10 @@
> '.important-notice-cancel-button');
> // Cancel button starts out hidden. If user has JavaScript,
> // then we want to show it.
>+ if (!cancel_button) {
Same here.
>+ // No cancel button was found to attach the action.
>+ return;
>+ }
> cancel_button.setStyle('visibility', 'visible');
> cancel_button.on('click', function(e) {
> e.halt();
>@@ -202,30 +211,34 @@
> }
> // Shift+Alt+n - Go to next page in batch
> if (e.shiftKey && e.altKey && e.keyCode == 78) {
>- if (link = Y.one('#batchnav_next')){
>- window.location.assign(link.get('href'))
>+ link = Y.one('#batchnav_next');
>+ if (link){
Same for these if-statements.
>+ window.location.assign(link.get('href'));
> }
> }
> // Shift+Alt+p - Go to previous page in batch
> if (e.shiftKey && e.altKey && e.keyCode == 80) {
>- if (link = Y.one('#batchnav_previous')){
>- window.location.assign(link.get('href'))
>+ link = Y.one('#batchnav_previous');
>+ if (link){
>+ window.location.assign(link.get('href'));
> }
> }
> // Shift+Alt+a - Go to first page in batch
> if (e.shiftKey && e.altKey && e.keyCode == 65) {
>- if (link = Y.one('#batchnav_first')){
>- window.location.assign(link.get('href'))
>+ link = Y.one('#batchnav_first');
>+ if (link){
>+ window.location.assign(link.get('href'));
> }
> }
> // Shift+Alt+l - Go to last page in batch
> if (e.shiftKey && e.altKey && e.keyCode == 76) {
>- if (link = Y.one('#batchnav_last')){
>- window.location.assign(link.get('href'))
>+ link = Y.one('#batchnav_last');
>+ if (link){
>+ window.location.assign(link.get('href'));
> }
> }
> });
Please replace all the tab characters with spaces.
You can make vim display tab characters differently than spaces
by adding the following config to your .vimrc file.
au BufEnter *.py set list listchars=tab:>*,trail:*
I have no idea how to do that in emacs.
Hi Adi,
This is a good improvement. I ran into an annoying problem running the tests. age-translate. pt and app/templates/ base-layout- macros. pt next to all
The tests use the combined javascript file, but "make jsbuild" was not getting
run automatically. I also noticed that translationmess
pofile-translate.pt load pofile.js directly, when the <script> tag really
should be added to lib/lp/
the other js files in the ${lp_js} directory.
Since I was confused by some of your changes that I don't think were
necessary, I'm marking this
needs-fixing
-Edwin
>=== modified file 'lib/canonical/ launchpad/ javascript/ translations/ pofile. js' launchpad/ javascript/ translations/ pofile. js 2010-02-25 12:56:45 +0000 launchpad/ javascript/ translations/ pofile. js 2010-03-17 17:36:08 +0000 'display' , 'none'); ficationBox = function(e) { .important- notice- container' );
>--- lib/canonical/
>+++ lib/canonical/
>@@ -55,10 +55,15 @@
> node.setStyle(
> });
> hide_anim.run();
>-}
>+};
>
> self.updateNoti
> var notice = Y.one('
>+ if (!notice) {
Since Y.one() is expected to return null when the element is not found,
the preferred if-statement is:
if (notice !== null)
>+ // We have no notice container on this page, this is why there is one('.important -notice- balloon' ); notice_ cookie = ('translation- docs-for- ' + cookie) ; notice- cancel- button' );
>+ // nothing more to be done by this function.
>+ return;
>+ }
> var balloon = notice.
> var dismiss_
> documentation_
>@@ -74,6 +79,10 @@
> '.important-
> // Cancel button starts out hidden. If user has JavaScript,
> // then we want to show it.
>+ if (!cancel_button) {
Same here.
>+ // No cancel button was found to attach the action. button. setStyle( 'visibility' , 'visible'); button. on('click' , function(e) { #batchnav_ next')) { location. assign( link.get( 'href') ) #batchnav_ next');
>+ return;
>+ }
> cancel_
> cancel_
> e.halt();
>@@ -202,30 +211,34 @@
> }
> // Shift+Alt+n - Go to next page in batch
> if (e.shiftKey && e.altKey && e.keyCode == 78) {
>- if (link = Y.one('
>- window.
>+ link = Y.one('
>+ if (link){
Same for these if-statements.
>+ window. location. assign( link.get( 'href') ); #batchnav_ previous' )){ location. assign( link.get( 'href') ) #batchnav_ previous' ); location. assign( link.get( 'href') ); #batchnav_ first') ){ location. assign( link.get( 'href') ) #batchnav_ first') ; location. assign( link.get( 'href') ); #batchnav_ last')) { location. assign( link.get( 'href') ) #batchnav_ last'); location. assign( link.get( 'href') );
> }
> }
> // Shift+Alt+p - Go to previous page in batch
> if (e.shiftKey && e.altKey && e.keyCode == 80) {
>- if (link = Y.one('
>- window.
>+ link = Y.one('
>+ if (link){
>+ window.
> }
> }
> // Shift+Alt+a - Go to first page in batch
> if (e.shiftKey && e.altKey && e.keyCode == 65) {
>- if (link = Y.one('
>- window.
>+ link = Y.one('
>+ if (link){
>+ window.
> }
> }
> // Shift+Alt+l - Go to last page in batch
> if (e.shiftKey && e.altKey && e.keyCode == 76) {
>- if (link = Y.one('
>- window.
>+ link = Y.one('
>+ if (link){
>+ window.
> }
> }
> });
Please replace all the tab characters with spaces. tab:>*, trail:*
You can make vim display tab characters differently than spaces
by adding the following config to your .vimrc file.
au BufEnter *.py set list listchars=
I have no idea how to do that in emacs.
>-} stionsKeyBindin gs = function(stem) { sKeyBindings = function (fields) { copy_text) ; translations/ templates/ pofile- translate. pt' translations/ templates/ pofile- translate. pt 2010-02-25 00:47:17 +0000 translations/ templates/ pofile- translate. pt 2010-03-17 17:36:08 +0000 adFunction( insertAllExpans ionButtons) ; 'lp.pofile' , function(Y) { updateNotificat ionBox) ; 'lp.pofile' , function(Y) { setupSuggestion Dismissal) ; updateNotificat ionBox) ; 'lp.pofile' , function(Y) {
>+};
>
>
> var initializeSugge
>@@ -243,7 +256,7 @@
> Y, node.get('id'));
> }
> });
>-}
>+};
>
>
> var initializeField
>@@ -321,7 +334,7 @@
> singular_
> }
> }
>-}
>+};
>
>
> /**
>
>=== modified file 'lib/lp/
>--- lib/lp/
>+++ lib/lp/
>@@ -22,13 +22,21 @@
> registerLaunchp
>
> LPS.use(
>+ Y.on('domready', Y.lp.pofile.
>+ });
>+
>+ LPS.use(
> Y.on('domready', Y.lp.pofile.
>- Y.on('domready', Y.lp.pofile.
>+ });
>+
>+ LPS.use(
Why are you calling LPS.use( 'lp.pofile' , ...) repeatedly? This
should have no effect unless there is something seriously wrong with
lp.pofile.
> Y.on('domready', Y.lp.pofile. initializeKeyBi ndings) ; setFocus( autofocus_ field); slot="main" >
> Y.on('domready', function(e) {
> Y.lp.pofile.
> });
> });
>+
>+
> </script>
> </div>
> <div metal:fill-
>