[Pkg-privacy-commits] [xul-ext-monkeysphere] 119/296: fix updateDisplay, and call from progressListener
Ximin Luo
infinity0 at moszumanska.debian.org
Mon Aug 24 07:39:31 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 ce44e1371107140bbc8a843a91469872462afc5c
Author: Jameson Rollins <jrollins at finestructure.net>
Date: Sat Mar 6 14:14:21 2010 -0500
fix updateDisplay, and call from progressListener
---
chrome/content/monkeysphere.js | 34 +++++++++++-----------------------
1 file changed, 11 insertions(+), 23 deletions(-)
diff --git a/chrome/content/monkeysphere.js b/chrome/content/monkeysphere.js
index 946cef0..93f1a04 100644
--- a/chrome/content/monkeysphere.js
+++ b/chrome/content/monkeysphere.js
@@ -29,7 +29,7 @@ var monkeysphere = {
// agent URL from environment variable
// "http://localhost:8901" <-- NO TRAILING SLASH
agent_socket: [],
-
+
// default socket
// FIXME: should be configurable via prefs.js
default_socket: "http://localhost:8901",
@@ -110,8 +110,8 @@ var monkeysphere = {
// https://developer.mozilla.org/en/nsIWebProgressListener
progressListener: {
onLocationChange: function(aWebProgress, aRequest, aLocation) {
- monkeysphere.log("++++ location change: " + aLocation.prePath);
- monkeysphere.logBrowserInfo(gBrowser);
+ monkeysphere.log("++++ PL location change: " + aLocation.prePath);
+ monkeysphere.updateDisplay(gBrowser.selectedBrowser);
},
onProgressChange: function() {},
@@ -137,7 +137,7 @@ var monkeysphere = {
monkeysphere.logBrowserInfo(aBrowser);
},
onStateChange: function(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
- monkeysphere.log("++++ tabPL status change: " + aRequest);
+ monkeysphere.log("++++ tabPL state change: " + aRequest);
monkeysphere.logBrowserInfo(aBrowser);
},
onStatusChange: function(aBrowser, aWebProgress, aRequest, aStatus, aMessage) {
@@ -146,14 +146,6 @@ var monkeysphere = {
}
},
- logBrowserInfo: function(browser) {
- if (typeof browser.monkeysphere === 'undefined') {
- monkeysphere.log('--> nothing yet');
- } else {
- monkeysphere.log('--> ' + browser.monkeysphere.message);
- }
- },
-
////////////////////////////////////////////////////////////
// SITE URI CHECK FUNCTION
////////////////////////////////////////////////////////////
@@ -240,7 +232,7 @@ var monkeysphere = {
////////////////////////////////////////////////////////////
// STATUS FUNCTIONS
////////////////////////////////////////////////////////////
-
+
getDefaultStatusText: function(state) {
var key = monkeysphere.states.state ? ("status" + state) : "xulError";
return monkeysphere.messages.getString(key);
@@ -255,7 +247,7 @@ var monkeysphere = {
//////////////////////////////////////////////////////////
// set the status
- updateDisplay: function(state, message) {
+ updateDisplay: function(browser) {
var panel = document.getElementById("monkeysphere-status");
var icon = document.getElementById("monkeysphere-status-image");
@@ -266,11 +258,7 @@ var monkeysphere = {
icon = window.opener.document.getElementById("monkeysphere-status-image");
}
- if(!state) {
- state = monkeysphere.states.NEUTRAL;
- }
-
- switch(state){
+ switch(browser.monkeysphere.state){
case monkeysphere.states.INPROGRESS:
monkeysphere.log("set status: INPROGRESS");
icon.setAttribute("src", "chrome://monkeysphere/content/progress.gif");
@@ -298,9 +286,9 @@ var monkeysphere = {
break;
}
- if(message) {
- monkeysphere.log("set message: " + message);
- panel.setAttribute("tooltiptext", message);
+ if(browser.monkeysphere.message) {
+ monkeysphere.log("set message: " + browser.monkeysphere.message);
+ panel.setAttribute("tooltiptext", browser.monkeysphere.message);
}
},
@@ -352,7 +340,7 @@ var monkeysphere = {
client.setRequestHeader("Content-Length", query.length);
client.setRequestHeader("Connection", "close");
client.setRequestHeader("Accept", "application/json");
-
+
browser.monkeysphere = {
message: 'foo bar'
};
--
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