[Pkg-privacy-commits] [xul-ext-monkeysphere] 204/296: move setStatus function to module

Ximin Luo infinity0 at moszumanska.debian.org
Mon Aug 24 07:39:40 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 e438744b5de9f4cf54eeb7e94e360b4e4a1b3625
Author: Jameson Rollins <jrollins at finestructure.net>
Date:   Sun Apr 25 14:55:04 2010 -0400

    move setStatus function to module
---
 chrome/content/monkeysphere.js | 34 ++++++++--------------------------
 modules/monkeysphere.jsm       | 25 ++++++++++++++++++++++++-
 2 files changed, 32 insertions(+), 27 deletions(-)

diff --git a/chrome/content/monkeysphere.js b/chrome/content/monkeysphere.js
index 47606c6..faec863 100644
--- a/chrome/content/monkeysphere.js
+++ b/chrome/content/monkeysphere.js
@@ -40,7 +40,7 @@ var monkeysphere = (function() {
 
     // if uri not relevant, return
     if(!ms.isRelevantURI(uri)) {
-      setStatus(browser, 'NEUTRAL');
+      ms.setStatus(browser, 'NEUTRAL');
       return;
     }
 
@@ -57,9 +57,9 @@ var monkeysphere = (function() {
       var response = ms.overrides.response(apd);
 
       if ( typeof response === 'undefined' ) {
-        setStatus(browser, 'NEUTRAL');
+        ms.setStatus(browser, 'NEUTRAL');
       } else {
-        setStatus(browser, 'VALID', response.message);
+        ms.setStatus(browser, 'VALID', response.message);
       }
       return;
 
@@ -83,24 +83,6 @@ var monkeysphere = (function() {
     queryAgent(browser, cert);
   };
 
-  //////////////////////////////////////////////////////////
-  // set site monkeysphere status
-  var setStatus = function(browser, state, message) {
-    if ( typeof message === 'undefined' ) {
-      message = '';
-    }
-    ms.log("set browser status: " + state + ', ' + message);
-    browser.monkeysphere = { state: state, message: message };
-  };
-
-  //////////////////////////////////////////////////////////
-  // clear site monkeysphere status for browser
-  var clearStatus = function(browser) {
-    ms.log("clear browser status");
-    delete browser.monkeysphere;
-  };
-
-
 ////////////////////////////////////////////////////////////
 // AGENT QUERY FUNCTIONS
 ////////////////////////////////////////////////////////////
@@ -139,7 +121,7 @@ var monkeysphere = (function() {
     ms.log("sending query...");
     client.send(query);
     ms.log("query sent");
-    setStatus(browser, 'INPROGRESS', messages.getString('statusINPROGRESS'));
+    ms.setStatus(browser, 'INPROGRESS', monkeysphere.messages.getString('statusINPROGRESS'));
   };
 
 ////////////////////////////////////////////////////////////
@@ -286,7 +268,7 @@ var monkeysphere = (function() {
           // VALID!
           ms.log("SITE VERIFIED!");
           ms.overrides.set(client.apd, response);
-          setStatus(browser, 'VALID', response.message);
+          ms.setStatus(browser, 'VALID', response.message);
 
           // reload page
           ms.log("reloading browser...");
@@ -296,13 +278,13 @@ var monkeysphere = (function() {
 
           // NOT VALID
           ms.log("site not verified.");
-          setStatus(browser, 'NOTVALID', response.message);
+          ms.setStatus(browser, 'NOTVALID', response.message);
 
         }
       } else {
         ms.log("validation agent did not respond.");
         //alert(monkeysphere.messages.getString("agentError"));
-        setStatus(browser, 'ERROR', messages.getString('noResponseFromAgent'));
+        ms.setStatus(browser, 'ERROR', monkeysphere.messages.getString('noResponseFromAgent'));
       }
 
       // update the current display, so that if we're looking at the
@@ -334,7 +316,7 @@ var monkeysphere = (function() {
       }
       var newstate = browser.monkeysphere.state;
       var newmessage = browser.monkeysphere.message + ' [NO LONGER CACHED]';
-      setStatus(browser, newstate, newmessage);
+      ms.setStatus(browser, newstate, newmessage);
       updateDisplay();
     },
 
diff --git a/modules/monkeysphere.jsm b/modules/monkeysphere.jsm
index b2ebddb..c111ff5 100644
--- a/modules/monkeysphere.jsm
+++ b/modules/monkeysphere.jsm
@@ -21,6 +21,7 @@ var EXPORTED_SYMBOLS = [
   "agent_socket",
   "log",
   "isRelevantURI",
+  "setStatus",
   "createAgentPostData",
   "getInvalidCert",
   "overrides"
@@ -131,6 +132,27 @@ var isRelevantURI = function(uri) {
 };
 
 ////////////////////////////////////////////////////////////
+// STATUS FUNCTIONS
+////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////
+// set site monkeysphere status
+var setStatus = function(browser, state, message) {
+  if ( typeof message === 'undefined' ) {
+    message = "";
+  }
+  log("set browser status: " + state + ', ' + message);
+  browser.monkeysphere = { state: state, message: message };
+};
+
+//////////////////////////////////////////////////////////
+// clear site monkeysphere status for browser
+var clearStatus = function(browser) {
+  log("clear browser status");
+  delete browser.monkeysphere;
+};
+
+////////////////////////////////////////////////////////////
 // AGENT POST DATA FUNCTION
 ////////////////////////////////////////////////////////////
 
@@ -344,4 +366,5 @@ var overrides = (
         delete responses[apd.toOverrideLabel()];
       }
     };
-})();
+  }
+)();

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