From ea8daee0db638cb95e15934d5f12c3a7e965c30d Mon Sep 17 00:00:00 2001 From: phasefx Date: Sun, 9 Mar 2008 00:20:07 +0000 Subject: [PATCH] layout change for z39.50 client git-svn-id: svn://svn.open-ils.org/ILS/trunk@8928 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/cat/z3950.js | 23 +- .../xul/staff_client/server/cat/z3950.xul | 225 +++++++++--------- 2 files changed, 134 insertions(+), 114 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/z3950.js b/Open-ILS/xul/staff_client/server/cat/z3950.js index 075f835be3..094cac3385 100644 --- a/Open-ILS/xul/staff_client/server/cat/z3950.js +++ b/Open-ILS/xul/staff_client/server/cat/z3950.js @@ -105,6 +105,7 @@ cat.z3950.prototype = { ['command'], function() { obj.save_creds(); + setTimeout( function() { obj.focus(); }, 0 ); } ], 'marc_view' : [ @@ -167,12 +168,26 @@ cat.z3950.prototype = { } }, ], + 'z3950_deck' : [ ['render'], function(e) { return function() { e.selectedIndex = 0; }; } ], 'search' : [ ['command'], function() { + obj.controller.view.z3950_deck.selectedIndex = 1; obj.initial_search(); }, ], + 'search_form' : [ + ['command'], + function() { + obj.controller.view.z3950_deck.selectedIndex = 0; + }, + ], + 'results_page' : [ + ['command'], + function() { + obj.controller.view.z3950_deck.selectedIndex = 1; + }, + ], 'page_next' : [ ['command'], function() { @@ -256,7 +271,7 @@ cat.z3950.prototype = { tb.setAttribute('mytype','search_class'); tb.setAttribute('search_class',i); row.appendChild(tb); - tb.addEventListener('keypress',function(ev) { dump('foo\n'); return obj.handle_enter(ev); },false); + tb.addEventListener('keypress',function(ev) { return obj.handle_enter(ev); },false); } } } catch(E) { @@ -479,7 +494,8 @@ cat.z3950.prototype = { var x = obj.controller.view.marc_view; if (x.getAttribute('toggle') == '0') x.disabled = true; for (var j = 0; j < obj.result_set[ obj.number_of_result_sets ].records.length; j++) { - obj.list.append( + var f; + var n = obj.list.append( { 'retrieve_id' : String( obj.number_of_result_sets ) + '-' + String( j ), 'row' : { @@ -490,6 +506,7 @@ cat.z3950.prototype = { } } ); + if (!f) { n.my_node.parentNode.focus(); f = n; } } } else { x = document.createElement('description'); obj.controller.view.result_message.appendChild(x); @@ -805,7 +822,7 @@ cat.z3950.prototype = { 'handle_enter' : function(ev) { var obj = this; if (ev.target.tagName != 'textbox') return; - if (ev.keyCode == 13 /* enter */ || ev.keyCode == 77 /* enter on a mac */) setTimeout( function() { obj.initial_search(); }, 0); + if (ev.keyCode == 13 /* enter */ || ev.keyCode == 77 /* enter on a mac */) setTimeout( function() { obj.controller.view.z3950_deck.selectedIndex = 1; obj.initial_search(); }, 0); }, } diff --git a/Open-ILS/xul/staff_client/server/cat/z3950.xul b/Open-ILS/xul/staff_client/server/cat/z3950.xul index 837df57d04..e72e0898a3 100644 --- a/Open-ILS/xul/staff_client/server/cat/z3950.xul +++ b/Open-ILS/xul/staff_client/server/cat/z3950.xul @@ -86,123 +86,126 @@ - - - - - - - - - - - - - - - - - - - - -