From: Jason Etheridge Date: Sat, 26 Jan 2013 14:40:47 +0000 (-0500) Subject: Add destructor to X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ea5c8832ac2f60693ae37ce1529cf134bd40b4e5;p=working%2FEvergreen.git Add destructor to And move binding to separate file and just have menu_frame.xul load it for now. This really reduces the initial memory footprint of the staff client, but it doesn't addresses all leaks--after having watched the process list after many interations since I don't quite grok all the debugging tools. I wanted to try replacing messagecatalog with the native stringbundle, which Galen confirmed works with the oils:// protocol, but I ran into some trouble. That might be another experiment worth pursuing. Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/xul/staff_client/chrome/content/main/bindings.xml b/Open-ILS/xul/staff_client/chrome/content/main/bindings.xml index 35f179e165..337e8bec53 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/bindings.xml +++ b/Open-ILS/xul/staff_client/chrome/content/main/bindings.xml @@ -5,125 +5,6 @@ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:xbl="http://www.mozilla.org/xbl"> - - - - - - - - - - - - - - - - - \n'); - x.open("HEAD", url, false); - x.send(null); - return x.status == 200; - } - - function open_url(loc) { - var url = protocol + '//' + hostname + ( port ? ':' + port : '' ) + loc +'?id='+obj.id; - dump('help widget: opening <'+url+'>\n'); - window.open(url, obj.getAttribute('label'), 'resizable,scrollbars'); - } - - if (test_url('/'+this.getAttribute('src'))) { - open_url('/'+this.getAttribute('src')); - } else { - if (test_url(pathname + '.custom_help.html')) { - open_url(pathname + '.custom_help.html'); - } else { - if (test_url(pathname + '.help.html')) { - open_url(pathname + '.help.html'); - } else { - var pathparts = pathname.split('/'); - var base_url; var url; var test_result; - for (var i = pathparts.length - 2; i>0 && !test_result; i--) { - base_url = ''; url = ''; - for ( j = 1; j <= i; j++ ) { base_url += '/' + pathparts[j]; }; - url = base_url + '/custom_help.html'; - test_result = test_url(url); - if (!test_result) { - url = base_url + '/help.html'; - test_result = test_url(url); - } - } - if (test_result) { - open_url(url); - } else { - if (test_url("/custom_help.html")) { - open_url("/custom_help.html"); - } else { - if (test_url("/help.html")) { - open_url("/help.html"); - } else { - /* FIXME - I18N */ - alert('No Help Found'); - } - } - } - } - } - } - } catch(E) { - alert('Error opening window in help widget in bindings.xml: ' + E); - throw(E); - } - ]]> - - - - - - - @@ -147,6 +28,19 @@ ]]> + + + + - - - - - - - - - - - - - - - - - - - - diff --git a/Open-ILS/xul/staff_client/chrome/content/main/help_binding.xml b/Open-ILS/xul/staff_client/chrome/content/main/help_binding.xml new file mode 100644 index 0000000000..143c755ef7 --- /dev/null +++ b/Open-ILS/xul/staff_client/chrome/content/main/help_binding.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + \n'); + x.open("HEAD", url, false); + x.send(null); + return x.status == 200; + } + + function open_url(loc) { + var url = protocol + '//' + hostname + ( port ? ':' + port : '' ) + loc +'?id='+obj.id; + dump('help widget: opening <'+url+'>\n'); + window.open(url, obj.getAttribute('label'), 'resizable,scrollbars'); + } + + if (test_url('/'+this.getAttribute('src'))) { + open_url('/'+this.getAttribute('src')); + } else { + if (test_url(pathname + '.custom_help.html')) { + open_url(pathname + '.custom_help.html'); + } else { + if (test_url(pathname + '.help.html')) { + open_url(pathname + '.help.html'); + } else { + var pathparts = pathname.split('/'); + var base_url; var url; var test_result; + for (var i = pathparts.length - 2; i>0 && !test_result; i--) { + base_url = ''; url = ''; + for ( j = 1; j <= i; j++ ) { base_url += '/' + pathparts[j]; }; + url = base_url + '/custom_help.html'; + test_result = test_url(url); + if (!test_result) { + url = base_url + '/help.html'; + test_result = test_url(url); + } + } + if (test_result) { + open_url(url); + } else { + if (test_url("/custom_help.html")) { + open_url("/custom_help.html"); + } else { + if (test_url("/help.html")) { + open_url("/help.html"); + } else { + /* FIXME - I18N */ + alert('No Help Found'); + } + } + } + } + } + } + } catch(E) { + alert('Error opening window in help widget in bindings.xml: ' + E); + throw(E); + } + ]]> + + + + + + + diff --git a/Open-ILS/xul/staff_client/chrome/skin/global.css b/Open-ILS/xul/staff_client/chrome/skin/global.css index 85e3d1f81b..a47ab8d14b 100644 --- a/Open-ILS/xul/staff_client/chrome/skin/global.css +++ b/Open-ILS/xul/staff_client/chrome/skin/global.css @@ -15,9 +15,8 @@ iframe { background: #CDCED3 url("chrome://browser/skin/icons/box-background.png .operator_change { background-color: red; } -.shrinkable_groupbox { font-weight: bold; -moz-binding: url('chrome://open_ils_staff_client/content/main/bindings.xml#caption'); } messagecatalog { -moz-binding: url('chrome://open_ils_staff_client/content/main/bindings.xml#messagecatalog'); } -help { -moz-binding: url('chrome://open_ils_staff_client/content/main/bindings.xml#help'); } +help { -moz-binding: url('chrome://open_ils_staff_client/content/main/help_binding.xml#help'); } .my_overflow { overflow: auto; } diff --git a/Open-ILS/xul/staff_client/server/skin/global.css b/Open-ILS/xul/staff_client/server/skin/global.css index f8a6ad1543..ec95be96a4 100644 --- a/Open-ILS/xul/staff_client/server/skin/global.css +++ b/Open-ILS/xul/staff_client/server/skin/global.css @@ -4,9 +4,7 @@ @namespace html url("http://www.w3.org/TR/REC-html40"); @namespace xhtml url("http://www.w3.org/1999/xhtml"); -help { -moz-binding: url('/xul/server/main/bindings.xml#help'); } messagecatalog { -moz-binding: url('/xul/server/main/bindings.xml#messagecatalog'); } -.shrinkable_groupbox { font-weight: bold; -moz-binding: url('/xul/server/main/bindings.xml#caption'); } window:not([active="true"]) menubar > menu { color: menutext !important }