[Pkg-mozext-commits] [perspectives-extension] 38/44: Perspectives - convert prompt_update() to better retrieval methods

David Prévot taffit at moszumanska.debian.org
Sun Jun 26 04:59:21 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository perspectives-extension.

commit 43583ea651e022d4cb9f608e929718d3fb8abef6
Author: Dave Schaefer <dave.schaefer at gmail.com>
Date:   Tue Jun 14 22:56:57 2016 -0700

    Perspectives - convert prompt_update() to better retrieval methods
---
 plugin/chrome/content/init.js     |  3 ---
 plugin/chrome/content/notaries.js | 24 ++++++++----------------
 2 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/plugin/chrome/content/init.js b/plugin/chrome/content/init.js
index 9231f9e..bda792e 100644
--- a/plugin/chrome/content/init.js
+++ b/plugin/chrome/content/init.js
@@ -24,9 +24,6 @@ var Pers_init = {
     evtLoad: function(){
       Perspectives.init_data();
       Perspectives.initNotaries();
-
-      // call this *after* the document has loaded
-      // so we have access to the stringbundle from statusbar.xul
       Perspectives.prompt_update();
 
       const FIRSTRUN_PREF = "extensions.perspectives.first_run";
diff --git a/plugin/chrome/content/notaries.js b/plugin/chrome/content/notaries.js
index db4bee8..cdf552e 100644
--- a/plugin/chrome/content/notaries.js
+++ b/plugin/chrome/content/notaries.js
@@ -1211,13 +1211,11 @@ var Perspectives = {
 			const Cc = Components.classes, Ci = Components.interfaces;
 
 			//'prompt_update_all_https_setting' stores a value for "have we already asked the user about this?"
-			var ask_update = Perspectives.root_prefs.
-	                getBoolPref("extensions.perspectives.prompt_update_all_https_setting");
+			var ask_update = Perspectives.getBoolPref("extensions.perspectives.prompt_update_all_https_setting");
 
 			if(ask_update === true) {
 
-				var check_good = Perspectives.root_prefs.
-						getBoolPref("extensions.perspectives.check_good_certificates");
+				var check_good = Perspectives.getBoolPref("extensions.perspectives.check_good_certificates");
 
 				if(!check_good) {
 
@@ -1229,19 +1227,14 @@ var Perspectives = {
 							+ prompts.BUTTON_POS_1 * prompts.BUTTON_TITLE_IS_STRING
 							+ prompts.BUTTON_POS_0_DEFAULT;
 
-					if(Perspectives.strbundle == null) {
-						Perspectives.strbundle = document.getElementById("notary_strings");
-					}
-
 					var answer = prompts.confirmEx(null,
-						Perspectives.strbundle.getString("updatePromptTitle"),
-						Perspectives.strbundle.getString("updatePrompt"), buttons,
-						Perspectives.strbundle.getString("updatePromptButtonYes"), // the default button
-						Perspectives.strbundle.getString("updatePromptButtonNo"),
+						Perspectives.getString("updatePromptTitle"),
+						Perspectives.getString("updatePrompt"), buttons,
+						Perspectives.getString("updatePromptButtonYes"), // the default button
+						Perspectives.getString("updatePromptButtonNo"),
 						"", null, check);
 					if(answer === 0) {
-						Perspectives.root_prefs.
-							setBoolPref("extensions.perspectives.check_good_certificates",
+						Perspectives.setBoolPref("extensions.perspectives.check_good_certificates",
 										true);
 					}
 				}
@@ -1254,8 +1247,7 @@ var Perspectives = {
 			//set the flag to not ask the user again, even (especially!) if something went wrong.
 			//this way even in the worst case the user will only get a popup once.
 			//they can always change their preferences later through the prefs dialog if they wish.
-			Perspectives.root_prefs.
-						setBoolPref("extensions.perspectives.prompt_update_all_https_setting",
+			Perspectives.setBoolPref("extensions.perspectives.prompt_update_all_https_setting",
 									false);
 		}
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/perspectives-extension.git



More information about the Pkg-mozext-commits mailing list