[open-ils-commits] r10004 -
branches/rel_1_2/Open-ILS/web/opac/skin/default/js
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Jul 9 09:18:39 EDT 2008
Author: dbs
Date: 2008-07-09 09:18:37 -0400 (Wed, 09 Jul 2008)
New Revision: 10004
Modified:
branches/rel_1_2/Open-ILS/web/opac/skin/default/js/rdetail.js
Log:
Backport r10003 from trunk:
Enhance URL detection and linking just a tiny bit further:
* Require a slash to avoid matching online URL for "HTTP: The Complete Reference"
* Use same tests to determine whether the name is just the URL repeated (or a
slight variation thereof)
Modified: branches/rel_1_2/Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- branches/rel_1_2/Open-ILS/web/opac/skin/default/js/rdetail.js 2008-07-09 13:17:18 UTC (rev 10003)
+++ branches/rel_1_2/Open-ILS/web/opac/skin/default/js/rdetail.js 2008-07-09 13:18:37 UTC (rev 10004)
@@ -209,10 +209,11 @@
var links = record.online_loc();
for( var i = 0; links && links.length > 0 && i < links.length; i = i + 2 ) {
var href = links[i];
- if( href.match(/https?:|ftp:|mailto:/) ) {
+ // avoid matching "HTTP: The Complete Reference"
+ if( href.match(/https?:\/|ftps?:\/|mailto:/i) ) {
unHideMe($('rdetail_online_row'));
var name = '' + links[i+1];
- if(!name || name.match(/http/)) name = href;
+ if(!name || name.match(/https?:\/|ftps?:\/|mailto:/i)) name = href;
$('rdetail_online').appendChild(elem('a', {href:href,'class':'classic_link'}, name));
$('rdetail_online').appendChild(elem('br'));
}
More information about the open-ils-commits
mailing list