[open-ils-commits] r715 - conifer/trunk/web/opac/skin/lul/xml/rdetail (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Nov 12 12:04:35 EST 2009
Author: dbs
Date: 2009-11-12 12:04:32 -0500 (Thu, 12 Nov 2009)
New Revision: 715
Modified:
conifer/trunk/web/opac/skin/lul/xml/rdetail/rdetail_summary.xml
Log:
Improve the regex to account for linefeeds in multi-subfield ISSN tags
Modified: conifer/trunk/web/opac/skin/lul/xml/rdetail/rdetail_summary.xml
===================================================================
--- conifer/trunk/web/opac/skin/lul/xml/rdetail/rdetail_summary.xml 2009-11-12 04:41:09 UTC (rev 714)
+++ conifer/trunk/web/opac/skin/lul/xml/rdetail/rdetail_summary.xml 2009-11-12 17:04:32 UTC (rev 715)
@@ -94,7 +94,11 @@
<script type='opac/slot-format'><![CDATA[
unHideMe($('tag022'));
var issn_raw = dojo.trim(dojox.data.dom.textContent(item));
- var issn = issn_raw.replace(/^.*?(\d{4}).(\d{3}(\d|x)).*?$/i, "$1-$2");
+ // textContent returns multiple subfields concatenated with linefeeds,
+ // so our regex needs to match against linefeeds. "." does not match
+ // linefeeds, so get \s into the mix
+ var issn = issn_raw.replace(/^(\s|.)*?(\d{4}).(\d{3,4}[xX]?)(\s|.)*/, "$2-$3");
+
var ses = new OpenSRF.ClientSession('open-ils.resolver');
var req = ses.request('open-ils.resolver.resolve_holdings.raw', 'issn', issn);
req.oncomplete = function(r) {
More information about the open-ils-commits
mailing list