back to a more traditional z-client look. The Local Catalog service won't work until...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 21 Sep 2008 18:16:32 +0000 (18:16 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 21 Sep 2008 18:16:32 +0000 (18:16 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10663 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/z3950.js
Open-ILS/xul/staff_client/server/cat/z3950.xul
Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
Open-ILS/xul/staff_client/server/skin/global.css

index b6eace7..7455027 100644 (file)
@@ -110,20 +110,29 @@ cat.z3950.prototype = {
                                 setTimeout( function() { obj.focus(); }, 0 );
                                                        }
                                                ],
+                        'marc_view_btn' : [
+                            ['render'],
+                            function(e) {
+                                e.setAttribute('label', $("catStrings").getString('staff.cat.z3950.marc_view.label'));
+                                e.setAttribute('accesskey', $("catStrings").getString('staff.cat.z3950.marc_view.accesskey'));
+                            }
+                        ],
                                                'marc_view' : [
                                                        ['command'],
                                                        function(ev) {
                                                                try {
-                                                                       var n = obj.controller.view.marc_view;
+                                                                       var n = obj.controller.view.marc_view_btn;
                                                                        if (n.getAttribute('toggle') == '1') {
                                                                                document.getElementById('deck').selectedIndex = 0;
                                                                                n.setAttribute('toggle','0');
-                                                                               n.setAttribute('label','MARC View');
+                                                                               n.setAttribute('label', $("catStrings").getString('staff.cat.z3950.marc_view.label'));
+                                                                               n.setAttribute('accesskey', $("catStrings").getString('staff.cat.z3950.marc_view.accesskey'));
                                                                                document.getElementById('results').focus();
                                                                        } else {
                                                                                document.getElementById('deck').selectedIndex = 1;
                                                                                n.setAttribute('toggle','1');
-                                                                               n.setAttribute('label', $("catStrings").getString('staff.cat.z3950.obj_controller_init.deck_label'));
+                                                                               n.setAttribute('label', $("catStrings").getString('staff.cat.z3950.results_view.label'));
+                                                                               n.setAttribute('accesskey', $("catStrings").getString('staff.cat.z3950.results_view.accesskey'));
                                                                                netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
                                                                                var f = get_contentWindow(document.getElementById('marc_frame'));
                                         var retrieve_id = n.getAttribute('retrieve_id');
@@ -170,32 +179,43 @@ 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() {
                                                                obj.page_next();
                                                        },
                                                ],
+                        'toggle_form_btn' : [
+                            ['render'],
+                            function(e) {
+                                e.setAttribute('image',"/xul/server/skin/media/images/up_arrow.gif");
+                                e.setAttribute('label',$("catStrings").getString('staff.cat.z3950.hide_top_pane.label'));
+                                e.setAttribute('accesskey',$("catStrings").getString('staff.cat.z3950.hide_top_pane.accesskey'));
+                            }
+                        ],
+                        'toggle_form' : [
+                            ['command'],
+                            function() {
+                                var x = document.getElementById('top_pane');
+                                x.hidden = ! x.hidden;
+                                                               var n = obj.controller.view.toggle_form_btn;
+                                if (x.hidden) {
+                                    n.setAttribute('image',"/xul/server/skin/media/images/down_arrow.gif");
+                                    n.setAttribute('label',$("catStrings").getString('staff.cat.z3950.unhide_top_pane.label'));
+                                    n.setAttribute('accesskey',$("catStrings").getString('staff.cat.z3950.unhide_top_pane.accesskey'));
+                                } else {
+                                    n.setAttribute('image',"/xul/server/skin/media/images/up_arrow.gif");
+                                    n.setAttribute('label',$("catStrings").getString('staff.cat.z3950.hide_top_pane.label'));
+                                    n.setAttribute('accesskey',$("catStrings").getString('staff.cat.z3950.hide_top_pane.accesskey'));
+                                }
+                            },
+                        ],
                                                'service_rows' : [
                                                        ['render'],
                                                        function(e) {
@@ -290,28 +310,32 @@ cat.z3950.prototype = {
                                                                                if (typeof robj.ilsevent != 'undefined') throw(robj);
                                                                                obj.services = robj;
                                         var x = document.getElementById('service_rows');
-                                                                               for (var i in robj) {
-                                            var r = document.createElement('row'); x.appendChild(r);
-                                            var cb = document.createElement('checkbox'); 
-                                                if (robj[i].label) {
-                                                    cb.setAttribute('label',robj[i].label);
-                                                } else if (robj[i].name) {
-                                                    cb.setAttribute('label',robj[i].name);
-                                                } else {
-                                                    cb.setAttribute('label',i);
-                                                }
-                                                cb.setAttribute('tooltiptext',i + ' : ' + robj[i].db + '@' + robj[i].host + ':' + robj[i].port); 
-                                                cb.setAttribute('mytype','service_class'); cb.setAttribute('service',i);
-                                                cb.setAttribute('id',i+'_service'); r.appendChild(cb);
-                                                cb.addEventListener('command',handle_switch,false);
-                                            var username = document.createElement('textbox'); username.setAttribute('id',i+'_username'); 
-                                            if (obj.creds.hosts[ obj.data.server_unadorned ] && obj.creds.hosts[ obj.data.server_unadorned ].services[i]) username.setAttribute('value',obj.creds.hosts[ obj.data.server_unadorned ].services[i].username);
-                                            r.appendChild(username);
-                                            if (typeof robj[i].auth != 'undefined') username.hidden = ! get_bool( robj[i].auth );
-                                            var password = document.createElement('textbox'); password.setAttribute('id',i+'_password'); 
-                                            if (obj.creds.hosts[ obj.data.server_unadorned ] && obj.creds.hosts[ obj.data.server_unadorned ].services[i]) password.setAttribute('value',obj.creds.hosts[ obj.data.server_unadorned ].services[i].password);
-                                            password.setAttribute('type','password'); r.appendChild(password);
-                                            if (typeof robj[i].auth != 'undefined') password.hidden = ! get_bool( robj[i].auth );
+                                                                               for (var i in obj.services) {
+                                            try {
+                                                var r = document.createElement('row'); x.appendChild(r);
+                                                var cb = document.createElement('checkbox'); 
+                                                    if (obj.services[i].label) {
+                                                        cb.setAttribute('label',obj.services[i].label);
+                                                    } else if (obj.services[i].name) {
+                                                        cb.setAttribute('label',obj.services[i].name);
+                                                    } else {
+                                                        cb.setAttribute('label',i);
+                                                    }
+                                                    cb.setAttribute('tooltiptext',i + ' : ' + obj.services[i].db + '@' + obj.services[i].host + ':' + obj.services[i].port); 
+                                                    cb.setAttribute('mytype','service_class'); cb.setAttribute('service',i);
+                                                    cb.setAttribute('id',i+'_service'); r.appendChild(cb);
+                                                    cb.addEventListener('command',handle_switch,false);
+                                                var username = document.createElement('textbox'); username.setAttribute('id',i+'_username'); 
+                                                if (obj.creds.hosts[ obj.data.server_unadorned ] && obj.creds.hosts[ obj.data.server_unadorned ].services[i]) username.setAttribute('value',obj.creds.hosts[ obj.data.server_unadorned ].services[i].username);
+                                                r.appendChild(username);
+                                                if (typeof obj.services[i].auth != 'undefined') username.hidden = ! get_bool( obj.services[i].auth );
+                                                var password = document.createElement('textbox'); password.setAttribute('id',i+'_password'); 
+                                                if (obj.creds.hosts[ obj.data.server_unadorned ] && obj.creds.hosts[ obj.data.server_unadorned ].services[i]) password.setAttribute('value',obj.creds.hosts[ obj.data.server_unadorned ].services[i].password);
+                                                password.setAttribute('type','password'); r.appendChild(password);
+                                                if (typeof obj.services[i].auth != 'undefined') password.hidden = ! get_bool( obj.services[i].auth );
+                                            } catch(E) {
+                                                alert(E);
+                                            }
                                         }
                                         obj.services[ 'native-evergreen-catalog' ] = { 'attrs' : { 'author' : {}, 'title' : {} } };
                                         setTimeout(
@@ -827,7 +851,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.controller.view.z3950_deck.selectedIndex = 1; obj.initial_search(); }, 0);
+               if (ev.keyCode == 13 /* enter */ || ev.keyCode == 77 /* enter on a mac */) setTimeout( function() { obj.initial_search(); }, 0);
        },
 }
 
index 6ca311a..d25e84a 100644 (file)
@@ -19,7 +19,7 @@
 <!-- OVERLAYS -->
 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
 
-<window id="cat_z3950_win" 
+<window id="cat_z3950_win2
        onload="try { my_init(); font_helper(); } catch(E) { alert(E); }"
        xmlns:html="http://www.w3.org/1999/xhtml"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
                <command id="cmd_export" />
                <command id="sel_clip" />
                <command id="save_columns" />
+               <command id="toggle_form" />
+               <command id="marc_view" />
        </commandset>
 
        <groupbox flex="1">
                <caption label="&staff.cat.z3950.marc_import.label;"/>
-        <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="&staff.cat.z3950.service_credentials.label;" class="shrinkable_groupbox"/>
-                        <grid flex="1">
-                            <columns>
-                                <column/>
-                                <column/>
-                                <column/>
-                            </columns>
-                            <rows id="service_rows">
-                                <row>
-                                    <label value="&staff.cat.z3950.service.label;"/>
-                                    <label value="&staff.cat.z3950.username.label;"/>
-                                    <label value="&staff.cat.z3950.password.label;"/>
-                                </row>
-                                <row>
-                                    <checkbox id="native-evergreen-catalog_service" mytype="service_class" service="native-evergreen-catalog"
-                                        label="&staff.cat.z3950.catalog_service.label;" tooltiptext="&staff.cat.z3950.catalog_service.tooltiptext;" /> 
-                                    <textbox id="native-evergreen-catalog_username" hidden="true"/>
-                                    <textbox id="native-evergreen-catalog_password" type="password" hidden="true"/>
-                                </row>
-                            </rows>
-                        </grid>
-                    </groupbox>
+            <hbox id="top_pane">
+                <groupbox flex="1">
+                    <caption label="&staff.cat.z3950.query.label;"/>
                     <hbox>
-                        <button id="save_creds" label="&staff.cat.z3950.save_creds.label;" accesskey="&staff.cat.z3950.save_creds.accesskey;"/>
+                        <spacer flex="1"/>
+                        <description>
+                        &staff.cat.z3950.query.description;
+                        </description>
+                        <spacer flex="1"/>
                     </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="&staff.cat.z3950.query.label;" class="shrinkable_groupbox"/>
-                        <hbox>
-                            <spacer flex="1"/>
-                            <description>
-                                &staff.cat.z3950.query.description;
-                            </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>
+                    <grid>
+                        <columns><column /><column flex="1" /></columns>
+                        <rows id="query_inputs">
+                            <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>
                     <hbox>
+                        <spacer flex="1"/>
                         <button id="clear" label="&staff.cat.z3950.clear.label;" accesskey="&staff.cat.z3950.clear.accesskey;"/>
                         <button id="search" label="&staff.cat.z3950.search.label;" accesskey="&staff.cat.z3950.search.accesskey;"/>
+                    </hbox>
+                </groupbox>
+                <groupbox flex="1">
+                    <caption label="&staff.cat.z3950.service_credentials.label;"/>
+                    <grid flex="1">
+                        <columns>
+                        <column/>
+                        <column/>
+                        <column/>
+                        </columns>
+                        <rows id="service_rows">
+                            <row>
+                                <label value="&staff.cat.z3950.service.label;"/>
+                                <label value="&staff.cat.z3950.username.label;"/>
+                                <label value="&staff.cat.z3950.password.label;"/>
+                            </row>
+                            <row>
+                                <checkbox id="native-evergreen-catalog_service" mytype="service_class" service="native-evergreen-catalog" label="&staff.cat.z3950.catalog_service.label;" tooltiptext="&staff.cat.z3950.catalog_service.tooltiptext;" /> 
+                                <textbox id="native-evergreen-catalog_username" hidden="true"/>
+                                <textbox id="native-evergreen-catalog_password" type="password" hidden="true"/>
+                            </row>
+                        </rows>
+                    </grid>
+                    <hbox>
+                        <button id="save_creds" label="&staff.cat.z3950.save_creds.label;" accesskey="&staff.cat.z3950.save_creds.accesskey;"/>
                         <spacer flex="1"/>
-                        <button id="results_page" label="&staff.cat.z3950.results_page.label;" accesskey="&staff.cat.z3950.results_page.accesskey;"/>
                     </hbox>
-                </vbox>
+                </groupbox>
             </hbox>
-            <groupbox flex="1" id="third_pane" persist="height">
+            <splitter id="z_splitter" persist="height"/>
+            <groupbox flex="1">
                 <caption label="&staff.cat.z3950.results_caption.label;"/>
                 <hbox id="result_message" />
                 <hbox>
-                    <button id="search_form" label="&staff.cat.z3950.search_form.label;" accesskey="&staff.cat.z3950.search_form.accesskey;"/>
                     <button id="page_next" label="&staff.cat.z3950.page_next.label;" accesskey="&staff.cat.z3950.page_next.accesskey;" disabled="true"/>
                     <button id="export" label="&staff.cat.z3950.export.label;" command="cmd_export" accesskey=""/>
                     <button id="clip_button" command="sel_clip" label="&staff.cat.z3950.clip_button.label;" disabled="true"/>
                     <button id="save_cols_btn" command="save_columns" label="&staff.cat.z3950.save_cols_btn.label;"/>
                     <spacer flex="1"/>
-                    <button id="marc_view" label="&staff.cat.z3950.marc_view.label;" accesskey="&staff.cat.z3950.marc_view.accesskey;" disabled="true"/>
+                    <button id="marc_view_btn" command="marc_view" disabled="true"/>
                     <button id="marc_import_overlay" label="&staff.cat.z3950.marc_import_overlay.label;" accesskey="&staff.cat.z3950.marc_import_overlay.accesskey;" disabled="true"/>
                     <button id="marc_import" label="&staff.cat.z3950.result_message.marc_import.label;" accesskey="&staff.cat.z3950.result_message.marc_import.accesskey;" disabled="true"/>
+                       <button id="toggle_form_btn" command="toggle_form"/>
                 </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>
-       </deck>
     </groupbox>
 
 </window>
index 9344997..38793bb 100644 (file)
@@ -365,8 +365,16 @@ staff.cat.volume_copy_creator.stash_and_close.tree_err2=volume tree update 2
 staff.cat.volume_copy_creator.stash_and_close.tree_err3=volume tree update 3
 staff.cat.volume_copy_creator.load_prefs.err_retrieving_prefs=Error retrieving stored preferences
 staff.cat.volume_copy_creator.save_prefs.err_storing_prefs=Error storing preferences
+staff.cat.z3950.native_catalog=Native Catalog
 staff.cat.z3950.obj_list_init.list_construction_error=Failure during list construction.
-staff.cat.z3950.obj_controller_init.deck_label=Results View
+staff.cat.z3950.results_view.label=Results View
+staff.cat.z3950.results_view.accesskey=V
+staff.cat.z3950.marc_view.label=MARC View
+staff.cat.z3950.marc_view.accesskey=V
+staff.cat.z3950.hide_top_pane.label=Hide Top Pane
+staff.cat.z3950.hide_top_pane.accesskey=T
+staff.cat.z3950.unhide_top_pane.label=Show Top Pane
+staff.cat.z3950.unhide_top_pane.accesskey=T
 staff.cat.z3950.obj_controller_init.marc_view_error=Failure during MARC view.
 staff.cat.z3950.obj_controller_init.marc_import_error=Failure during MARC import.
 staff.cat.z3950.obj_controller_init.marc_import_overlay_error=Failure during MARC import overlay.
index 1e35ecd..b4c21c0 100644 (file)
@@ -90,14 +90,6 @@ listitem { border-bottom: solid thin black; }
 .copy_editor_field_changed { background: lightgreen; }
 
 /*
- * oops, disable these until the native evergreen catalog z-source is in trunk/ 
- */
-
-checkbox[id="native-evergreen-catalog_service"] { display: none; }
-textbox[id="native-evergreen-catalog_username"] { display: none; }
-textbox[id="native-evergreen-catalog_password"] { display: none; }
-
-/*
  * disable Edit Hold Range and Edit Hold Focus by default; should probably be using perms/settings for this
  */
 .edit_hold_range { display: none; }