[open-ils-commits] r19064 - branches/rel_1_6_2/Open-ILS/web/js/dojo/MARC (gmc)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Dec 23 08:51:09 EST 2010


Author: gmc
Date: 2010-12-23 08:51:08 -0500 (Thu, 23 Dec 2010)
New Revision: 19064

Modified:
   branches/rel_1_6_2/Open-ILS/web/js/dojo/MARC/Record.js
Log:
When the subfield delimiter is configured as "$" (the default), use {dollar} to represent a literal dollar sign.  This is apparently in line with other Breaker-format tools.  Fix suggested by Galen Charlton, thanks gmc!

Signed-off-by: Galen Charlton <gmc at esilibrary.com>

Modified: branches/rel_1_6_2/Open-ILS/web/js/dojo/MARC/Record.js
===================================================================
--- branches/rel_1_6_2/Open-ILS/web/js/dojo/MARC/Record.js	2010-12-23 13:51:04 UTC (rev 19063)
+++ branches/rel_1_6_2/Open-ILS/web/js/dojo/MARC/Record.js	2010-12-23 13:51:08 UTC (rev 19064)
@@ -272,7 +272,11 @@
                                 ind2      : df_ind2(current_line),
                                 subfields : dojo.map(
                                     sf_list,
-                                    function (sf) { return [ sf.substring(0,1), sf.substring(1) ] }
+                                    function (sf) {
+                                        var sf_data = sf.substring(1);
+                                        if (me.delimiter == '$') sf_data = sf_data.replace(/\{dollar\}/g, '$');
+                                         return [ sf.substring(0,1), sf_data ];
+                                    }
                                 )
                         })
                     );
@@ -296,7 +300,9 @@
                         f.indicator(1).replace(' ','\\') + 
                         f.indicator(2).replace(' ','\\') + 
                         dojo.map( f.subfields, function (sf) {
-                            return me.delimiter + sf.join('');
+                            var sf_data = sf[1];
+                            if (me.delimiter == '$') sf_data = sf_data.replace(/\$/g, '{dollar}');
+                            return me.delimiter + sf[0] + sf_data;
                         }).join('');
                 }
             }).join('\n');



More information about the open-ils-commits mailing list