use the correct name for marcbreaker format; add support for sf delimiter to batches
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 28 Nov 2009 23:32:32 +0000 (23:32 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 28 Nov 2009 23:32:32 +0000 (23:32 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15037 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/MARC/Batch.js

index 88f0c24..2386037 100644 (file)
@@ -27,6 +27,7 @@ if(!dojo._hasResource["MARC.Batch"]) {
             this.ready = false;
             this.records = [];
             this.source = kwargs.source;
+            this.delimiter = kwargs.delimiter
             this.current_record = 0;
 
             if (this.source) this.ready = true;
@@ -42,9 +43,9 @@ if(!dojo._hasResource["MARC.Batch"]) {
             } else if (this.source.match(/^\s*</)) { // this is xml text
                 this.source = dojox.xml.parser.parse( this.source );
                 this.parse();
-            } else { // must be a breaker doc. split on blank lines
+            } else { // must be a marcbreaker doc. split on blank lines
                 this.source = this.source.split(/^$/);
-                this.type = 'breaker';
+                this.type = 'marcbreaker';
             }
         },
 
@@ -67,6 +68,7 @@ if(!dojo._hasResource["MARC.Batch"]) {
             if (chunk) {
                 var args = {};
                 args[this.type] = chunk;
+                if (this.delimiter) args.delimiter = this.delimiter;
                 return new MARC.Record(args);
             }