usability tweak for controlling screen real estate, in unified vol/copy editor don...
authorJason Etheridge <jason@esilibrary.com>
Fri, 20 May 2011 09:04:17 +0000 (05:04 -0400)
committerJason Etheridge <jason@esilibrary.com>
Fri, 20 May 2011 14:52:29 +0000 (10:52 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul
Open-ILS/xul/staff_client/server/cat/volume_copy_editor.js
Open-ILS/xul/staff_client/server/cat/volume_copy_editor.xul
Open-ILS/xul/staff_client/server/cat/volume_copy_editor_horiz.xul

index 7bc79c1..dcaac78 100644 (file)
@@ -145,11 +145,18 @@ function my_init() {
             alert('Error in volume_copy_creator.js, g.doc_id not valid');
             window.close(); return;
         }
-        var sb = document.getElementById('summary_box'); while(sb.firstChild) sb.removeChild(sb.lastChild);
-        var summary = document.createElement('iframe'); sb.appendChild(summary);
-        summary.setAttribute('src',urls.XUL_BIB_BRIEF);
-        summary.setAttribute('flex','1');
-        get_contentWindow(summary).xulG = { 'docid' : g.doc_id };
+
+        var sb = document.getElementById('summary_box');
+        if (xul_param('no_bib_summary')) {
+            sb.hidden = true;
+            sb.nextSibling.hidden = true; /* splitter */
+        } else {
+            while(sb.firstChild) sb.removeChild(sb.lastChild);
+            var summary = document.createElement('iframe'); sb.appendChild(summary);
+            summary.setAttribute('src',urls.XUL_BIB_BRIEF);
+            summary.setAttribute('flex','1');
+            get_contentWindow(summary).xulG = { 'docid' : g.doc_id };
+        }
 
         /***********************************************************************************************************/
         /* Setup pcrud and fetch the monographic parts for this bib */
@@ -207,6 +214,10 @@ function my_init() {
             dump('Error in volume_copy_creator.js, my_init(), trying to auto-scroll to the far right: ' + E + '\n');
         }
 
+        if (typeof xulG.volume_ui_callback_for_unified_interface == 'function') {
+            xulG.volume_ui_callback_for_unified_interface();
+        }
+
     } catch(E) {
         var err_msg = $("commonStrings").getFormattedString('common.exception', ['cat/volume_copy_creator.js', E]);
         try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); dump(js2JSON(E)); }
index 0cbf65d..f48695a 100644 (file)
         <grippy/>
     </splitter>
     <vbox id="main" oils_persist="height" flex="1">
-        <hbox flex="0">
-            <hbox id="batch_bar">
-                <label value="&staff.cat.volume_copy_creator.batch_bar;"/>
-                <label class="cn_class" value="&staff.cat.volume_copy_creator.batch_bar.call_number.classification;"/>
-                <hbox class="cn_class" id="batch_class"/>
-                <label class="cn_prefix" value="&staff.cat.volume_copy_creator.batch_bar.call_number.prefix;"/>
-                <hbox class="cn_prefix" id="batch_prefix"/>
-                <label value="&staff.cat.volume_copy_creator.batch_bar.call_number.label.label;"
-                    accesskey="&staff.cat.volume_copy_creator.batch_bar.call_number.label.accesskey;" control="marc_cn_menulist"/>
-                <hbox id="marc_cn"/>
-                <label class="cn_suffix" value="&staff.cat.volume_copy_creator.batch_bar.call_number.suffix;"/>
-                <hbox class="cn_suffix" id="batch_suffix"/>
-                <hbox id="batch_button_box"/>
-            </hbox>
-            <spacer flex="1" />
-        </hbox>
         <groupbox flex="1" class="my_overflow">
             <caption id="caption" label="&staff.cat.volume_copy_creator.label;"/>
+            <hbox flex="0">
+                <hbox id="batch_bar" flex="1">
+                    <label value="&staff.cat.volume_copy_creator.batch_bar;"/>
+                    <label class="cn_class" value="&staff.cat.volume_copy_creator.batch_bar.call_number.classification;"/>
+                    <hbox class="cn_class" id="batch_class"/>
+                    <label class="cn_prefix" value="&staff.cat.volume_copy_creator.batch_bar.call_number.prefix;"/>
+                    <hbox class="cn_prefix" id="batch_prefix"/>
+                    <label value="&staff.cat.volume_copy_creator.batch_bar.call_number.label.label;"
+                        accesskey="&staff.cat.volume_copy_creator.batch_bar.call_number.label.accesskey;" control="marc_cn_menulist"/>
+                    <hbox id="marc_cn"/>
+                    <label class="cn_suffix" value="&staff.cat.volume_copy_creator.batch_bar.call_number.suffix;"/>
+                    <hbox class="cn_suffix" id="batch_suffix"/>
+                    <hbox id="batch_button_box"/>
+                </hbox>
+            </hbox>
             <grid flex="1">
                 <columns> <column flex="0"/> <column flex="0"/> <column flex="1"/> </columns>
                 <rows id="rows">
index 468f95e..28f3c78 100644 (file)
@@ -21,6 +21,12 @@ function my_init() {
         xulG.not_modal = true;
         xulG.edit = true;
 
+        // Volume Creator looks for these
+        xulG.no_bib_summary = true;
+        xulG.volume_ui_callback_for_unified_interface = function() {
+            on_volume_pane_load();
+        };
+
         // Spawn the volume/copy creator
         JSAN.use('util.browser');
         var volume_pane = new util.browser();
@@ -30,27 +36,7 @@ function my_init() {
                 'push_xulG' : true,
                 'alt_print' : false,
                 'browser_id' : 'volume_pane',
-                'passthru_content_params' : xulG,
-                'on_url_load' : function() {
-                    if ($('Create')) { // in horizontal UI variant
-                        // Hide the Create button in the embedded volume creator
-                        var f_content = get_contentWindow( $('volume_pane' ) );
-                        var original_btn = f_content.document.getElementById('Create');
-                        original_btn.hidden = true;
-                        $('Create').setAttribute(
-                            'label',
-                            $('catStrings').getString('staff.cat.volume_copy_creator.create.btn.label')
-                        );
-                        $('Create').setAttribute(
-                            'accesskey',
-                            $('catStrings').getString('staff.cat.volume_copy_creator.create.btn.accesskey')
-                        );
-                        g.stash_and_close = function(p) {
-                            // Wire up the method for the replacement button
-                            f_content.g.stash_and_close(p);
-                        }
-                    }
-                }
+                'passthru_content_params' : xulG
             }
         );
 
@@ -129,3 +115,37 @@ function setup_templates() {
     }
 }
 
+function on_volume_pane_load() {
+    try {
+        var f_content = get_contentWindow( $('volume_pane' ) );
+
+        // horizontal UI variant has its own create button
+        if ($('Create')) {
+            var original_btn = f_content.document.getElementById('Create');
+            original_btn.hidden = true;
+            $('Create').setAttribute(
+                'label',
+                $('catStrings').getString('staff.cat.volume_copy_creator.create.btn.label')
+            );
+            $('Create').setAttribute(
+                'accesskey',
+                $('catStrings').getString('staff.cat.volume_copy_creator.create.btn.accesskey')
+            );
+            g.stash_and_close = function(p) {
+                // Wire up the method for the replacement button
+                f_content.g.stash_and_close(p);
+            }
+        }
+
+        // load the bib summary pane
+        var sb = document.getElementById('summary_box');
+        while(sb.firstChild) sb.removeChild(sb.lastChild);
+        var summary = document.createElement('iframe'); sb.appendChild(summary);
+        summary.setAttribute('src',urls.XUL_BIB_BRIEF);
+        summary.setAttribute('flex','1');
+        get_contentWindow(summary).xulG = { 'docid' : f_content.g.doc_id };
+        dump('f_content.g.doc_id = ' + f_content.g.doc_id + '\n');
+    } catch(E) {
+        alert('Error in volume_copy_editor.js, on_volume_pane_load(): ' + E);
+    }
+}
index b35c077..911c032 100644 (file)
     <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
     <script type="text/javascript" src="volume_copy_editor.js"/>
 
+    <vbox id="summary_box" oils_persist="height"/>
+    <splitter
+        collapse="before"
+        resize_before="flex"
+        resize_after="grow"
+        oils_persist="state hidden"
+        oils_persist_peers="summary_box main">
+        <grippy/>
+    </splitter>
     <vbox flex="1">
         <vbox id="top_pane" flex="1" oils_persist="height">
             <hbox id="template_bar_holder"/>
index 99b1276..b500ab4 100644 (file)
     <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
     <script type="text/javascript" src="volume_copy_editor.js"/>
 
-    <hbox id="template_bar_holder"/>
+    <vbox id="summary_box" oils_persist="height"/>
+    <splitter
+        collapse="before"
+        resize_before="flex"
+        resize_after="grow"
+        oils_persist="state hidden"
+        oils_persist_peers="summary_box main">
+        <grippy/>
+    </splitter>
+    <hbox flex="0" id="template_bar_holder"/>
     <hbox flex="1">
         <vbox id="top_pane" flex="1" oils_persist="width">
             <browser id="volume_pane" flex="1" />