[Pkg-mozext-commits] [perspectives-extension] 26/72: added in results_dialog: indicate cached results, fixed in statusbar: indicate whitelist Fixes #128

David Prévot taffit at moszumanska.debian.org
Thu Dec 11 02:12:47 UTC 2014


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

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

commit d437958b9c970ee9ba043552c200a047d637585a
Author: Gerold Meisinger <gerold.meisinger at gmail.com>
Date:   Thu Jul 3 21:32:48 2014 +0100

    added in results_dialog: indicate cached results, fixed in statusbar: indicate whitelist
    Fixes #128
---
 plugin/chrome/content/notaries.js             | 17 +++++++++--------
 plugin/chrome/content/results_dialog.js       |  5 +++--
 plugin/chrome/content/statusbar.js            |  1 -
 plugin/chrome/locale/de/results.properties    |  1 +
 plugin/chrome/locale/en-US/results.properties |  1 +
 plugin/chrome/locale/es-MX/results.properties |  4 +++-
 plugin/chrome/locale/fi/results.properties    |  2 ++
 plugin/chrome/locale/fr/results.properties    |  2 ++
 plugin/chrome/locale/nl/results.properties    |  2 ++
 plugin/chrome/locale/pl/results.properties    |  2 ++
 plugin/chrome/locale/zh-CN/results.properties |  2 ++
 11 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/plugin/chrome/content/notaries.js b/plugin/chrome/content/notaries.js
index 02640fb..bed81e7 100644
--- a/plugin/chrome/content/notaries.js
+++ b/plugin/chrome/content/notaries.js
@@ -319,7 +319,7 @@ var Perspectives = {
 						}
 					}
 					if(!found) {
-						missing_replies.push(Perspectives.all_notaries[i])
+						missing_replies.push(Perspectives.all_notaries[i]);
 					}
 				}
 
@@ -391,7 +391,7 @@ var Perspectives = {
 									}
 								}
 							} else {
-								break
+								break;
 							}
 						}
 					} else {
@@ -421,7 +421,7 @@ var Perspectives = {
 								return;
 							} else {
 								result_list.splice(i, 1);
-								break
+								break;
 							}
 						}
 					}
@@ -529,6 +529,7 @@ var Perspectives = {
 										is_inconsistent,
 										weakly_seen,
 										server_result_list);
+			ti.is_cached = false;
 			Perspectives.process_notary_results(ti);
 
 		} catch (e) {
@@ -536,7 +537,6 @@ var Perspectives = {
 		}
 	},
 
-
 	do_override: function(browser, cert,isTemp) {
 		var uri = browser.currentURI;
 		Pers_debug.d_print("main", "Do Override\n");
@@ -559,7 +559,7 @@ var Perspectives = {
 		Perspectives.overrideService.rememberValidityOverride(
 			uri.asciiHost, uri.port, cert, flags, isTemp);
 
-		setTimeout(function() { browser.loadURIWithFlags(uri.spec, flags); }, 25);
+		setTimeout(function() { browser.loadURIWithFlags(uri.spec, flags); }, 25); // TODO: magic number
 		return true;
 	},
 
@@ -625,9 +625,9 @@ var Perspectives = {
 						Perspectives.setFaviconText(text);
 						Pers_notify.do_notify(ti, Pers_notify.TYPE_WHITELIST);
 					}
-				}, 1000);
+				}, 1000); // TODO: magic number, btw: why the async call?
 			}
-			Pers_statusbar.setStatus(ti.uri, Pers_statusbar.STATE_SEC, text);
+			Pers_statusbar.setStatus(ti.uri, Pers_statusbar.STATE_WHITELIST, text);
 			ti.reason_str = text;
 			return;
 		} else {
@@ -666,6 +666,7 @@ var Perspectives = {
 		}
 
 		if(ti.query_results) {
+			ti.is_cached = true;
 			Perspectives.process_notary_results(ti);
 		} else {
 			Pers_debug.d_print("main", ti.uri.host + " needs a request");
@@ -1051,6 +1052,7 @@ var Perspectives = {
 			ti.has_user_permission = false;
 			ti.last_banner_type = null;
 			Perspectives.tab_info_cache[service_id] = ti;
+			ti.is_cached = false;
 		}
 		ti.uri = uri;
 		ti.host = uri.host;
@@ -1132,7 +1134,6 @@ var Perspectives = {
 		}
 		catch (e) {
 			Pers_debug.d_print("error", "Error: could not prompt to update preferences about check_good_certificates: " + e);
-			return;
 		}
 		finally {
 			//set the flag to not ask the user again, even (especially!) if something went wrong.
diff --git a/plugin/chrome/content/results_dialog.js b/plugin/chrome/content/results_dialog.js
index 149bea1..abb6e6a 100644
--- a/plugin/chrome/content/results_dialog.js
+++ b/plugin/chrome/content/results_dialog.js
@@ -43,7 +43,7 @@ var Pers_results = {
  		}
 
 		if(ti.uri.scheme != "https") {
-			return Pers_results.strbundle.getFormattedString("notHTTPS", [ ti.uri.scheme ]);
+			return Pers_results.strbundle.getFormattedString("notHTTPS", [ti.uri.scheme]);
 		} else if(ti.is_override_cert && ti.already_trusted) {
 			return Pers_results.strbundle.getString("previouslyInstalledCert");
 		} else if(ti.already_trusted) {
@@ -83,7 +83,8 @@ var Pers_results = {
 			var cert  = ti.query_results;
 			host.label = ti.uri.host;
 			if(ti) {
-				host.label += ": " + Pers_results.getActionStr(ti);
+				debugger
+				host.label += ": " + Pers_results.getActionStr(ti) + (ti.is_cached ? " " + Pers_results.strbundle.getString("cachedResults") : "");
 			}
 			if(cert){
 				info.value  = cert.summary;
diff --git a/plugin/chrome/content/statusbar.js b/plugin/chrome/content/statusbar.js
index b225252..a614d31 100644
--- a/plugin/chrome/content/statusbar.js
+++ b/plugin/chrome/content/statusbar.js
@@ -100,7 +100,6 @@ var Pers_statusbar = {
 				imgList[j].setAttribute("src", "chrome://perspectives/content/img/default.png");
 				continue;
 			case Pers_statusbar.STATE_WHITELIST:
-				//TODO: have other code call this
 				Pers_debug.d_print("main", "Whitelist Status");
 				imgList[j].setAttribute("src", "chrome://perspectives/content/img/whitelist.png");
 				continue;
diff --git a/plugin/chrome/locale/de/results.properties b/plugin/chrome/locale/de/results.properties
index 57d956b..9e5347b 100644
--- a/plugin/chrome/locale/de/results.properties
+++ b/plugin/chrome/locale/de/results.properties
@@ -6,3 +6,4 @@ browserTrusts=Der Webbrowser vertraut dieser Webseite und benötigt daher keine
 tempSecurityException=Perspectives hat für diese Webseite eine temporäre Sicherheitsausnahme eingerichtet
 permanentSecurityException=Perspectives hat für diese Webseite eine dauerhafte Sicherheitsausnahme eingerichtet
 noException=Keine Sicherheitsausnahme eingerichtet
+cachedResults=(Ergebnis aus dem Cache)
diff --git a/plugin/chrome/locale/en-US/results.properties b/plugin/chrome/locale/en-US/results.properties
index 7e28df9..1d29fc8 100644
--- a/plugin/chrome/locale/en-US/results.properties
+++ b/plugin/chrome/locale/en-US/results.properties
@@ -6,3 +6,4 @@ browserTrusts=The browser trusts this site and requires no security exception
 tempSecurityException=Perspectives installed a temporary security exception for this site
 permanentSecurityException=Perspectives installed a permanent security exception for this site
 noException=No security exception has been installed
+cachedResults=(cached results)
diff --git a/plugin/chrome/locale/es-MX/results.properties b/plugin/chrome/locale/es-MX/results.properties
index 5159cd6..767a680 100644
--- a/plugin/chrome/locale/es-MX/results.properties
+++ b/plugin/chrome/locale/es-MX/results.properties
@@ -1,8 +1,10 @@
 # This file contains localized strings for Perspectives javascript code
 errorLoadingResultsDialog=Error al cargar el diálogo de Resultados
 notHTTPS=Perspectives solamente cuestiona sitios que soportan el protocolo 'https' Este sitio utiliza '%1$S'
-previouslyInstalledCert=Perpectives ya ha instalado una excepción de seguridad para este sitio con anterioridad 
+previouslyInstalledCert=Perpectives ya ha instalado una excepción de seguridad para este sitio con anterioridad
 browserTrusts=El navegador confía en este sitio, y no requiere una excepción de seguridad
 tempSecurityException=Perspectives ha instalado una excepción de seguridad temporal para este sitio
 permanentSecurityException=Perspectives ha instalado una excepción de seguridad permanente para este sitio
 noException=No se ha instalado excepción de seguridad alguna
+# TODO translate
+cachedResults=(cached results)
diff --git a/plugin/chrome/locale/fi/results.properties b/plugin/chrome/locale/fi/results.properties
index 7e28df9..1e80977 100644
--- a/plugin/chrome/locale/fi/results.properties
+++ b/plugin/chrome/locale/fi/results.properties
@@ -6,3 +6,5 @@ browserTrusts=The browser trusts this site and requires no security exception
 tempSecurityException=Perspectives installed a temporary security exception for this site
 permanentSecurityException=Perspectives installed a permanent security exception for this site
 noException=No security exception has been installed
+# TODO translate
+cachedResults=(cached results)
diff --git a/plugin/chrome/locale/fr/results.properties b/plugin/chrome/locale/fr/results.properties
index ef37234..fada2b2 100644
--- a/plugin/chrome/locale/fr/results.properties
+++ b/plugin/chrome/locale/fr/results.properties
@@ -6,3 +6,5 @@ browserTrusts=Le navigateur fait confiance à ce site et ne réclame pas d'excep
 tempSecurityException=Perspectives a installé une exception de sécurité temporaire pour ce site
 permanentSecurityException=Perspectives a installé une exception de sécurité permanente pour ce site
 noException=Aucune exception de sécurité n'a été installée
+# TODO translate
+cachedResults=(cached results)
diff --git a/plugin/chrome/locale/nl/results.properties b/plugin/chrome/locale/nl/results.properties
index 27fa541..916899e 100644
--- a/plugin/chrome/locale/nl/results.properties
+++ b/plugin/chrome/locale/nl/results.properties
@@ -6,3 +6,5 @@ browserTrusts=De browser vertrouwt deze site en vereist geen beveiligings uitzon
 tempSecurityException=Perspectives heeft een tijdelijke beveiligings uitzondering voor deze site geïnstalleerd
 permanentSecurityException=Perspectives heeft een permanente beveiligings uitzondering voor deze site geïnstalleerd
 noException=Er is geen beveiligings uitzondering geïnstalleerd
+# TODO translate
+cachedResults=(cached results)
diff --git a/plugin/chrome/locale/pl/results.properties b/plugin/chrome/locale/pl/results.properties
index ef12eef..0e0bd80 100644
--- a/plugin/chrome/locale/pl/results.properties
+++ b/plugin/chrome/locale/pl/results.properties
@@ -6,3 +6,5 @@ browserTrusts=Przeglądarka ufa tej stronie i nie wymaga wyjątku bezpieczeństw
 tempSecurityException=Perspectives zainstalowało tymczasowy wyjątek bezpieczeństwa dla tej strony
 permanentSecurityException=Perspectives zainstalowało trwały wyjątek bezpieczeństwa dla tej strony
 noException=Brak zainstalowanych wyjątków bezpieczeństwa
+# TODO translate
+cachedResults=(cached results)
diff --git a/plugin/chrome/locale/zh-CN/results.properties b/plugin/chrome/locale/zh-CN/results.properties
index 02cd5b0..e9a0db7 100644
--- a/plugin/chrome/locale/zh-CN/results.properties
+++ b/plugin/chrome/locale/zh-CN/results.properties
@@ -6,3 +6,5 @@ browserTrusts=浏览器信任此站点,不需要设置安全例外
 tempSecurityException=Perspectives 为此站点添加了临时安全例外
 permanentSecurityException=Perspectives 为此站点添加了永久安全例外
 noException=未添加安全例外
+# TODO translate
+cachedResults=(cached results)

-- 
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