[Pkg-mozext-commits] [gcontactsync] 04/19: Issue #70: Remove event listeners when no longer required
David Prévot
taffit at moszumanska.debian.org
Thu Apr 2 17:47:17 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository gcontactsync.
commit c42729ca87ac1e0a1f649b11117cbcba8136f6ba
Author: Josh Geenen <joshgeenen at gmail.com>
Date: Sun Mar 29 15:26:31 2015 -0500
Issue #70: Remove event listeners when no longer required
---
src/content/ABOverlay.js | 9 +++++----
src/content/AccountSetupWizard.js | 5 +++--
src/content/Accounts.js | 5 +++--
src/content/CardDialogOverlay.js | 9 +++++----
src/content/ContactConverter.js | 9 +++++----
src/content/FileIO.js | 9 +++++----
src/content/MessengerOverlay.js | 9 +++++----
src/content/Overlay.js | 10 ++++++----
src/content/Preferences.js | 12 +++++++-----
src/content/gdata.js | 9 +++++----
src/content/options.js | 9 +++++----
11 files changed, 54 insertions(+), 41 deletions(-)
diff --git a/src/content/ABOverlay.js b/src/content/ABOverlay.js
index 04e3f1c..4d11318 100644
--- a/src/content/ABOverlay.js
+++ b/src/content/ABOverlay.js
@@ -15,7 +15,7 @@
*
* The Initial Developer of the Original Code is
* Josh Geenen <gcontactsync at pirules.org>.
- * Portions created by the Initial Developer are Copyright (C) 2008-2011
+ * Portions created by the Initial Developer are Copyright (C) 2008-2015
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
@@ -34,13 +34,14 @@
*
* ***** END LICENSE BLOCK ***** */
-if (!com) var com = {}; // A generic wrapper variable
+if (!com) {var com = {};} // A generic wrapper variable
// A wrapper for all GCS functions and variables
-if (!com.gContactSync) com.gContactSync = {};
+if (!com.gContactSync) {com.gContactSync = {};}
window.addEventListener("load",
/** Initializes the ABOverlay class when the window has finished loading */
- function gCS_abOverlayLoadListener(e) {
+ function gCS_abOverlayLoadListener() {
+ window.removeEventListener("load", gCS_abOverlayLoadListener, false);
com.gContactSync.ABOverlay.initialize();
},
false);
diff --git a/src/content/AccountSetupWizard.js b/src/content/AccountSetupWizard.js
index 083488b..fd3c732 100644
--- a/src/content/AccountSetupWizard.js
+++ b/src/content/AccountSetupWizard.js
@@ -15,7 +15,7 @@
*
* The Initial Developer of the Original Code is
* Josh Geenen <gcontactsync at pirules.org>.
- * Portions created by the Initial Developer are Copyright (C) 2013-2014
+ * Portions created by the Initial Developer are Copyright (C) 2013-2015
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
@@ -40,7 +40,8 @@ if (!com.gContactSync) {com.gContactSync = {};}
window.addEventListener("load",
/** Initializes the AccountSetupWizard class when the window has finished loading */
- function gCS_AccountSetupWizardLoadListener(e) {
+ function gCS_AccountSetupWizardLoadListener() {
+ window.removeEventListener("load", gCS_AccountSetupWizardLoadListener, false);
com.gContactSync.AccountSetupWizard.init();
},
false);
diff --git a/src/content/Accounts.js b/src/content/Accounts.js
index aef9651..c77f07b 100644
--- a/src/content/Accounts.js
+++ b/src/content/Accounts.js
@@ -15,7 +15,7 @@
*
* The Initial Developer of the Original Code is
* Josh Geenen <gcontactsync at pirules.org>.
- * Portions created by the Initial Developer are Copyright (C) 2009-2010
+ * Portions created by the Initial Developer are Copyright (C) 2009-2015
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
@@ -40,7 +40,8 @@ if (!com.gContactSync) {com.gContactSync = {};}
window.addEventListener("load",
/** Initializes the Accounts class when the window has finished loading */
- function gCS_AccountsLoadListener(e) {
+ function gCS_AccountsLoadListener() {
+ window.removeEventListener("load", gCS_AccountsLoadListener, false);
com.gContactSync.Accounts.initDialog();
},
false);
diff --git a/src/content/CardDialogOverlay.js b/src/content/CardDialogOverlay.js
index af99cfd..cd80c1e 100644
--- a/src/content/CardDialogOverlay.js
+++ b/src/content/CardDialogOverlay.js
@@ -15,7 +15,7 @@
*
* The Initial Developer of the Original Code is
* Josh Geenen <gcontactsync at pirules.org>.
- * Portions created by the Initial Developer are Copyright (C) 2008-2012
+ * Portions created by the Initial Developer are Copyright (C) 2008-2015
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
@@ -34,13 +34,14 @@
*
* ***** END LICENSE BLOCK ***** */
-if (!com) var com = {}; // A generic wrapper variable
+if (!com) {var com = {};} // A generic wrapper variable
// A wrapper for all GCS functions and variables
-if (!com.gContactSync) com.gContactSync = {};
+if (!com.gContactSync) {com.gContactSync = {};}
window.addEventListener("load",
/** Initializes the CardDialogOverlay when the window has finished loading. */
- function gCS_CardDialogOverlayLoadListener(e) {
+ function gCS_CardDialogOverlayLoadListener() {
+ window.removeEventListener("load", gCS_CardDialogOverlayLoadListener, false);
com.gContactSync.CardDialogOverlay.init();
},
false);
diff --git a/src/content/ContactConverter.js b/src/content/ContactConverter.js
index 920ad92..7566ac9 100644
--- a/src/content/ContactConverter.js
+++ b/src/content/ContactConverter.js
@@ -15,7 +15,7 @@
*
* The Initial Developer of the Original Code is
* Josh Geenen <gcontactsync at pirules.org>.
- * Portions created by the Initial Developer are Copyright (C) 2008-2014
+ * Portions created by the Initial Developer are Copyright (C) 2008-2015
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
@@ -34,13 +34,14 @@
*
* ***** END LICENSE BLOCK ***** */
-if (!com) var com = {}; // A generic wrapper variable
+if (!com) {var com = {};} // A generic wrapper variable
// A wrapper for all GCS functions and variables
-if (!com.gContactSync) com.gContactSync = {};
+if (!com.gContactSync) {com.gContactSync = {};}
window.addEventListener("load",
/** Initializes the ContactConverter class when the window has finished loading */
- function gCS_ContactConverterLoadListener(e) {
+ function gCS_ContactConverterLoadListener() {
+ window.removeEventListener("load", gCS_ContactConverterLoadListener, false);
com.gContactSync.ContactConverter.init();
},
false);
diff --git a/src/content/FileIO.js b/src/content/FileIO.js
index e2b169f..bd5d796 100644
--- a/src/content/FileIO.js
+++ b/src/content/FileIO.js
@@ -15,7 +15,7 @@
*
* The Initial Developer of the Original Code is
* Josh Geenen <gcontactsync at pirules.org>.
- * Portions created by the Initial Developer are Copyright (C) 2008-2009
+ * Portions created by the Initial Developer are Copyright (C) 2008-2015
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
@@ -34,13 +34,14 @@
*
* ***** END LICENSE BLOCK ***** */
-if (!com) var com = {}; // A generic wrapper variable
+if (!com) {var com = {};} // A generic wrapper variable
// A wrapper for all GCS functions and variables
-if (!com.gContactSync) com.gContactSync = {};
+if (!com.gContactSync) {com.gContactSync = {};}
window.addEventListener("load",
/** Initializes the FileIO class when the window has finished loading */
- function gCS_FileIOLoadListener(e) {
+ function gCS_FileIOLoadListener() {
+ window.removeEventListener("load", gCS_FileIOLoadListener, false);
com.gContactSync.FileIO.init();
},
false);
diff --git a/src/content/MessengerOverlay.js b/src/content/MessengerOverlay.js
index 56acf08..1cceef6 100644
--- a/src/content/MessengerOverlay.js
+++ b/src/content/MessengerOverlay.js
@@ -15,7 +15,7 @@
*
* The Initial Developer of the Original Code is
* Josh Geenen <gcontactsync at pirules.org>.
- * Portions created by the Initial Developer are Copyright (C) 2010-2014
+ * Portions created by the Initial Developer are Copyright (C) 2010-2015
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
@@ -34,13 +34,14 @@
*
* ***** END LICENSE BLOCK ***** */
-if (!com) var com = {}; // A generic wrapper variable
+if (!com) {var com = {};} // A generic wrapper variable
// A wrapper for all GCS functions and variables
-if (!com.gContactSync) com.gContactSync = {};
+if (!com.gContactSync) {com.gContactSync = {};}
window.addEventListener("load",
/** Initializes the MessengerOverlay class when the window has finished loading */
- function gCS_mainOverlayLoadListener(e) {
+ function gCS_mainOverlayLoadListener() {
+ window.removeEventListener("load", gCS_mainOverlayLoadListener, false);
// introduce a slight delay before initializing to let FileIO load in TB 2
setTimeout(com.gContactSync.MessengerOverlay.initialize, 100);
},
diff --git a/src/content/Overlay.js b/src/content/Overlay.js
index 91a54ca..57f3529 100644
--- a/src/content/Overlay.js
+++ b/src/content/Overlay.js
@@ -15,7 +15,7 @@
*
* The Initial Developer of the Original Code is
* Josh Geenen <gcontactsync at pirules.org>.
- * Portions created by the Initial Developer are Copyright (C) 2008-2014
+ * Portions created by the Initial Developer are Copyright (C) 2008-2015
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
@@ -34,13 +34,14 @@
*
* ***** END LICENSE BLOCK ***** */
-if (!com) var com = {}; // A generic wrapper variable
+if (!com) {var com = {};} // A generic wrapper variable
// A wrapper for all GCS functions and variables
-if (!com.gContactSync) com.gContactSync = {};
+if (!com.gContactSync) {com.gContactSync = {};}
window.addEventListener("load",
/** Initializes the FileIO class when the window has finished loading */
- function gCS_overlayLoadListener(e) {
+ function gCS_overlayLoadListener() {
+ window.removeEventListener("load", gCS_overlayLoadListener, false);
com.gContactSync.Overlay.initialize();
},
false);
@@ -71,6 +72,7 @@ com.gContactSync.Overlay = {
// call the unload function when the address book window is shut
window.addEventListener("unload", function unloadListener(e) {
+ window.removeEventListener("unload", unloadListener, false);
com.gContactSync.Overlay.unload();
}, false);
},
diff --git a/src/content/Preferences.js b/src/content/Preferences.js
index dec2910..994ecf3 100644
--- a/src/content/Preferences.js
+++ b/src/content/Preferences.js
@@ -15,7 +15,7 @@
*
* The Initial Developer of the Original Code is
* Josh Geenen <gcontactsync at pirules.org>.
- * Portions created by the Initial Developer are Copyright (C) 2008-2014
+ * Portions created by the Initial Developer are Copyright (C) 2008-2015
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
@@ -34,15 +34,16 @@
*
* ***** END LICENSE BLOCK ***** */
-if (!com) var com = {}; // A generic wrapper variable
+if (!com) {var com = {};} // A generic wrapper variable
// A wrapper for all GCS functions and variables
-if (!com.gContactSync) com.gContactSync = {};
+if (!com.gContactSync) {com.gContactSync = {};}
window.addEventListener("load",
/**
* Registers the pref observer and loads the preferences
*/
- function gCS_PreferencesLoadListener(e) {
+ function gCS_PreferencesLoadListener() {
+ window.removeEventListener("load", gCS_PreferencesLoadListener, false);
com.gContactSync.Preferences.register();
com.gContactSync.Preferences.getSyncPrefs();
},
@@ -52,7 +53,8 @@ window.addEventListener("unload",
/**
* Unregisters the pref observer.
*/
- function gCS_PreferencesUnloadListener(e) {
+ function gCS_PreferencesUnloadListener() {
+ window.removeEventListener("unload", gCS_PreferencesUnloadListener, false);
com.gContactSync.Preferences.unregister();
},
false);
diff --git a/src/content/gdata.js b/src/content/gdata.js
index 95859ac..3c7e3a8 100644
--- a/src/content/gdata.js
+++ b/src/content/gdata.js
@@ -15,7 +15,7 @@
*
* The Initial Developer of the Original Code is
* Josh Geenen <gcontactsync at pirules.org>.
- * Portions created by the Initial Developer are Copyright (C) 2008-2009
+ * Portions created by the Initial Developer are Copyright (C) 2008-2015
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
@@ -34,13 +34,14 @@
*
* ***** END LICENSE BLOCK ***** */
-if (!com) var com = {}; // A generic wrapper variable
+if (!com) {var com = {};} // A generic wrapper variable
// A wrapper for all GCS functions and variables
-if (!com.gContactSync) com.gContactSync = {};
+if (!com.gContactSync) {com.gContactSync = {};}
window.addEventListener("load",
/** Initializes the gdata class when the window has finished loading */
- function gCS_gdataLoadListener(e) {
+ function gCS_gdataLoadListener() {
+ window.removeEventListener("load", gCS_gdataLoadListener, false);
com.gContactSync.gdata.contacts.init();
},
false);
diff --git a/src/content/options.js b/src/content/options.js
index c7e2504..ff1e6d2 100644
--- a/src/content/options.js
+++ b/src/content/options.js
@@ -15,7 +15,7 @@
*
* The Initial Developer of the Original Code is
* Josh Geenen <gcontactsync at pirules.org>.
- * Portions created by the Initial Developer are Copyright (C) 2008-2014
+ * Portions created by the Initial Developer are Copyright (C) 2008-2015
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
@@ -34,13 +34,14 @@
*
* ***** END LICENSE BLOCK ***** */
-if (!com) var com = {}; // A generic wrapper variable
+if (!com) {var com = {};} // A generic wrapper variable
// A wrapper for all GCS functions and variables
-if (!com.gContactSync) com.gContactSync = {};
+if (!com.gContactSync) {com.gContactSync = {};}
window.addEventListener("load",
/** Initializes the Options class when the window has finished loading */
- function gCS_OptionsLoadListener(e) {
+ function gCS_OptionsLoadListener() {
+ window.removeEventListener("load", gCS_OptionsLoadListener, false);
com.gContactSync.Options.init();
window.sizeToContent();
},
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/gcontactsync.git
More information about the Pkg-mozext-commits
mailing list