layout change for z39.50 client
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 9 Mar 2008 00:20:07 +0000 (00:20 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 9 Mar 2008 00:20:07 +0000 (00:20 +0000)
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
Open-ILS/xul/staff_client/server/cat/z3950.xul

index 075f835..094cac3 100644 (file)
@@ -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);
        },
 }
 
index 837df57..e72e089 100644 (file)
 
        <groupbox flex="1">
                <caption label="MARC Import via Z39.50"/>
-        <hbox id="top_pane" persist="height" flex="1">
-            <vbox id="top_left_pane" persist="width" flex="1">
-                <groupbox id="first_pane" flex="1" class="my_overflow">
-                    <caption id="c2" label="Service and Credentials" class="shrinkable_groupbox"/>
-                    <grid flex="1">
-                        <columns>
-                            <column/>
-                            <column/>
-                            <column/>
-                        </columns>
-                        <rows id="service_rows">
-                            <row>
-                                <label value="Service"/>
-                                <label value="Username"/>
-                                <label value="Password"/>
-                            </row>
-                            <row>
-                                <checkbox id="native-evergreen-catalog_service" mytype="service_class" service="native-evergreen-catalog" label="Local Catalog" tooltiptext="Evergreen Native Catalog" /> 
-                                <textbox id="native-evergreen-catalog_username" hidden="true"/>
-                                <textbox id="native-evergreen-catalog_password" type="password" hidden="true"/>
-                            </row>
-                        </rows>
-                    </grid>
-                </groupbox>
-                <hbox>
-                    <button id="save_creds" label="Save as Default" accesskey="D"/>
-                </hbox>
-            </vbox>
-            <splitter collapse="before"><grippy/></splitter>
-            <vbox id="top_right_pane" persist="width" flex="1">
-                <groupbox id="second_pane" flex="1" class="my_overflow">
-                    <caption label="Query" class="shrinkable_groupbox"/>
+        <deck id="z3950_deck" flex="1">
+            <hbox id="top_pane" persist="height" flex="1">
+                <vbox id="top_left_pane" persist="width" flex="1">
+                    <groupbox id="first_pane" flex="1" class="my_overflow">
+                        <caption id="c2" label="Service and Credentials" class="shrinkable_groupbox"/>
+                        <grid flex="1">
+                            <columns>
+                                <column/>
+                                <column/>
+                                <column/>
+                            </columns>
+                            <rows id="service_rows">
+                                <row>
+                                    <label value="Service"/>
+                                    <label value="Username"/>
+                                    <label value="Password"/>
+                                </row>
+                                <row>
+                                    <checkbox id="native-evergreen-catalog_service" mytype="service_class" service="native-evergreen-catalog" label="Local Catalog" tooltiptext="Evergreen Native Catalog" /> 
+                                    <textbox id="native-evergreen-catalog_username" hidden="true"/>
+                                    <textbox id="native-evergreen-catalog_password" type="password" hidden="true"/>
+                                </row>
+                            </rows>
+                        </grid>
+                    </groupbox>
                     <hbox>
+                        <button id="save_creds" label="Save as Default" accesskey="D"/>
+                    </hbox>
+                </vbox>
+                <splitter collapse="before"><grippy/></splitter>
+                <vbox id="top_right_pane" persist="width" flex="1">
+                    <groupbox id="second_pane" flex="1" class="my_overflow">
+                        <caption label="Query" class="shrinkable_groupbox"/>
+                        <hbox>
+                            <spacer flex="1"/>
+                            <description>
+                                Tip: Click a search field label and then the "Save as Default" button to have that field focused by default.
+                            </description>
+                            <spacer flex="1"/>
+                        </hbox>
+                        <grid>
+                            <columns><column /><column flex="1" /></columns>
+                            <rows id="query_inputs">
+                            <!--
+                                <row>
+                                    <label id="tcn_label" value="&staff.z39_50.search_class.tcn;" control="tcn_input" onclick="g.z3950.default_attr = 'tcn'" accesskey="0" style="-moz-user-focus: ignore"/>
+                                    <textbox id="tcn_input" mytype="search_class" search_class="tcn" onkeypress="handle_enter(event)"/>
+                                </row><row>
+                                    <label id="isbn_label" value="&staff.z39_50.search_class.isbn;" control="isbn_input" onclick="g.z3950.default_attr = 'isbn'" style="-moz-user-focus: ignore"/>
+                                    <textbox id="isbn_input" mytype="search_class" search_class="isbn" onkeypress="handle_enter(event)"/>
+                                </row><row>
+                                    <label id="issn_label" value="&staff.z39_50.search_class.issn;" control="issn_input" onclick="g.z3950.default_attr = 'issn'" style="-moz-user-focus: ignore"/>
+                                    <textbox id="issn_input" mytype="search_class" search_class="issn" onkeypress="handle_enter(event)"/>
+                                </row><row>
+                                    <label id="title_label" value="&staff.z39_50.search_class.title;" control="title_input" onclick="g.z3950.default_attr = 'title'" style="-moz-user-focus: ignore"/>
+                                    <textbox id="title_input" mytype="search_class" search_class="title" onkeypress="handle_enter(event)"/>
+                                </row><row>
+                                    <label id="author_label" value="&staff.z39_50.search_class.author;" control="author_input" onclick="g.z3950.default_attr = 'author'" style="-moz-user-focus: ignore"/>
+                                    <textbox id="author_input" mytype="search_class" search_class="author" onkeypress="handle_enter(event)"/>
+                                </row><row>
+                                    <label id="lccn_label" value="&staff.z39_50.search_class.lccn;" control="lccn_input" onclick="g.z3950.default_attr = 'lccn'" style="-moz-user-focus: ignore"/>
+                                    <textbox id="lccn_input" mytype="search_class" search_class="lccn" onkeypress="handle_enter(event)"/>
+                                </row><row>
+                                    <label id="pubdate_label" value="&staff.z39_50.search_class.pubdate;" control="pubdate_input" onclick="g.z3950.default_attr = 'pubdate'" style="-moz-user-focus: ignore"/>
+                                    <textbox id="pubdate_input" mytype="search_class" search_class="pubdate" onkeypress="handle_enter(event)"/>
+                                </row><row>
+                                    <label id="publisher_label" value="&staff.z39_50.search_class.publisher;" control="publisher_input" onclick="g.z3950.default_attr = 'publisher'" style="-moz-user-focus: ignore"/>
+                                    <textbox id="publisher_input" mytype="search_class" search_class="publisher" onkeypress="handle_enter(event)"/>
+                                </row>
+                            -->
+                                <row>
+                                    <label id="item_type_label" value="&staff.z39_50.search_class.item_type;" control="item_type_input" onclick="g.z3950.default_attr = 'item_type'" style="-moz-user-focus: ignore"/>
+                                    <menulist id="item_type_input" mytype="search_class" search_class="item_type">
+                                        <menupopup>
+                                            <menuitem label="&staff.z39_50.search_class.item_type.all;" value=""/>
+                                            <menuitem label="&staff.z39_50.search_class.item_type.bks;" value="bks"/>
+                                            <menuitem label="&staff.z39_50.search_class.item_type.ser;" value="ser"/>
+                                            <menuitem label="&staff.z39_50.search_class.item_type.vis;" value="vis"/>
+                                            <menuitem label="&staff.z39_50.search_class.item_type.rec;" value="rec"/>
+                                            <menuitem label="&staff.z39_50.search_class.item_type.sco;" value="sco"/>
+                                            <menuitem label="&staff.z39_50.search_class.item_type.map;" value="map"/>
+                                            <menuitem label="&staff.z39_50.search_class.item_type.com;" value="com"/>
+                                            <menuitem label="&staff.z39_50.search_class.item_type.mix;" value="mix"/>
+                                            <menuitem label="&staff.z39_50.search_class.item_type.url;" value="url"/>
+                                            <menuitem label="&staff.z39_50.search_class.item_type.art;" value="art"/>
+                                        </menupopup>
+                                    </menulist>
+                                </row>
+                            </rows>
+                        </grid>
+                    </groupbox>
+                    <hbox>
+                        <button id="clear" label="Clear Form" accesskey="C"/>
+                        <button id="search" label="Search" accesskey="S"/>
                         <spacer flex="1"/>
-                        <description>
-                            Tip: Click a search field label and then the "Save as Default" button to have that field focused by default.
-                        </description>
-                        <spacer flex="1"/>
+                        <button id="results_page" label="Results Page" accesskey="P"/>
                     </hbox>
-                    <grid>
-                        <columns><column /><column flex="1" /></columns>
-                        <rows id="query_inputs">
-                        <!--
-                            <row>
-                                <label id="tcn_label" value="&staff.z39_50.search_class.tcn;" control="tcn_input" onclick="g.z3950.default_attr = 'tcn'" accesskey="0" style="-moz-user-focus: ignore"/>
-                                <textbox id="tcn_input" mytype="search_class" search_class="tcn" onkeypress="handle_enter(event)"/>
-                            </row><row>
-                                <label id="isbn_label" value="&staff.z39_50.search_class.isbn;" control="isbn_input" onclick="g.z3950.default_attr = 'isbn'" style="-moz-user-focus: ignore"/>
-                                <textbox id="isbn_input" mytype="search_class" search_class="isbn" onkeypress="handle_enter(event)"/>
-                            </row><row>
-                                <label id="issn_label" value="&staff.z39_50.search_class.issn;" control="issn_input" onclick="g.z3950.default_attr = 'issn'" style="-moz-user-focus: ignore"/>
-                                <textbox id="issn_input" mytype="search_class" search_class="issn" onkeypress="handle_enter(event)"/>
-                            </row><row>
-                                <label id="title_label" value="&staff.z39_50.search_class.title;" control="title_input" onclick="g.z3950.default_attr = 'title'" style="-moz-user-focus: ignore"/>
-                                <textbox id="title_input" mytype="search_class" search_class="title" onkeypress="handle_enter(event)"/>
-                            </row><row>
-                                <label id="author_label" value="&staff.z39_50.search_class.author;" control="author_input" onclick="g.z3950.default_attr = 'author'" style="-moz-user-focus: ignore"/>
-                                <textbox id="author_input" mytype="search_class" search_class="author" onkeypress="handle_enter(event)"/>
-                            </row><row>
-                                <label id="lccn_label" value="&staff.z39_50.search_class.lccn;" control="lccn_input" onclick="g.z3950.default_attr = 'lccn'" style="-moz-user-focus: ignore"/>
-                                <textbox id="lccn_input" mytype="search_class" search_class="lccn" onkeypress="handle_enter(event)"/>
-                            </row><row>
-                                <label id="pubdate_label" value="&staff.z39_50.search_class.pubdate;" control="pubdate_input" onclick="g.z3950.default_attr = 'pubdate'" style="-moz-user-focus: ignore"/>
-                                <textbox id="pubdate_input" mytype="search_class" search_class="pubdate" onkeypress="handle_enter(event)"/>
-                            </row><row>
-                                <label id="publisher_label" value="&staff.z39_50.search_class.publisher;" control="publisher_input" onclick="g.z3950.default_attr = 'publisher'" style="-moz-user-focus: ignore"/>
-                                <textbox id="publisher_input" mytype="search_class" search_class="publisher" onkeypress="handle_enter(event)"/>
-                            </row>
-                        -->
-                            <row>
-                                <label id="item_type_label" value="&staff.z39_50.search_class.item_type;" control="item_type_input" onclick="g.z3950.default_attr = 'item_type'" style="-moz-user-focus: ignore"/>
-                                <menulist id="item_type_input" mytype="search_class" search_class="item_type">
-                                    <menupopup>
-                                        <menuitem label="&staff.z39_50.search_class.item_type.all;" value=""/>
-                                        <menuitem label="&staff.z39_50.search_class.item_type.bks;" value="bks"/>
-                                        <menuitem label="&staff.z39_50.search_class.item_type.ser;" value="ser"/>
-                                        <menuitem label="&staff.z39_50.search_class.item_type.vis;" value="vis"/>
-                                        <menuitem label="&staff.z39_50.search_class.item_type.rec;" value="rec"/>
-                                        <menuitem label="&staff.z39_50.search_class.item_type.sco;" value="sco"/>
-                                        <menuitem label="&staff.z39_50.search_class.item_type.map;" value="map"/>
-                                        <menuitem label="&staff.z39_50.search_class.item_type.com;" value="com"/>
-                                        <menuitem label="&staff.z39_50.search_class.item_type.mix;" value="mix"/>
-                                        <menuitem label="&staff.z39_50.search_class.item_type.url;" value="url"/>
-                                        <menuitem label="&staff.z39_50.search_class.item_type.art;" value="art"/>
-                                    </menupopup>
-                                </menulist>
-                            </row>
-                        </rows>
-                    </grid>
-                </groupbox>
+                </vbox>
+            </hbox>
+            <groupbox flex="1" id="third_pane" persist="height">
+                <caption label="Results" />
+                <hbox id="result_message" />
                 <hbox>
-                    <button id="clear" label="Clear Form" accesskey="C"/>
-                    <button id="search" label="Search" accesskey="S"/>
+                    <button id="search_form" label="Search Form" accesskey="F" />
+                    <button id="page_next" label="Fetch More Results" accesskey="M" disabled="true"/>
+                    <button id="export" label="CSV to Clipboard" command="cmd_export" accesskey=""/>
+                    <button id="clip_button" command="sel_clip" label="Copy to Clipboard" disabled="true"/>
+                    <button id="save_cols_btn" command="save_columns" label="Save Columns" />
                     <spacer flex="1"/>
+                    <button id="marc_view" label="MARC View" accesskey="V" disabled="true"/>
+                    <button id="marc_import_overlay" label="MARC Editor for Overlay" accesskey="O" disabled="true"/>
+                    <button id="marc_import" label="MARC Editor for Import" accesskey="I" disabled="true"/>
                 </hbox>
-            </vbox>
-        </hbox>
-               <splitter><grippy/></splitter>
-               <groupbox flex="1" id="third_pane" persist="height">
-                       <caption label="Results" />
-                       <hbox id="result_message" />
-                       <hbox>
-                               <button id="page_next" label="Fetch More Results" accesskey="M" disabled="true"/>
-                               <button id="export" label="CSV to Clipboard" command="cmd_export" accesskey=""/>
-                               <button id="clip_button" command="sel_clip" label="Copy to Clipboard" disabled="true"/>
-                               <button id="save_cols_btn" command="save_columns" label="Save Columns" />
-                               <spacer flex="1"/>
-                               <button id="marc_view" label="MARC View" accesskey="V" disabled="true"/>
-                               <button id="marc_import_overlay" label="MARC Editor for Overlay" accesskey="O" disabled="true"/>
-                               <button id="marc_import" label="MARC Editor for Import" accesskey="I" disabled="true"/>
-                       </hbox>
-                       <deck id="deck" flex="1">
-                               <tree id="results" flex="1" enableColumnDrag="true" seltype="single"/>
-                               <iframe id="marc_frame" src="/xul/server/cat/marc_view.html" flex="1"/>
-                       </deck>
-               </groupbox>
-       </groupbox>
+                <deck id="deck" flex="1">
+                    <tree id="results" flex="1" enableColumnDrag="true" seltype="single"/>
+                    <iframe id="marc_frame" src="/xul/server/cat/marc_view.html" flex="1"/>
+                </deck>
+            </groupbox>
+       </deck>
+    </groupbox>
 
 </window>