enough for now, wife calleth
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 15 Nov 2005 23:11:10 +0000 (23:11 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 15 Nov 2005 23:11:10 +0000 (23:11 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2040 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/cat/spine_label_wizard.xul

index 434623a..05770d8 100644 (file)
@@ -19,6 +19,8 @@
        <script>
        <![CDATA[
 
+               var cols = 20; var rows = 3; var divider = 0;
+
                function spine_label_init() {
                        var spine_labels; try { spine_labels = params.spine_labels; } catch(E) { sdump('D_ERROR',js2JSON(E) + '\n'); }
                        if (!spine_labels) spine_labels = [ [ 'A Call Number', '1' ] ];
                                        count_tb.setAttribute('value',count);
                                btn.addEventListener('command',
                                        function() {
-                                               sPrint(label_tb.value + '<br />', false);       
+                                               sPrint(label2html(label_tb.value), false);      
                                        }, false
                                );
                        }
                }
 
+               function label2html(s) {
+                       var html = '';
+                       var a = s.split('\n');
+                       for (var i in a) {
+                               if (i < rows) {
+                                       html += a[i].substr(0,cols) + print_crlf;
+                               }
+                       }
+                       return html;
+               }
+
        ]]>
        </script>