[Pkg-privacy-commits] [xul-ext-monkeysphere] 59/296: ripping out dialog boxes and consolidating code

Ximin Luo infinity0 at moszumanska.debian.org
Mon Aug 24 07:39:25 UTC 2015


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

infinity0 pushed a commit to branch debian
in repository xul-ext-monkeysphere.

commit e1636e101b152936963ef23d73608104da63a42e
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Sun Feb 7 19:01:40 2010 -0500

    ripping out dialog boxes and consolidating code
---
 chrome/content/dialog_status.js  | 85 ----------------------------------------
 chrome/content/dialog_status.xul | 60 ----------------------------
 chrome/content/monkeysphere.js   | 13 ++++++
 chrome/content/statusbar.js      | 41 -------------------
 chrome/content/statusbar.xul     | 10 ++---
 5 files changed, 17 insertions(+), 192 deletions(-)

diff --git a/chrome/content/dialog_status.js b/chrome/content/dialog_status.js
deleted file mode 100644
index 9be1299..0000000
--- a/chrome/content/dialog_status.js
+++ /dev/null
@@ -1,85 +0,0 @@
-// Monkeysphere XUL extension
-// Copyright © 2010 Jameson Rollins <jrollins at finestructure.net>
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-var root_prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
-
-monkeysphere.status.form = function() {
-  var sel = document.getElementById("info-radio").selectedIndex;
-  document.getElementById("monkeysphere-svg-box").hidden = sel;
-  document.getElementById("monkeysphere-description").hidden = !sel;
-}
-
-// returns a string that describes whether monkeysphere installed a security exception
-monkeysphere.status.actionStr = function(uri,ti) {
- if(uri.scheme != "https")
-   return "Monkeysphere only queries 'https' sites. This site uses '" + uri.scheme + "'.";
- if(ti.is_override_cert && ti.already_trusted)
-   return "Monkeysphere has previously installed a security exception for this site.";
- if(ti.already_trusted)
-   return "The browser trusts this site and requires no security exception.";
- if(ti.is_override_cert && ti.notary_valid && ti.exceptions_enabled && ti.isTemp)
-   return "Monkeysphere installed a temporary security exception for this site.";
- if(ti.is_override_cert && ti.notary_valid && ti.exceptions_enabled && !ti.isTemp)
-   return "Monkeysphere installed a permanent security exception for this site.";
- return "No security exception has been installed.";
-};
-
-monkeysphere.status.load = function() {
-  try {
-    var info = document.getElementById("monkeysphere-description");
-    var host = document.getElementById("monkeysphere-information-caption");
-
-    if(!window.opener) {
-      log("error", "window.opener is null in results dialog");
-      return;
-      }
-      var uri = window.opener.gBrowser.currentURI;
-      if(!uri) {
-	log("error", "null URI in results dialog");
-      return;
-    }
-    try {
-      var ignore = uri.host;
-    } catch(e) {
-      return;
-    }
-
-    var other_cache = window.opener.other_cache;
-    var cert = window.opener.ssl_cache[uri.host];
-    var ti = window.opener.tab_info_cache[uri.spec];
-    host.label = uri.host;
-    if(ti) {
-      host.label += ": " + getActionStr(uri, ti);
-    }
-    if(cert){
-      info.value  = cert.summary;
-      liner.value = cert.tooltip;
-      if(cert.svg && cert.svg != ""){
-      	info.hidden = true;
-      	var radio = document.getElementById("info-radio");
-      	radio.hidden=false;
-      	radio.selectedIndex = 0;
-      }
-    } else if (other_cache["reason"]) {
-      info.value = other_cache["reason"];
-    }
-  } catch(e) {
-    var text = "error loading results dialog: " + e;
-    log("error", text);
-    alert(text);
-  }
-  return true;
-};
diff --git a/chrome/content/dialog_status.xul b/chrome/content/dialog_status.xul
deleted file mode 100644
index a2ea233..0000000
--- a/chrome/content/dialog_status.xul
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-Monkeysphere XUL extension
-Copyright © 2010 Jameson Rollins <jrollins at finestructure.net>
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
--->
-
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<!DOCTYPE prefwindow SYSTEM "chrome://monkeysphere/locale/dialogs.dtd">
-
-<window id="monkeysphere-results" 
-	title="Monkeysphere Results"
-	xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-	buttons=","
-	onload="monkeysphere.dialog.status()">
-
-<vbox>
-  <groupbox minheight="235">
-    <caption id="monkeysphere-information-caption" 
-	     label="Detailed Information" 
-	     style="font-weight: bold"
-	     />
-    <textbox id="monkeysphere-description"
-	     multiline="true" 
-	     readonly="true"
-	     flex="1"
-	     value="&ThereisnoMonkeysphereinformationavailableforthislocation;"
-	     />
-    <!-- svg goes into this box -->
-    <scrollbox id="monkeysphere-svg-box"/>
-  </groupbox>
-  <radiogroup id="info-radio" 
-	      hidden="true"
-	      orient="horizontal" 
-	      onclick="switchResultForm()">
-  </radiogroup>
-</vbox>
-
-<hbox>
-  <spacer flex="1"/>
-  <button label="&Close;" onclick="window.close()"/>
-</hbox>
-
-<script type="application/x-javascript" src="dialog_status.js"/>
-
-</window> 
diff --git a/chrome/content/monkeysphere.js b/chrome/content/monkeysphere.js
index 84cc5ba..a7472a0 100644
--- a/chrome/content/monkeysphere.js
+++ b/chrome/content/monkeysphere.js
@@ -683,5 +683,18 @@ var monkeysphere = {
   //Sets the tooltip and the text of the favicon popup on https sites
   setFaviconText: function(str) {
     document.getElementById("identity-box").tooltipText = str;
+  },
+
+  contextmenufunctions: {
+    clearSiteCache: function() {
+      monkeysphere.cache.clear(gBrowser.currentURI);
+    },
+    certs: function() {
+      openDialog("chrome://pippki/content/certManager.xul", "Certificate Manager");
+    },
+    help: function() {
+      gBrowser.loadOneTab("chrome://monkeysphere/locale/help.html",
+      null, null, null, false);
+    }
   }
 };
diff --git a/chrome/content/statusbar.js b/chrome/content/statusbar.js
deleted file mode 100644
index 48a3de8..0000000
--- a/chrome/content/statusbar.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// Monkeysphere XUL extension
-// Copyright © 2010 Jameson Rollins <jrollins at finestructure.net>
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-// note: when debugging, it is useful to open this dialogs as
-// windows for firebug console, etc
-
-monkeysphere.dialog = {
-  status: function() {
-    window.openDialog(
-    //window.open( // for debug
-      "chrome://monkeysphere/content/dialog_status.xul",
-      //"monkeysphereResults", "").focus();  // for debug
-      "monkeysphereResults", "centerscreen, chrome, toolbar").focus();
-  },
-
-  clearSiteCache: function() {
-    monkeysphere.cache.clear(gBrowser.currentURI);
-  },
-
-  certs: function() {
-    openDialog("chrome://pippki/content/certManager.xul", "Certificate Manager");
-  },
-
-  help: function() {
-    gBrowser.loadOneTab("chrome://monkeysphere/locale/help.html",
-			null, null, null, false);
-  }
-};
diff --git a/chrome/content/statusbar.xul b/chrome/content/statusbar.xul
index f5cf281..b1c6d67 100644
--- a/chrome/content/statusbar.xul
+++ b/chrome/content/statusbar.xul
@@ -28,13 +28,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 </stringbundleset>
 
   <script type="application/x-javascript" src="monkeysphere.js" />
-  <script type="application/x-javascript" src="statusbar.js" />
 
   <statusbar id="status-bar">
 
     <statusbarpanel id="monkeysphere-status"
-      		    ondblclick="monkeysphere.dialog.status();"
-		    tooltiptext="Monkeysphere">
+      		    tooltiptext="Monkeysphere">
       <image id="monkeysphere-status-image"
 	     src="chrome://monkeysphere/content/default.png"
 	     style="width:16px; height:16px;" 
@@ -44,11 +42,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
     <popupset>
       <popup id="monkeysphere-contextmenu" position="after_start">
 	<menuitem label="Clear Site Monkeysphere Cache"
-		  oncommand="monkeysphere.dialog.clearSiteCache()" />
+		  oncommand="monkeysphere.contextmenufunctions.clearSiteCache()" />
 	<menuitem label="View Certificate Store"
-		  oncommand="monkeysphere.dialog.certs()" />
+		  oncommand="monkeysphere.contextmenufunctions.certs()" />
 	<menuitem label="Help"
-		  oncommand="monkeysphere.dialog.help()" />
+		  oncommand="monkeysphere.contextmenufunctions.help()" />
       </popup>
     </popupset>
  

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/xul-ext-monkeysphere.git



More information about the Pkg-privacy-commits mailing list