[open-ils-commits] r12036 - in branches/staff-client-experiment/Open-ILS/xul/staff_client: chrome/locale/en-US server/main
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Feb 1 16:25:50 EST 2009
Author: phasefx
Date: 2009-02-01 16:25:46 -0500 (Sun, 01 Feb 2009)
New Revision: 12036
Modified:
branches/staff-client-experiment/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
branches/staff-client-experiment/Open-ILS/xul/staff_client/server/main/menu.js
branches/staff-client-experiment/Open-ILS/xul/staff_client/server/main/menu_frame_overlay.xul
Log:
tooltip for network progress meter giving method-call summary
Modified: branches/staff-client-experiment/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
===================================================================
--- branches/staff-client-experiment/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties 2009-02-01 19:03:30 UTC (rev 12035)
+++ branches/staff-client-experiment/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties 2009-02-01 21:25:46 UTC (rev 12036)
@@ -137,6 +137,7 @@
menu.new_tab.tab=Tab
main.session_cookie.error=Error setting session cookie: %1$s
menu.set_tab.error=pause for error
+menu.reset_network_stats=Reset network activity summary?
main.testing=Testing
main.transaction_export.title=Save Transaction File As
main.transaction_export.prompt=Would you like to overwrite the existing file %1$s?
Modified: branches/staff-client-experiment/Open-ILS/xul/staff_client/server/main/menu.js
===================================================================
--- branches/staff-client-experiment/Open-ILS/xul/staff_client/server/main/menu.js 2009-02-01 19:03:30 UTC (rev 12035)
+++ branches/staff-client-experiment/Open-ILS/xul/staff_client/server/main/menu.js 2009-02-01 21:25:46 UTC (rev 12036)
@@ -12,7 +12,18 @@
JSAN.use('util.window'); this.window = new util.window();
this.w = window;
- document.getElementById('network_progress').setAttribute('count','0');
+ var x = document.getElementById('network_progress');
+ x.setAttribute('count','0');
+ x.addEventListener(
+ 'click',
+ function() {
+ if ( window.confirm(offlineStrings.getString('menu.reset_network_stats')) ) {
+ var x = document.getElementById('network_progress_rows');
+ while(x.firstChild) { x.removeChild( x.lastChild ); }
+ }
+ },
+ false
+ );
}
main.menu.prototype = {
@@ -884,18 +895,56 @@
},
'network_meter' : {
- 'inc' : function(msg) {
- var m = document.getElementById('network_progress');
- var count = 1 + Number( m.getAttribute('count') );
- m.setAttribute('mode','undetermined');
- m.setAttribute('count', count);
+ 'inc' : function(app,method) {
+ try {
+ var m = document.getElementById('network_progress');
+ var count = 1 + Number( m.getAttribute('count') );
+ m.setAttribute('mode','undetermined');
+ m.setAttribute('count', count);
+ var rows = document.getElementById('network_progress_rows');
+ var row = document.getElementById('network_progress_tip_'+app+'_'+method);
+ if (!row) {
+ row = document.createElement('row'); row.setAttribute('id','network_progress_tip_'+app+'_'+method);
+ var a = document.createElement('label'); a.setAttribute('value','App:');
+ var b = document.createElement('label'); b.setAttribute('value',app);
+ var c = document.createElement('label'); c.setAttribute('value','Method:');
+ var d = document.createElement('label'); d.setAttribute('value',method);
+ var e = document.createElement('label'); e.setAttribute('value','Total:');
+ var f = document.createElement('label'); f.setAttribute('value','0');
+ f.setAttribute('id','network_progress_tip_total_'+app+'_'+method);
+ var g = document.createElement('label'); g.setAttribute('value','Outstanding:');
+ var h = document.createElement('label'); h.setAttribute('value','0');
+ h.setAttribute('id','network_progress_tip_out_'+app+'_'+method);
+ row.appendChild(a); row.appendChild(b); row.appendChild(c);
+ row.appendChild(d); row.appendChild(e); row.appendChild(f);
+ row.appendChild(g); row.appendChild(h); rows.appendChild(row);
+ }
+ var total = document.getElementById('network_progress_tip_total_'+app+'_'+method);
+ if (total) {
+ total.setAttribute('value', 1 + Number( total.getAttribute('value') ));
+ }
+ var out = document.getElementById('network_progress_tip_out_'+app+'_'+method);
+ if (out) {
+ out.setAttribute('value', 1 + Number( out.getAttribute('value') ));
+ }
+ } catch(E) {
+ dump('network_meter.inc(): ' + E + '\n');
+ }
},
- 'dec' : function(msg) {
- var m = document.getElementById('network_progress');
- var count = 1 - Number( m.getAttribute('count') );
- if (count < 0) count = 0;
- if (count == 0) m.setAttribute('mode','determined');
- m.setAttribute('count', count);
+ 'dec' : function(app,method) {
+ try {
+ var m = document.getElementById('network_progress');
+ var count = -1 + Number( m.getAttribute('count') );
+ if (count < 0) count = 0;
+ if (count == 0) m.setAttribute('mode','determined');
+ m.setAttribute('count', count);
+ var out = document.getElementById('network_progress_tip_out_'+app+'_'+method);
+ if (out) {
+ out.setAttribute('value', -1 + Number( out.getAttribute('value') ));
+ }
+ } catch(E) {
+ dump('network_meter.dec(): ' + E + '\n');
+ }
}
},
Modified: branches/staff-client-experiment/Open-ILS/xul/staff_client/server/main/menu_frame_overlay.xul
===================================================================
--- branches/staff-client-experiment/Open-ILS/xul/staff_client/server/main/menu_frame_overlay.xul 2009-02-01 19:03:30 UTC (rev 12035)
+++ branches/staff-client-experiment/Open-ILS/xul/staff_client/server/main/menu_frame_overlay.xul 2009-02-01 21:25:46 UTC (rev 12036)
@@ -41,9 +41,25 @@
<statusbar>
<statusbarpanel />
<spacer flex="1" />
- <progressmeter id="network_progress" flex="1" mode="determined" value="0" />
+ <progressmeter id="network_progress" flex="1" mode="determined" value="0" tooltip="network_progress_tip"/>
<statusbarpanel />
</statusbar>
+ <tooltip id="network_progress_tip" noautohide="true">
+ <grid>
+ <columns>
+ <column/>
+ <column/>
+ <column/>
+ <column flex="1"/>
+ <column/>
+ <column/>
+ <column/>
+ <column/>
+ </columns>
+ <rows id="network_progress_rows">
+ </rows>
+ </grid>
+ </tooltip>
</box>
<!-- The main top level menubar -->
More information about the open-ils-commits
mailing list