I moved the try/catch in a single domready block, declared link as a local varibaled and used === to compare for null.
Here is the latests diff:
=== modified file 'lib/canonical/launchpad/javascript/translations/pofile.js'
--- lib/canonical/launchpad/javascript/translations/pofile.js 2010-03-22 14:59:40 +0000
+++ lib/canonical/launchpad/javascript/translations/pofile.js 2010-03-22 17:43:04 +0000
@@ -59,7 +59,7 @@
self.updateNotificationBox = function(e) {
var notice = Y.one('.important-notice-container');
- if (notice == null) {
+ 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;
@@ -79,7 +79,7 @@ '.important-notice-cancel-button');
// Cancel button starts out hidden. If user has JavaScript,
// then we want to show it.
- if (cancel_button == null) {
+ if (cancel_button === null) {
// No cancel button was found to attach the action.
return;
}
@@ -197,6 +197,7 @@
var initializeGlobalKeyBindings = function(fields) {
Y.get('document').on("keyup", function(e) {
+ var link;
// Shift+Alt+s - Save form
if (e.shiftKey && e.altKey && e.keyCode == 83) { Y.one('#save_and_continue_button').invoke('click');
Hi Edwin and thanks for the review!
I moved the try/catch in a single domready block, declared link as a local varibaled and used === to compare for null.
Here is the latests diff: launchpad/ javascript/ translations/ pofile. js' launchpad/ javascript/ translations/ pofile. js 2010-03-22 14:59:40 +0000 launchpad/ javascript/ translations/ pofile. js 2010-03-22 17:43:04 +0000
=== modified file 'lib/canonical/
--- lib/canonical/
+++ lib/canonical/
@@ -59,7 +59,7 @@
self.updateNot ificationBox = function(e) { .important- notice- container' );
'.important- notice- cancel- button' ); lKeyBindings = function(fields) {
var notice = Y.one('
- if (notice == null) {
+ 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;
@@ -79,7 +79,7 @@
// Cancel button starts out hidden. If user has JavaScript,
// then we want to show it.
- if (cancel_button == null) {
+ if (cancel_button === null) {
// No cancel button was found to attach the action.
return;
}
@@ -197,6 +197,7 @@
var initializeGloba
Y. get('document' ).on("keyup" , function(e) {
Y. one('#save_ and_continue_ button' ).invoke( 'click' );
+ var link;
// Shift+Alt+s - Save form
if (e.shiftKey && e.altKey && e.keyCode == 83) {
=== modified file 'lib/lp/ translations/ templates/ pofile- translate. pt' translations/ templates/ pofile- translate. pt 2010-03-22 14:59:44 +0000 translations/ templates/ pofile- translate. pt 2010-03-22 17:34:27 +0000
Y.log( e, "error");
--- lib/lp/
+++ lib/lp/
@@ -25,25 +25,19 @@
} catch (e) {
}
- });
- Y.on('domready', function(e) {
Y.lp.pofile. setupSuggestion Dismissal( );
Y.log( e, "error");
try {
} catch (e) {
}
- });
- Y.on('domready', function(e) {
Y.lp.pofile. initializeKeyBi ndings( );
Y.log( e, "error");
try {
} catch (e) {
}
- });
- Y.on('domready', function(e) {
Y.lp.pofile. setFocus( autofocus_ field);
try {
} catch (e) {
=== modified file 'lib/lp/ translations/ templates/ translationmess age-translate. pt' translations/ templates/ translationmess age-translate. pt 2010-03-22 14:50:08 +0000 translations/ templates/ translationmess age-translate. pt 2010-03-22 17:35:02 +0000
Y.log( e, "error");
--- lib/lp/
+++ lib/lp/
@@ -21,17 +21,13 @@
} catch (e) {
}
- });
- Y.on('domready', function(e) {
Y.lp.pofile. initializeKeyBi ndings( );
Y.log( e, "error");
try {
} catch (e) {
}
- });
- Y.on('domready', function(e) {
Y.lp.pofile. setFocus( autofocus_ field);
try {
} catch (e) {