From e62814ee2acebd4fb6ab5a1cb4d0d9070121b1e8 Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 23 Mar 2010 16:35:01 +0000 Subject: [PATCH] progressmeter as a "throbber" for page loads, etc. in staff client browser git-svn-id: svn://svn.open-ils.org/ILS/trunk@15938 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/chrome/content/util/browser.js | 19 +++++++++++++++++++ .../xul/staff_client/chrome/content/util/browser.xul | 1 + .../xul/staff_client/chrome/content/util/rbrowser.xul | 1 + 3 files changed, 21 insertions(+) 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 5ffe5ac88b..6cd7a3bb24 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/browser.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/browser.js @@ -231,6 +231,24 @@ util.browser.prototype = { 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 @@ util.browser.prototype = { 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)); } diff --git a/Open-ILS/xul/staff_client/chrome/content/util/browser.xul b/Open-ILS/xul/staff_client/chrome/content/util/browser.xul index d9279927b1..a58845d242 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/browser.xul +++ b/Open-ILS/xul/staff_client/chrome/content/util/browser.xul @@ -111,6 +111,7 @@