From: miker Date: Thu, 23 Dec 2010 02:24:17 +0000 (+0000) Subject: When the subfield delimiter is configured as "$" (the default), use {dollar} to repre... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=620f5d756619b84200add4c534a7cf22e1c0d037;p=evergreen%2Fjoelewis.git 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! git-svn-id: svn://svn.open-ils.org/ILS/trunk@19051 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/MARC/Record.js b/Open-ILS/web/js/dojo/MARC/Record.js index a55bb77181..aca1aa08ff 100644 --- a/Open-ILS/web/js/dojo/MARC/Record.js +++ b/Open-ILS/web/js/dojo/MARC/Record.js @@ -272,7 +272,11 @@ if(!dojo._hasResource["MARC.Record"]) { 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 @@ if(!dojo._hasResource["MARC.Record"]) { 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');