[open-ils-commits] [GIT] Evergreen ILS branch master updated. 8b1731f4e3c3ac953dae1d223a29732b8fda6599

Evergreen Git git at git.evergreen-ils.org
Thu May 26 01:32:55 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  8b1731f4e3c3ac953dae1d223a29732b8fda6599 (commit)
      from  a7d34c5befa20b9a6baddef04d3dbb3411e121e5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8b1731f4e3c3ac953dae1d223a29732b8fda6599
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Mon May 23 16:14:29 2011 -0400

    browser.js debugging / robustification.  Replace some magic numbers with proper constants.
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>

diff --git a/Open-ILS/xul/staff_client/chrome/content/util/browser.js b/Open-ILS/xul/staff_client/chrome/content/util/browser.js
index 63b00be..5ae0eb1 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/browser.js
+++ b/Open-ILS/xul/staff_client/chrome/content/util/browser.js
@@ -383,13 +383,58 @@ util.browser.prototype = {
 
             var obj = this;
             obj.progressListener = {
-                onProgressChange    : function(){},
-                onLocationChange    : function(){},
-                onStatusChange        : function(){},
-                onSecurityChange    : function(){},
+                onProgressChange    : function(webProgress,request,curSelfProgress,maxSelfProgress,curTotalProgress,maxTotalProgress){
+                    try {
+                        /*dump('browser.js onProgressChange('
+                            +webProgress
+                            +','+request
+                            +','+curSelfProgress
+                            +','+maxSelfProgress
+                            +','+curTotalProgress
+                            +','+maxTotalProgress+')\n');*/
+                    } catch(E) {
+                        dump('error in util.browser.progresslistener.onProgressChange: ' + E + '\n');
+                    }
+                },
+                onLocationChange    : function(webProgress,request,uri){
+                    try {
+                        /*dump('browser.js onLocationChange('
+                            +webProgress
+                            +','+request
+                            +','+uri+')\n');*/
+                    } catch(E) {
+                        dump('error in util.browser.progresslistener.onLocationChange: ' + E + '\n');
+                    }
+                },
+                onStatusChange        : function(webProgress,request,status,message){
+                    try {
+                        /*dump('browser.js onStatusChange('
+                            +webProgress+','
+                            +request
+                            +','+status
+                            +','+message+')\n');*/
+                    } catch(E) {
+                        dump('error in util.browser.progresslistener.onStatusChange: ' + E + '\n');
+                    }
+                },
+                onSecurityChange    : function(webProgress,request,state){
+                    try {
+                        /*dump('browser.js onSecurityChange('
+                            +webProgress
+                            +','+request
+                            +','+state+')\n');*/
+                    } catch(E) {
+                        dump('error in util.browser.progresslistener.onSecurityChange: ' + E + '\n');
+                    }
+                },
                 onStateChange         : function ( webProgress, request, stateFlags, status) {
                     try {
                         netscape.security.PrivilegeManager.enablePrivilege( "UniversalXPConnect" );
+                        /*dump('browser.js onStateChange('
+                            +webProgress
+                            +','+request
+                            +','+stateFlags
+                            +','+status+')\n');*/
                         var s = obj.url + '\n' + obj.get_content().location.href + '\n';
                         const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
                         const nsIChannel = Components.interfaces.nsIChannel;
@@ -411,7 +456,15 @@ util.browser.prototype = {
                             }
                         }
                         //////
-                        if (stateFlags == 65540 || stateFlags == 65537 || stateFlags == 65552) { return; }
+                        if ( (stateFlags & nsIWebProgressListener.STATE_IS_REQUEST
+                                && stateFlags & nsIWebProgressListener.STATE_TRANSFERRING)
+                            || (stateFlags & nsIWebProgressListener.STATE_IS_REQUEST
+                                && stateFlags & nsIWebProgressListener.STATE_START)
+                            || (stateFlags & nsIWebProgressListener.STATE_IS_REQUEST
+                                && stateFlags & nsIWebProgressListener.STATE_STOP)
+                            ) {
+                            return;
+                        }
                         s += ('onStateChange: stateFlags = ' + stateFlags + ' status = ' + status + '\n');
                         if (stateFlags & nsIWebProgressListener.STATE_IS_REQUEST) {
                             s += ('\tSTATE_IS_REQUEST\n');
@@ -420,7 +473,13 @@ util.browser.prototype = {
                             s += ('\tSTATE_IS_DOCUMENT\n');
                             if( stateFlags & nsIWebProgressListener.STATE_STOP ) {
                                 var alert_string = 'document has stopped: ' + new Date() + '\n'; dump(alert_string);
-                                obj.push_variables(); obj.updateNavButtons();
+                                try {
+                                    obj.push_variables(); obj.updateNavButtons();
+                                } catch(E) {
+                                    var err_msg = 'browser.js STATE_IS_DOCUMENT STATE_STOP error with push_variables or updateNavButtons: ' + E + '\n';
+                                    dump(err_msg);
+                                    obj.error.sdump('D_ERROR',err_msg);
+                                }
                                 if (typeof obj.on_url_load == 'function') {
                                     try {
                                         obj.error.sdump('D_TRACE','calling on_url_load');
@@ -474,6 +533,7 @@ util.browser.prototype = {
                         //obj.error.sdump('D_BROWSER',s);    
                         if (throbber) { throbber.tooltip(s); }
                     } catch(E) {
+                        dump('error in util.browser.progresslistener.onStateChange: ' + E + '\n');
                         obj.error.sdump('D_ERROR','util.browser.progresslistener.onstatechange: ' + (E));
                     }
                 }

-----------------------------------------------------------------------

Summary of changes:
 .../staff_client/chrome/content/util/browser.js    |   72 ++++++++++++++++++--
 1 files changed, 66 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list