new and improved spine and pocket label interface. Fixed the call number formating...
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 22 Sep 2006 06:26:59 +0000 (06:26 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 22 Sep 2006 06:26:59 +0000 (06:26 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6188 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/spine_labels.js [new file with mode: 0644]
Open-ILS/xul/staff_client/server/cat/spine_labels.xul

diff --git a/Open-ILS/xul/staff_client/server/cat/spine_labels.js b/Open-ILS/xul/staff_client/server/cat/spine_labels.js
new file mode 100644 (file)
index 0000000..8152e05
--- /dev/null
@@ -0,0 +1,277 @@
+               function my_init() {
+                       try {
+                               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+                               if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
+                               JSAN.errorLevel = "die"; // none, warn, or die
+                               JSAN.addRepository('/xul/server/');
+                               JSAN.use('util.error'); g.error = new util.error();
+                               g.error.sdump('D_TRACE','my_init() for spine_labels.xul');
+
+                               JSAN.use('util.network'); g.network = new util.network();
+
+                               g.cgi = new CGI();
+
+                               g.barcodes = [];
+                               if (g.cgi.param('barcodes')) {
+                                       g.barcodes = g.barcodes.concat( JSON2js(g.cgi.param('barcodes')) );
+                               }
+                               JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.stash_retrieve();
+                               if (g.data.temp_barcodes_for_labels) {
+                                       g.barcodes = g.barcodes.concat( g.data.temp_barcodes_for_labels );
+                                       g.data.temp_barcodes_for_labels = null; g.data.stash('temp_barcodes_for_labels');
+                               }
+
+                               JSAN.use('circ.util');
+                               g.cols = circ.util.columns( {} );
+                               g.col_map = {};
+                               for (var i = 0; i < g.cols.length; i++) {
+                                       g.col_map[ g.cols[i].id ] = { 'regex' : new RegExp('%' + g.cols[i].id + '%',"g"), 'render' : g.cols[i].render };
+                               }
+
+                               g.volumes = {};
+
+                               for (var i = 0; i < g.barcodes.length; i++) {
+                                       var copy = g.network.simple_request( 'FM_ACP_RETRIEVE_VIA_BARCODE', [ g.barcodes[i] ] );
+                                       if (typeof copy.ilsevent != 'undefined') throw(copy);
+                                       if (!g.volumes[ copy.call_number() ]) {
+                                               var volume = g.network.simple_request( 'FM_ACN_RETRIEVE', [ copy.call_number() ] );
+                                               if (typeof volume.ilsevent != 'undefined') throw(volume);
+                                               var record = g.network.simple_request('MODS_SLIM_RECORD_RETRIEVE', [ volume.record() ]);
+                                               volume.record( record );
+                                               g.volumes[ volume.id() ] = volume;
+                                       }
+                                       if (g.volumes[ copy.call_number() ].copies()) {
+                                               var copies = g.volumes[ copy.call_number() ].copies();
+                                               copies.push( copy );
+                                               g.volumes[ copy.call_number() ].copies( copies );
+                                       } else {
+                                               g.volumes[ copy.call_number() ].copies( [ copy ] );
+                                       }
+                               }
+
+                               generate();
+
+                               if (typeof xulG != 'undefined') $('close').hidden = true;
+
+                       } catch(E) {
+                               try {
+                                       g.error.standard_unexpected_error_alert('/xul/server/cat/spine_labels.xul',E);
+                               } catch(F) {
+                                       alert('FIXME: ' + js2JSON(E));
+                               }
+                       }
+               }
+
+               function $(id) { return document.getElementById(id); }
+
+               function generate() {
+                       try {
+                               var idx = 0;
+                               JSAN.use('util.text');
+                               JSAN.use('util.widgets'); util.widgets.remove_children('panel'); var pn = $('panel'); $('preview').disabled = false;
+                               var lw = Number($('lw').value) || 8; /* spine label width */
+                               var ll = Number($('ll').value) || 9; /* spine label length */
+                               var plw = Number($('plw').value) || 28; /* pocket label width */
+                               var pll = Number($('pll').value) || 9; /* pocket label length */
+                               for (var i in g.volumes) {
+                                       var vb = document.createElement('vbox'); pn.appendChild(vb); vb.setAttribute('name','template'); vb.setAttribute('acn_id',g.volumes[i].id());
+                                       var ds = document.createElement('description'); vb.appendChild(ds);
+                                       ds.appendChild( document.createTextNode( g.volumes[i].label() ) );
+                                       var ds2 = document.createElement('description'); vb.appendChild(ds2);
+                                       ds2.appendChild( document.createTextNode( g.volumes[i].copies().length + ( g.volumes[i].copies().length == 1 ? ' copy' : ' copies') ) );
+                                       ds2.setAttribute('style','color: green');
+                                       var hb = document.createElement('hbox'); vb.appendChild(hb);
+
+                                       var gb = document.createElement('groupbox'); hb.appendChild(gb); 
+                                       /* take the call number and split it on whitespace */
+                                       var names = String(g.volumes[i].label()).split(/\s+/);
+                                       var j = 0;
+                                       while (j < ll || j < pll) {
+                                               var hb2 = document.createElement('hbox'); gb.appendChild(hb2);
+                                               
+                                               /* spine */
+                                               if (j < ll) {
+                                                       var tb = document.createElement('textbox'); hb2.appendChild(tb); 
+                                                       tb.value = '';
+                                                       tb.setAttribute('class','plain'); tb.setAttribute('style','font-family: monospace');
+                                                       tb.setAttribute('size',lw+1); tb.setAttribute('maxlength',lw);
+                                                       tb.setAttribute('name','spine');
+                                                       var name = names.shift(); if (name) {
+                                                               name = String( name );
+                                                               /* if the name is greater than the label width... */
+                                                               if (name.length > lw) {
+                                                                       /* then try to split it on periods */
+                                                                       var sname = name.split(/\./);
+                                                                       if (sname.length > 1) {
+                                                                               /* if we can, then put the periods back in on each splitted element */
+                                                                               if (name.match(/^\./)) sname[0] = '.' + sname[0];
+                                                                               for (var k = 1; k < sname.length; k++) sname[k] = '.' + sname[k];
+                                                                               /* and put all but the first one back into the names array */
+                                                                               names = sname.slice(1).concat( names );
+                                                                               /* if the name fragment is still greater than the label width... */
+                                                                               if (sname[0].length > lw) {
+                                                                                       /* then just truncate and throw the rest back into the names array */
+                                                                                       tb.value = sname[0].substr(0,lw);
+                                                                                       names = [ sname[0].substr(lw) ].concat( names );
+                                                                               } else {
+                                                                                       /* otherwise we're set */
+                                                                                       tb.value = sname[0];
+                                                                               }
+                                                                       } else {
+                                                                               /* if we can't split on periods, then just truncate and throw the rest back into the names array */
+                                                                               tb.value = name.substr(0,lw);
+                                                                               names = [ name.substr(lw) ].concat( names );
+                                                                       }
+                                                               } else {
+                                                                       /* otherwise we're set */
+                                                                       tb.value = name;
+                                                               }
+                                                       }
+                                               }
+
+                                               /* pocket */
+                                               if ($('pl').checked && j < pll) {
+                                                       var tb2 = document.createElement('textbox'); hb2.appendChild(tb2); 
+                                                       tb2.value = '';
+                                                       tb2.setAttribute('class','plain'); tb2.setAttribute('style','font-family: monospace');
+                                                       tb2.setAttribute('size',plw+1); tb2.setAttribute('maxlength',plw);
+                                                       tb2.setAttribute('name','pocket');
+                                                       if ($('title').checked && $('title_line').value == j + 1 && instanceOf(g.volumes[i].record(),mvr)) {
+                                                               if (g.volumes[i].record().title()) {
+                                                                       tb2.value = util.text.wrap_on_space( g.volumes[i].record().title(), plw )[0];
+                                                               } else {
+                                                                       tb2.value = '';
+                                                               }
+                                                       }
+                                                       if ($('title_r').checked && $('title_r_line').value == j + 1 && instanceOf(g.volumes[i].record(),mvr)) {
+                                                               if (g.volumes[i].record().title()) {
+                                                                       tb2.value = ( ($('title_r_indent').checked ? ' ' : '') + util.text.wrap_on_space( g.volumes[i].record().title(), plw )[1]).substr(0,plw);
+                                                               } else {
+                                                                       tb2.value = '';
+                                                               }
+                                                       }
+                                                       if ($('author').checked && $('author_line').value == j + 1 && instanceOf(g.volumes[i].record(),mvr)) {
+                                                               if (g.volumes[i].record().author()) {
+                                                                       tb2.value = g.volumes[i].record().author().substr(0,plw);
+                                                               } else {
+                                                                       tb2.value = '';
+                                                               }
+                                                       }
+                                                       if ($('call_number').checked && $('call_number_line').value == j + 1) {
+                                                               tb2.value = g.volumes[i].label().substr(0,plw);
+                                                       }
+                                                       if ($('owning_lib_shortname').checked && $('owning_lib_shortname_line').value == j + 1) {
+                                                               var lib = g.volumes[i].owning_lib();
+                                                               if (!instanceOf(lib,aou)) lib = g.data.hash.aou[ lib ];
+                                                               tb2.value = lib.shortname().substr(0,plw);
+                                                       }
+                                                       if ($('owning_lib').checked && $('owning_lib_line').value == j + 1) {
+                                                               var lib = g.volumes[i].owning_lib();
+                                                               if (!instanceOf(lib,aou)) lib = g.data.hash.aou[ lib ];
+                                                               tb2.value = lib.name().substr(0,plw);
+                                                       }
+                                                       if ($('shelving_location').checked && $('shelving_location_line').value == j + 1) {
+                                                               tb2.value = '%location%';
+                                                       }
+                                                       if ($('barcode').checked && $('barcode_line').value == j + 1) {
+                                                               tb2.value = '%barcode%';
+                                                       }
+                                                       if ($('custom1').checked && $('custom1_line').value == j + 1) {
+                                                               tb2.value = $('custom1_tb').value;
+                                                       }
+                                                       if ($('custom2').checked && $('custom2_line').value == j + 1) {
+                                                               tb2.value = $('custom2_tb').value;
+                                                       }
+                                                       if ($('custom3').checked && $('custom3_line').value == j + 1) {
+                                                               tb2.value = $('custom3_tb').value;
+                                                       }
+                                                       if ($('custom4').checked && $('custom4_line').value == j + 1) {
+                                                               tb2.value = $('custom4_tb').value;
+                                                       }
+                                               }
+
+                                               j++;
+                                       }
+
+                                       idx++;
+                               }
+                       } catch(E) {
+                               g.error.standard_unexpected_error_alert('Generate',E);
+                       }
+               }
+
+               function expand_macros(text,copy) {
+                       var my = { 'acp' : copy };
+                       for (var i in g.col_map) {
+                               var re = g.col_map[i].regex;
+                               if (text.match(re)) {
+                                       try {
+                                               text = text.replace(re, eval( g.col_map[i].render ));
+                                       } catch(E) {
+                                               g.error.sdump('D_ERROR','spine_labels.js, expand_macros() = ' + E);
+                                       }
+                               }
+                       }
+                       return text;
+               }
+
+               function preview(idx) {
+                       try {
+                                       netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+                                       var pt = Number( $('pt').value ) || 10;  /* font size */
+                                       var lm = Number($('lm').value); if (lm == NaN) lm = 11; /* left margin */
+                                       var mm = Number($('mm').value); if (mm == NaN) mm = 2; /* middle margin */
+                                       var lw = Number($('lw').value) || 8; var ll = Number($('ll').value) || 9; /* spine label width and length */
+                                       var plw = Number($('plw').value) || 28; var pll = Number($('pll').value) || 9; /* pocket label width and length */
+                                       var html = "<html><head><link type='text/css' rel='stylesheet' href='data:text/css,pre{font-size:" + pt;
+                                       html += "pt; page-break-after: always;}'></link><title>Spine Labels</title></head><body>\n";
+                                       var nl = document.getElementsByAttribute('name','template');
+                                       for (var i = 0; i < nl.length; i++) {
+                                               if (typeof idx == 'undefined' || idx == null) { } else {
+                                                       if (idx != i) continue;
+                                               }
+                                               var volume = g.volumes[ nl[i].getAttribute('acn_id') ];
+
+                                               for (var j = 0; j < volume.copies().length; j++) {
+                                                       var copy = volume.copies()[j];
+                                                       html += '<pre>\n';
+                                                       var gb = nl[i].getElementsByTagName('groupbox')[0];
+                                                       var nl2 = gb.getElementsByAttribute('name','spine');
+                                                       for (var k = 0; k < nl2.length; k++) {
+                                                               for (var m = 0; m < lm; m++) html += ' ';
+                                                               html += expand_macros( nl2[k].value, copy ).substr(0,lw);
+                                                               if ($('pl').checked) {
+                                                                       var sib = nl2[k].nextSibling;
+                                                                       if (sib) {
+                                                                               for (var m = 0; m < lw - nl2[k].value.length; m++) html += ' ';
+                                                                               for (var m = 0; m < mm; m++) html += ' ';
+                                                                               html += expand_macros( sib.value, copy ).substr(0,plw);
+                                                                       }
+                                                               }
+                                                               html += '\n';
+                                                       }
+                                                       html += '</pre>\n';
+                                               }
+                                       }
+                                       html += '</body></html>';
+                                       JSAN.use('util.window'); var win = new util.window();
+                                       var loc = ( urls.XUL_REMOTE_BROWSER ) + '?url=' + window.escape('about:blank') + '&show_print_button=1&alternate_print=1&no_xulG=1&title=' + window.escape('Spine Labels');
+                                       var w = win.open( loc, 'spine_preview', 'chrome,resizable,width=750,height=550');
+                                       w.xulG = { 'on_url_load' : function(b) { 
+                                               try { 
+                                                       netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+                                                       if (typeof w.xulG.written == 'undefined') {
+                                                               w.xulG.written = true;
+                                                               w.g.browser.get_content().document.write(html);
+                                                               w.g.browser.get_content().document.close();
+                                                       }
+                                               } catch(E) {
+                                                       alert(E);
+                                               }
+                                       } };
+                       } catch(E) {
+                               g.error.standard_unexpected_error_alert('Preview and Print',E);
+                       }
+               }
+
+
index e19296e..a0b404d 100644 (file)
         <scripts id="openils_util_scripts"/>
 
        <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
-       <script>
-       <![CDATA[
-               function my_init() {
-                       try {
-                               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-                               if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
-                               JSAN.errorLevel = "die"; // none, warn, or die
-                               JSAN.addRepository('/xul/server/');
-                               JSAN.use('util.error'); g.error = new util.error();
-                               g.error.sdump('D_TRACE','my_init() for spine_labels.xul');
-
-                               JSAN.use('util.network'); g.network = new util.network();
-
-                               g.cgi = new CGI();
-
-                               g.barcodes = [];
-                               if (g.cgi.param('barcodes')) {
-                                       g.barcodes = g.barcodes.concat( JSON2js(g.cgi.param('barcodes')) );
-                               }
-                               JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.stash_retrieve();
-                               if (g.data.temp_barcodes_for_labels) {
-                                       g.barcodes = g.barcodes.concat( g.data.temp_barcodes_for_labels );
-                                       g.data.temp_barcodes_for_labels = null; g.data.stash('temp_barcodes_for_labels');
-                               }
-
-                               g.copies = [];
-                               g.volumes = {};
-                               g.volume_count = {};
-
-                               for (var i = 0; i < g.barcodes.length; i++) {
-                                       var copy = g.network.simple_request( 'FM_ACP_RETRIEVE_VIA_BARCODE', [ g.barcodes[i] ] );
-                                       if (typeof copy.ilsevent != 'undefined') throw(copy);
-                                       g.copies.push( copy );
-                                       if (!g.volumes[ copy.call_number() ]) {
-                                               var volume = g.network.simple_request( 'FM_ACN_RETRIEVE', [ copy.call_number() ] );
-                                               if (typeof volume.ilsevent != 'undefined') throw(volume);
-                                               g.volumes[ copy.call_number() ] = volume;
-                                               g.volume_count[ copy.call_number() ] = 1;
-                                       } else {
-                                               g.volume_count[ copy.call_number() ] += 1;
-                                       }
-                               }
-
-                               generate();
-
-                       } catch(E) {
-                               try {
-                                       g.error.standard_unexpected_error_alert('/xul/server/cat/spine_labels.xul',E);
-                               } catch(F) {
-                                       alert('FIXME: ' + js2JSON(E));
-                               }
-                       }
-               }
-
-               function $(id) { return document.getElementById(id); }
-
-               function generate() {
-                       try {
-                               var idx = 0;
-                               JSAN.use('util.widgets'); util.widgets.remove_children('panel'); var pn = $('panel'); $('preview').disabled = false;
-                               var lw = Number($('lw').value) || 8;
-                               var ll = Number($('ll').value) || 9;
-                               for (var i in g.volumes) {
-                                       var hb = document.createElement('vbox'); pn.appendChild(hb); hb.setAttribute('name','template');
-                                       var ds = document.createElement('description'); hb.appendChild(ds);
-                                       ds.appendChild( document.createTextNode( g.volumes[i].label() ) );
-                                       var gb = document.createElement('groupbox'); hb.appendChild(gb); 
-                                       var names = String(g.volumes[i].label()).split(/\s+/).reverse();
-                                       for (var j = 0; j < ll; j++) {
-                                               var hb2 = document.createElement('hbox'); gb.appendChild(hb2);
-                                               var tb = document.createElement('textbox'); hb2.appendChild(tb); 
-                                               tb.setAttribute('class','plain'); tb.setAttribute('style','font-family: monospace');
-                                               tb.setAttribute('size',lw+1); tb.setAttribute('maxlength',lw);
-                                               var name = names.pop(); if (!name) continue;
-                                               if (name.length > lw) {
-                                                       var sname = name.split(/\./);
-                                                       if (sname.length > 1) {
-                                                               for (var k = 1; k < sname.length; k++) sname[k] = '.' + sname[k];
-                                                               names = sname.slice(1).concat( names );
-                                                               if (sname[0].length > lw) {
-                                                                       tb.value = sname[0].substr(0,lw);
-                                                                       names = [ sname[0].substr(lw) ].concat( names );
-                                                               } else {
-                                                                       tb.value = sname[0];
-                                                               }
-                                                       } else {
-                                                               tb.value = name.substr(0,lw);
-                                                               names = [ name.substr(lw) ].concat( names );
-                                                       }
-                                               } else {
-                                                       tb.value = name;
-                                               }
-                                       }
-                                       var vb = document.createElement('vbox'); hb.appendChild(vb);
-                                       var label = document.createElement('label'); vb.appendChild(label);
-                                       label.setAttribute('value','Print how many?');
-                                       var tb = document.createElement('textbox'); vb.appendChild(tb);
-                                       tb.setAttribute('value', g.volume_count[ i ]); tb.setAttribute('name','count');
-                                       var btn = document.createElement('button'); vb.appendChild(btn);
-                                       btn.setAttribute('label','Test Print');
-                                       btn.setAttribute('oncommand',"preview(" + idx++ + ")");
-                               }
-                       } catch(E) {
-                               g.error.standard_unexpected_error_alert('Generate',E);
-                       }
-               }
-
-               function preview(idx) {
-                       try {
-                                       netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
-                                       var pt = Number( $('pt').value ) || 10; var lm = Number($('lm').value); if (lm == NaN) lm = 11;
-                                       var lw = Number($('lw').value) || 8; var ll = Number($('ll').value) || 9; 
-                                       var sbl = Number($('sbl').value); if (sbl == NaN) sbl = 2;
-                                       //alert('pt = ' + pt + ' lm = ' + lm + ' lw = ' + lw + ' ll = ' + ll + ' sbl = ' + sbl);
-                                       var html = "<html><head><link type='text/css' rel='stylesheet' href='data:text/css,pre{font-size:" + pt;
-                                       html += "pt; page-break-after: always;}'></link><title>Spine Labels</title></head><body>\n";
-                                       var nl = document.getElementsByAttribute('name','template');
-                                       for (var i = 0; i < nl.length; i++) {
-                                               if (typeof idx == 'undefined' || idx == null) { } else {
-                                                       if (idx != i) continue;
-                                               }
-                                               var count = Number( nl[i].getElementsByAttribute('name','count')[0].value ); if (count == NaN) count = 1;
-                                               for (var j = 0; j < count; j++) {
-                                                       html += '<pre>\n';
-                                                       var gb = nl[i].childNodes[1];
-                                                       var nl2 = gb.getElementsByTagName('textbox');
-                                                       for (var k = 0; k < nl2.length; k++) {
-                                                               for (var m = 0; m < lm; m++) html += ' ';
-                                                               html += nl2[k].value + '\n';
-                                                       }
-                                                       //for (var k = 0; k < sbl; k++) html += '\n';
-                                                       html += '</pre>\n';
-                                               }
-                                       }
-                                       html += '</body></html>';
-                                       JSAN.use('util.window'); var win = new util.window();
-                                       var loc = ( urls.XUL_REMOTE_BROWSER ) + '?url=' + window.escape( 'data:text/html,' + window.escape(html) ) + '&show_print_button=1&alternate_print=1&no_xulG=1&title=' + window.escape('Spine Labels');
-                                       var w = win.open( loc, 'spine_preview', 'chrome,resizable,width=750,height=550');
-                       } catch(E) {
-                               g.error.standard_unexpected_error_alert('Preview and Print',E);
-                       }
-               }
-
-       ]]>
-       </script>
-
-       <vbox id="spine_labels_main" flex="1">
-               <hbox>
+       <script type="text/javascript" src="/xul/server/cat/spine_labels.js"/>
+
+       <hbox id="spine_labels_main" flex="1">
+               <vbox>
+                       <hbox>
+                               <button label="Re-Generate" accesskey="G" oncommand="generate()"/>
+                               <spacer />
+                               <button id="preview" disabled="true" label="Preview and Print" accesskey="P" oncommand="preview()"/>
+                               <spacer />
+                               <button id="close" disabled="false" label="Close Window" accesskey="C" oncommand="window.close()"/>
+                       </hbox>
+
+                       <hbox><label value="Font size (in pts):" control="pt"/><textbox id="pt" value="10" onchange="this.setAttribute('value',this.value)" persist="value"/></hbox>
                        <grid><columns><column/><column/><column/><column/></columns><rows>
+                               <row> <label class="header" value="Spine Label"/><spacer/> </row>
+                               <row> <label value="Left Margin (in characters):" control="lm"/><textbox id="lm" value="0" onchange="this.setAttribute('value',this.value)" persist="value"/> </row>
+                               <row> <label value="Label Width (in characters):" control="lw"/><textbox id="lw" value="8" onchange="this.setAttribute('value',this.value)" persist="value"/> </row>
+                               <row> <label value="Label Length (in lines):" control="ll"/><textbox id="ll" value="9" onchange="this.setAttribute('value',this.value)" persist="value"/> </row>
+                               <row> <label class="header" value="Pocket Label"/><checkbox id="pl" checked="false" persist="checked" label="Enabled"/> </row>
+                               <row> <label value="Middle Margin (in characters):" control="mm"/><textbox id="mm" value="2" onchange="this.setAttribute('value',this.value)" persist="value"/> </row>
+                               <row> <label value="Label Width (in characters):" control="plw"/><textbox id="plw" value="28" onchange="this.setAttribute('value',this.value)" persist="value"/> </row>
+                               <row> <label value="Label Length (in lines):" control="pll"/><textbox id="pll" value="9" onchange="this.setAttribute('value',this.value)" persist="value"/> </row>
+                               <row> <checkbox id="title" checked="true" persist="checked" label="Include Title (wraps on word at label width)"/><hbox><label value="On line:"/><textbox id="title_line" value="4" persist="value"/></hbox> </row>
+                               <row> <checkbox id="title_r" checked="true" persist="checked" label="Include Title (segment after wrapping)"/><hbox><label value="On line:"/><textbox id="title_r_line" value="5" persist="value"/></hbox> </row>
+                               <row> <spacer/><checkbox id="title_r_indent" checked="true" persist="checked" label="Indent a space?"/> </row>
+                               <row> <checkbox id="author" checked="true" persist="checked" label="Include Author"/><hbox><label value="On line:"/><textbox id="author_line" value="3" persist="value"/></hbox> </row>
+                               <row> <checkbox id="call_number" checked="true" persist="checked" label="Include Call Number"/><hbox><label value="On line:"/><textbox id="call_number_line" value="2" persist="value"/></hbox> </row>
                                <row>
-                                       <label value="Font size (in pts):" control="pt"/><textbox id="pt" value="10" onchange="this.setAttribute('value',this.value)" persist="value"/>
+                                       <checkbox id="owning_lib_shortname" checked="false" persist="checked" label="Include Owning Library (policy code)"/>
+                                       <hbox><label value="On line:"/><textbox id="owning_lib_shortname_line" value="" persist="value"/></hbox>
                                </row>
                                <row>
-                                       <label value="Left Margin (in characters):" control="lm"/><textbox id="lm" value="0" onchange="this.setAttribute('value',this.value)" persist="value"/>
-                                       <label value="Include Copy Numbers?" control="cpn"/><checkbox id="cpn" oncommand="alert('Not Yet Implemented'); this.checked = false;"/>
+                                       <checkbox id="owning_lib" checked="false" persist="checked" label="Include Owning Library"/><hbox><label value="On line:"/><textbox id="owning_lib_line" value="" persist="value"/></hbox>
                                </row>
                                <row>
-                                       <label value="Label Width (in characters):" control="lw"/><textbox id="lw" value="8" onchange="this.setAttribute('value',this.value)" persist="value"/>
-                                       <label value="Include Copy Locations?" control="cbl"/><checkbox id="cbl" oncommand="alert('Not Yet Implemented'); this.checked = false;"/>
+                                       <checkbox id="shelving_location" checked="false" persist="checked" label="Include Shelving Location"/><hbox><label value="On line:"/><textbox id="shelving_location_line" value="" persist="value"/></hbox>
                                </row>
                                <row>
-                                       <label value="Label Length (in lines):" control="ll"/><textbox id="ll" value="9" onchange="this.setAttribute('value',this.value)" persist="value"/>
-                                       <label value="Include Library Code?" control="lsn"/><checkbox id="lsn" oncommand="alert('Not Yet Implemented'); this.checked = false;"/>
+                                       <checkbox id="barcode" checked="true" persist="checked" label="Include Item Barcode"/><hbox><label value="On line:"/><textbox id="barcode_line" value="1" persist="value"/></hbox>
                                </row>
-                               <row hidden="true">
-                                       <label value="Space Between Labels (in lines):" control="sbl"/><textbox id="sbl" value="0" onchange="this.setAttribute('value',this.value)" persist="value"/>
-                                       <description control="pb">Use form feeds instead of line feeds between labels?</description><checkbox id="pb" checked="true" oncommand="alert('This is always true now.');this.checked = true;"/>
+                               <row>
+                                       <hbox><checkbox id="custom1" checked="false" persist="checked" label="Custom:"/><textbox id="custom1_tb" value="%price%" persist="value"/></hbox>
+                                       <hbox><label value="On line:"/><textbox id="custom1_line" value="" persist="value"/></hbox>
+                               </row>
+                               <row>
+                                       <hbox><checkbox id="custom2" checked="false" persist="checked" label="Custom:"/><textbox id="custom2_tb" value="%deposit_amount%" persist="value"/></hbox>
+                                       <hbox><label value="On line:"/><textbox id="custom2_line" value="" persist="value"/></hbox>
+                               </row>
+                               <row>
+                                       <hbox><checkbox id="custom3" checked="false" persist="checked" label="Custom:"/><textbox id="custom3_tb" value="%alert_message%" persist="value"/></hbox>
+                                       <hbox><label value="On line:"/><textbox id="custom3_line" value="" persist="value"/></hbox>
+                               </row>
+                               <row>
+                                       <hbox><checkbox id="custom4" checked="false" persist="checked" label="Custom:"/><textbox id="custom4_tb" value="Don't sell me on eBay" persist="value"/></hbox>
+                                       <hbox><label value="On line:"/><textbox id="custom4_line" value="" persist="value"/></hbox>
                                </row>
                        </rows></grid>
-               </hbox>
-               <hbox>
-                       <button label="Generate" accesskey="G" oncommand="generate()"/>
-                       <spacer />
-                       <button id="preview" disabled="true" label="Preview and Print" accesskey="P" oncommand="preview()"/>
-                       <spacer />
-                       <button id="close" disabled="false" label="Close Window" accesskey="C" oncommand="window.close()"/>
-               </hbox>
-               <hbox id="panel" flex="1" style="overflow: auto"/>
-       </vbox>
+               </vbox>
+               <splitter><grippy/></splitter>
+               <vbox id="panel" flex="1" style="overflow: auto"/>
+       </hbox>
 
 </window>