[open-ils-commits] r15938 - trunk/Open-ILS/xul/staff_client/chrome/content/util (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Mar 23 12:35:04 EDT 2010


Author: phasefx
Date: 2010-03-23 12:35:01 -0400 (Tue, 23 Mar 2010)
New Revision: 15938

Modified:
   trunk/Open-ILS/xul/staff_client/chrome/content/util/browser.js
   trunk/Open-ILS/xul/staff_client/chrome/content/util/browser.xul
   trunk/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul
Log:
progressmeter as a "throbber" for page loads, etc. in staff client browser

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/browser.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/browser.js	2010-03-23 16:00:26 UTC (rev 15937)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/browser.js	2010-03-23 16:35:01 UTC (rev 15938)
@@ -231,6 +231,24 @@
                         var s = obj.url + '\n' + obj.get_content().location.href + '\n';
                         const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
                         const nsIChannel = Components.interfaces.nsIChannel;
+                        ////// handle the throbber
+                        var throbber = document.getElementById('throbber');
+                        if (throbber) {
+                            var busy = false;
+                            if (!(stateFlags & nsIWebProgressListener.STATE_RESTORING)) {
+                                busy = true;
+                                throbber.setAttribute('mode','undetermined'); 
+                            }
+                            if (stateFlags & nsIWebProgressListener.STATE_STOP) {
+                                busy = false;
+                                setTimeout(
+                                    function() {
+                                        if (!busy) { throbber.setAttribute('mode','determined'); }
+                                    }, 2000
+                                );
+                            }
+                        }
+                        //////
                         if (stateFlags == 65540 || stateFlags == 65537 || stateFlags == 65552) { return; }
                         s += ('onStateChange: stateFlags = ' + stateFlags + ' status = ' + status + '\n');
                         if (stateFlags & nsIWebProgressListener.STATE_IS_REQUEST) {
@@ -279,6 +297,7 @@
                             s += ('\tSTATE_STOP\n');
                         }
                         //obj.error.sdump('D_BROWSER',s);    
+                        if (throbber) { throbber.setAttribute('tooltiptext',s); }
                     } catch(E) {
                         obj.error.sdump('D_ERROR','util.browser.progresslistener.onstatechange: ' + (E));
                     }

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/browser.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/browser.xul	2010-03-23 16:00:26 UTC (rev 15937)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/browser.xul	2010-03-23 16:35:01 UTC (rev 15938)
@@ -111,6 +111,7 @@
             <button id="reload" command="cmd_reload" disabled="false" hidden="false"/>
             <button id="forward" command="cmd_forward" disabled="true" hidden="true"/>
             <spacer flex="1"/>
+            <progressmeter id="throbber" mode="determined" flex="1"/>
             <label id="debug" value="Debug" disabled="true" command="cmd_debug" onclick="this.doCommand();" />
             <button id="browser_print" label="Print Page" command="cmd_print" hidden="true"/>
         </hbox>

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul	2010-03-23 16:00:26 UTC (rev 15937)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul	2010-03-23 16:35:01 UTC (rev 15938)
@@ -112,6 +112,7 @@
             <button id="reload" command="cmd_reload" disabled="false" hidden="false"/>
             <button id="forward" command="cmd_forward" disabled="true" hidden="true"/>
             <spacer flex="1"/>
+            <progressmeter id="throbber" mode="determined" flex="1"/>
             <label id="debug" value="Debug" disabled="true" command="cmd_debug" onclick="this.doCommand();" />
             <button id="browser_print" label="Print Page" oldcommand="cmd_print" hidden="true"
                 oncommand="netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); if (g.browser.alt_print) { JSAN.use('util.print'); var p = new util.print(); p.NSPrint(g.browser.get_content(),false,{}); } else { g.browser.get_content().print(); }"



More information about the open-ils-commits mailing list