From 39ded5b9a27719738168fa74ae5b9775dd881c25 Mon Sep 17 00:00:00 2001 From: phasefx Date: Mon, 27 Sep 2010 16:38:08 +0000 Subject: [PATCH] merge part of r18002, and all of r18003 and r18004 from trunk for persistent/sticky slider positions and window sizes git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_0@18032 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../chrome/content/OpenILS/global_util.js | 49 ++++++++++++++++++---- .../xul/staff_client/chrome/content/main/main.xul | 2 +- .../xul/staff_client/external/dojo_template.xul | 2 +- Open-ILS/xul/staff_client/external/template.xul | 2 +- .../admin/do_not_auto_attempt_print_setting.xul | 2 +- .../staff_client/server/admin/font_settings.xul | 2 +- .../server/admin/offline_manage_xacts.xul | 8 ++-- .../xul/staff_client/server/admin/transit_list.xul | 2 +- .../xul/staff_client/server/admin/work_log.xul | 6 +-- Open-ILS/xul/staff_client/server/cat/bib_brief.xul | 2 +- .../xul/staff_client/server/cat/copy_browser.xul | 2 +- .../server/cat/copy_buckets_overlay.xul | 6 +-- .../xul/staff_client/server/cat/copy_editor.xul | 18 ++++---- .../xul/staff_client/server/cat/copy_notes.xul | 3 +- Open-ILS/xul/staff_client/server/cat/marc_new.xul | 2 +- Open-ILS/xul/staff_client/server/cat/marc_view.xul | 2 +- .../xul/staff_client/server/cat/spine_labels.xul | 6 +-- .../xul/staff_client/server/cat/volume_buckets.xul | 2 +- .../server/cat/volume_copy_creator.xul | 4 +- Open-ILS/xul/staff_client/server/cat/z3950.xul | 4 +- .../server/circ/alternate_copy_summary.xul | 8 ++-- .../xul/staff_client/server/circ/circ_brief.xul | 2 +- .../xul/staff_client/server/circ/circ_summary.xul | 14 +++---- .../xul/staff_client/server/circ/copy_details.xul | 18 ++++---- .../staff_client/server/circ/missing_pieces.xul | 2 +- .../staff_client/server/circ/pre_cat_fields.xul | 4 +- .../server/circ/print_list_template_editor.xul | 2 +- .../xul/staff_client/server/main/simple_auth.xul | 4 +- .../server/main/verify_credentials.xul | 2 +- .../staff_client/server/patron/barcode_entry.xul | 2 +- Open-ILS/xul/staff_client/server/patron/bill2.xul | 10 ++--- .../staff_client/server/patron/bill_cc_info.xul | 4 +- .../staff_client/server/patron/bill_check_info.xul | 4 +- .../staff_client/server/patron/bill_details.xul | 16 +++---- .../xul/staff_client/server/patron/bill_wizard.xul | 4 +- .../server/patron/display_horiz_overlay.xul | 2 +- .../staff_client/server/patron/display_overlay.xul | 2 +- .../server/patron/edit_standing_penalty.xul | 3 +- .../xul/staff_client/server/patron/hold_cancel.xul | 2 +- .../staff_client/server/patron/hold_details.xul | 6 +-- .../xul/staff_client/server/patron/info_group.xul | 2 +- .../xul/staff_client/server/patron/info_notes.xul | 2 +- .../staff_client/server/patron/info_stat_cats.xul | 2 +- .../staff_client/server/patron/info_surveys.xul | 2 +- Open-ILS/xul/staff_client/server/patron/items.xul | 2 +- .../staff_client/server/patron/items_overlay.xul | 6 +-- .../server/patron/new_standing_penalty.xul | 3 +- .../xul/staff_client/server/patron/search_form.xul | 2 +- .../server/patron/search_form_horiz.xul | 2 +- .../staff_client/server/patron/search_result.xul | 2 +- .../server/patron/standing_penalties.xul | 6 +-- .../xul/staff_client/server/patron/summary.xul | 2 +- .../staff_client/server/patron/user_buckets.xul | 2 +- .../staff_client/server/serial/manage_items.xul | 6 +-- .../xul/staff_client/server/serial/manage_subs.xul | 6 +-- Open-ILS/xul/staff_client/server/serial/notes.xul | 4 +- .../staff_client/server/serial/sdist_editor.xul | 6 +-- .../staff_client/server/serial/serctrl_main.xul | 2 +- .../xul/staff_client/server/serial/siss_editor.xul | 10 ++--- .../staff_client/server/serial/sitem_editor.xul | 10 ++--- .../xul/staff_client/server/serial/ssub_editor.xul | 6 +-- 61 files changed, 179 insertions(+), 143 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js b/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js index ec9bdfa31d..459a6288ee 100644 --- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js +++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js @@ -94,6 +94,9 @@ if (ev.explicitOriginalTarget != node) return; } else { target = ev.target; + if (target == window) { + target = window.document.documentElement; + } } var filename = location.pathname.split('/')[ location.pathname.split('/').length - 1 ]; var base_key = 'oils_persist_' + String(location.hostname + '_' + filename + '_' + target.getAttribute('id')).replace('/','_','g') + '_' + base_key_suffix; @@ -108,11 +111,21 @@ } else if ( attribute_list[j] == 'value' && ['textbox'].indexOf( target.nodeName ) > -1 ) { value = target.value; dump('\t' + value + ' <== .' + attribute_list[j] + '\n'); + } else if ( attribute_list[j] == 'sizemode' && ['window'].indexOf( target.nodeName ) > -1 ) { + value = window.windowState; + dump('\t' + value + ' <== window.windowState, @' + attribute_list[j] + '\n'); + } else if ( attribute_list[j] == 'height' && ['window'].indexOf( target.nodeName ) > -1 ) { + value = window.outerHeight; + dump('\t' + value + ' <== window.outerHeight, @' + attribute_list[j] + '\n'); + } else if ( attribute_list[j] == 'width' && ['window'].indexOf( target.nodeName ) > -1 ) { + value = window.outerWidth; + dump('\t' + value + ' <== window.outerWidth, @' + attribute_list[j] + '\n'); } else { dump('\t' + value + ' <== @' + attribute_list[j] + '\n'); } prefs.setCharPref( key, value ); - // TODO: Need to add logic for window resizing, splitter repositioning, grippy state, etc. + // TODO: Need to add logic for splitter repositioning, grippy state, etc. + // NOTE: oils_persist_peers and oils_persist="width" on those peers can help with the elements adjacent to a splitter } if (target.hasAttribute('oils_persist_peers') && ! ev.cancelable) { // We abuse the .cancelable field on the oils_persist event to prevent looping var peer_list = target.getAttribute('oils_persist_peers').split(' '); @@ -152,6 +165,22 @@ } else if ( attribute_list[j] == 'value' && ['textbox'].indexOf( nodes[i].nodeName ) > -1 ) { nodes[i].value = value; dump('\t' + value + ' ==> .' + attribute_list[j] + '\n'); + } else if ( attribute_list[j] == 'sizemode' && ['window'].indexOf( nodes[i].nodeName ) > -1 ) { + switch(value) { + case window.STATE_MAXIMIZED: + window.maximize(); + break; + case window.STATE_MINIMIZED: + window.minimize(); + break; + }; + dump('\t' + value + ' ==> window.windowState, @' + attribute_list[j] + '\n'); + } else if ( attribute_list[j] == 'height' && ['window'].indexOf( nodes[i].nodeName ) > -1 ) { + window.outerHeight = value; + dump('\t' + value + ' ==> window.outerHeight, @' + attribute_list[j] + '\n'); + } else if ( attribute_list[j] == 'width' && ['window'].indexOf( nodes[i].nodeName ) > -1 ) { + window.outerWidth = value; + dump('\t' + value + ' ==> window.outerWidth, @' + attribute_list[j] + '\n'); } else { nodes[i].setAttribute( attribute_list[j], value); dump('\t' + value + ' ==> @' + attribute_list[j] + '\n'); @@ -191,29 +220,33 @@ false ); } else { + var node = nodes[i]; var event_types = []; - if (nodes[i].hasAttribute('oils_persist_events')) { - var event_type_list = nodes[i].getAttribute('oils_persist_events').split(' '); + if (node.hasAttribute('oils_persist_events')) { + var event_type_list = node.getAttribute('oils_persist_events').split(' '); for (var j = 0; j < event_type_list.length; j++) { event_types.push( event_type_list[j] ); } } else { - if (nodes[i].nodeName == 'textbox') { + if (node.nodeName == 'textbox') { event_types.push('change'); + } else if (node.nodeName == 'window') { + event_types.push('resize'); + node = window; // xul window is an element of window.document } else { event_types.push('command'); } } for (var j = 0; j < event_types.length; j++) { - nodes[i].addEventListener( + node.addEventListener( event_types[j], - gen_event_handler(event_types[j],nodes[i]), + gen_event_handler(event_types[j],node), false ); } - nodes[i].addEventListener( + node.addEventListener( 'oils_persist', - gen_oils_persist_handler( base_key, nodes[i] ), + gen_oils_persist_handler( base_key, node ), false ); } diff --git a/Open-ILS/xul/staff_client/chrome/content/main/main.xul b/Open-ILS/xul/staff_client/chrome/content/main/main.xul index 2e5428154a..e1b43ab888 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/main.xul +++ b/Open-ILS/xul/staff_client/chrome/content/main/main.xul @@ -21,7 +21,7 @@ diff --git a/Open-ILS/xul/staff_client/external/dojo_template.xul b/Open-ILS/xul/staff_client/external/dojo_template.xul index 5d509247b7..9cf3e21614 100644 --- a/Open-ILS/xul/staff_client/external/dojo_template.xul +++ b/Open-ILS/xul/staff_client/external/dojo_template.xul @@ -18,7 +18,7 @@ diff --git a/Open-ILS/xul/staff_client/external/template.xul b/Open-ILS/xul/staff_client/external/template.xul index da3522376a..f666257fd2 100644 --- a/Open-ILS/xul/staff_client/external/template.xul +++ b/Open-ILS/xul/staff_client/external/template.xul @@ -18,7 +18,7 @@ diff --git a/Open-ILS/xul/staff_client/server/admin/do_not_auto_attempt_print_setting.xul b/Open-ILS/xul/staff_client/server/admin/do_not_auto_attempt_print_setting.xul index bece26a35b..d556207106 100644 --- a/Open-ILS/xul/staff_client/server/admin/do_not_auto_attempt_print_setting.xul +++ b/Open-ILS/xul/staff_client/server/admin/do_not_auto_attempt_print_setting.xul @@ -18,7 +18,7 @@ diff --git a/Open-ILS/xul/staff_client/server/admin/font_settings.xul b/Open-ILS/xul/staff_client/server/admin/font_settings.xul index 491bf4a3b8..3b968a5dc7 100644 --- a/Open-ILS/xul/staff_client/server/admin/font_settings.xul +++ b/Open-ILS/xul/staff_client/server/admin/font_settings.xul @@ -18,7 +18,7 @@ diff --git a/Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.xul b/Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.xul index dd8b1d5a44..9e2ae9261f 100644 --- a/Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.xul +++ b/Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.xul @@ -19,7 +19,7 @@ @@ -55,7 +55,7 @@ - + - - + +