From e24caa4c0a7d6ca6c0e6b3037491913f1635009e Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 6 Apr 2010 16:47:24 +0000 Subject: [PATCH] move the browser progress meter next to the network progress meter and provide a toggle in the Admin menu. The org unit setting isn't wired up in trunk, but that's probably a good thing. still experimental git-svn-id: svn://svn.open-ils.org/ILS/trunk@16141 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/lang.dtd | 2 ++ .../xul/staff_client/chrome/content/cat/opac.js | 1 + .../xul/staff_client/chrome/content/main/menu.js | 29 ++++++++++++++++++++++ .../chrome/content/main/menu_frame_menus.xul | 2 ++ .../chrome/content/main/menu_frame_overlay.xul | 3 ++- .../staff_client/chrome/content/util/browser.js | 8 +++--- .../staff_client/chrome/content/util/browser.xul | 1 - .../staff_client/chrome/content/util/rbrowser.xul | 1 - 8 files changed, 40 insertions(+), 7 deletions(-) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 4667a73e62..500914c0dd 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -739,6 +739,8 @@ + + diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js index bc6889d9b0..5007119c1a 100644 --- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js +++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js @@ -309,6 +309,7 @@ function set_opac() { content_params.open_chrome_window = xulG.open_chrome_window; content_params.url_prefix = xulG.url_prefix; content_params.network_meter = xulG.network_meter; + content_params.page_meter = xulG.page_meter; content_params.set_statusbar = xulG.set_statusbar; if (opac_url) { content_params.url = opac_url; } else { content_params.url = xulG.url_prefix( urls.browser ); } diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js index 02f5ae4e50..6447b0e477 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -64,6 +64,8 @@ main.menu.prototype = { if (! network_meter) { var x = document.getElementById('network_progress'); if (x) x.setAttribute('hidden','true'); + var y = document.getElementById('page_progress'); + if (y) y.setAttribute('hidden','true'); } function open_conify_page(path, labelKey) { @@ -486,6 +488,16 @@ main.menu.prototype = { } ], + 'cmd_toggle_meters' : [ + ['oncommand'], + function() { + var x = document.getElementById('network_progress'); + if (x) x.hidden = ! x.hidden; + var y = document.getElementById('page_progress'); + if (y) y.hidden = ! y.hidden; + } + ], + 'cmd_local_admin_reports' : [ ['oncommand'], function() { @@ -1277,6 +1289,22 @@ main.menu.prototype = { } }, + 'page_meter' : { + 'node' : document.getElementById('page_progress'), + 'on' : function() { + document.getElementById('page_progress').setAttribute('mode','undetermined'); + }, + 'off' : function() { + document.getElementById('page_progress').setAttribute('mode','determined'); + }, + 'tooltip' : function(text) { + if (text || text == '') { + document.getElementById('page_progress').setAttribute('tooltiptext',text); + } + return document.getElementById('page_progress').getAttribute('tooltiptext'); + } + }, + 'network_meter' : { 'inc' : function(app,method) { try { @@ -1398,6 +1426,7 @@ main.menu.prototype = { content_params.open_chrome_window = function(a,b,c) { return xulG.window.open(a,b,c); }; content_params.url_prefix = function(url) { return obj.url_prefix(url); }; content_params.network_meter = obj.network_meter; + content_params.page_meter = obj.page_meter; content_params.set_statusbar = function(slot,text) { var e = document.getElementById('statusbarpanel'+slot); if (e) { e.setAttribute('label',text); } diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul index 2caaa9f622..10995587d7 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul @@ -57,6 +57,7 @@ + @@ -373,6 +374,7 @@ + diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_overlay.xul b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_overlay.xul index 795d6d2971..2481b9bf53 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_overlay.xul +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_overlay.xul @@ -47,7 +47,8 @@ - + + 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 6ceb15aefa..5b79d06151 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/browser.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/browser.js @@ -233,18 +233,18 @@ util.browser.prototype = { const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; const nsIChannel = Components.interfaces.nsIChannel; ////// handle the throbber - var throbber = document.getElementById('throbber'); + var throbber = xulG.page_meter; if (throbber) { var busy = false; if (!(stateFlags & nsIWebProgressListener.STATE_RESTORING)) { busy = true; - throbber.setAttribute('mode','undetermined'); + throbber.on(); } if (stateFlags & nsIWebProgressListener.STATE_STOP) { busy = false; setTimeout( function() { - if (!busy) { throbber.setAttribute('mode','determined'); } + if (!busy) { throbber.off(); } }, 2000 ); } @@ -298,7 +298,7 @@ util.browser.prototype = { s += ('\tSTATE_STOP\n'); } //obj.error.sdump('D_BROWSER',s); - if (throbber) { throbber.setAttribute('tooltiptext',s); } + if (throbber) { throbber.tooltip(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 a58845d242..d9279927b1 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/browser.xul +++ b/Open-ILS/xul/staff_client/chrome/content/util/browser.xul @@ -111,7 +111,6 @@