From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4> Date: Tue, 6 Apr 2010 16:47:24 +0000 (+0000) Subject: move the browser progress meter next to the network progress meter and provide a... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e24caa4c0a7d6ca6c0e6b3037491913f1635009e;p=evergreen%2Fmasslnc.git 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 --- 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 @@ <!ENTITY staff.main.menu.admin.ping "Ping Server"> <!ENTITY staff.main.menu.admin.toggle_buttonbar.accesskey "B"> <!ENTITY staff.main.menu.admin.toggle_buttonbar.label "Toggle Button Bar"> +<!ENTITY staff.main.menu.admin.toggle_meters.accesskey "M"> +<!ENTITY staff.main.menu.admin.toggle_meters.label "Toggle Activity Meters"> <!ENTITY staff.main.menu.cat.accesskey "g"> <!ENTITY staff.main.menu.cat.add_bib.key "B"> <!ENTITY staff.main.menu.cat.add_bib.label "Add Bib Record"> 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 @@ <command id="cmd_download_patrons" /> <command id="cmd_local_admin" /> <command id="cmd_toggle_buttonbar" /> + <command id="cmd_toggle_meters" /> <command id="cmd_extension_manager"/> <command id="cmd_theme_manager"/> @@ -373,6 +374,7 @@ <menuseparator /> <menuitem label="&staff.main.menu.admin.user_edit.label;" accesskey="&staff.main.menu.admin.user_edit.accesskey;" command="cmd_adv_user_edit"/> <menuitem label="&staff.main.menu.admin.toggle_buttonbar.label;" accesskey="&staff.main.menu.admin.toggle_buttonbar.accesskey;" command="cmd_toggle_buttonbar"/> + <menuitem label="&staff.main.menu.admin.toggle_meters.label;" accesskey="&staff.main.menu.admin.toggle_meters.accesskey;" command="cmd_toggle_meters"/> <menuseparator /> <menu id="main.menu.admin.sub" accesskey="&staff.main.menu.admin.developer.accesskey;" label="&staff.main.menu.admin.developer.label;"> <menupopup id="main.menu.admin.sub.popup"> 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 @@ <statusbarpanel id="statusbarpanel4"/> <statusbarpanel id="statusbarpanel5"/> <spacer flex="1" /> - <progressmeter id="network_progress" flex="1" mode="determined" value="0" tooltip="network_progress_tip"/> + <progressmeter id="network_progress" flex="0" mode="determined" value="0" tooltip="network_progress_tip"/> + <progressmeter id="page_progress" flex="0" mode="determined" value="0" /> <statusbarpanel /> </statusbar> <tooltip id="network_progress_tip" noautohide="true"> 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 @@ <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> diff --git a/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul b/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul index 10325cb469..8ba1a7055b 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul +++ b/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul @@ -112,7 +112,6 @@ <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(); }"