Replace a bare URL in an 856 link label
authorJeff Godin <jgodin@tadl.org>
Thu, 26 Dec 2013 19:56:27 +0000 (14:56 -0500)
committerJeff Godin <jgodin@tadl.org>
Thu, 26 Dec 2013 19:56:27 +0000 (14:56 -0500)
If a bare URL has survived this far as an 856 link label, replace it
with something generic rather than displaying a difficult-to-wrap
URL.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
templates_tadlskin/opac/parts/misc_util.tt2

index d340a33..625e172 100644 (file)
                     res.href = uri.getAttribute('href');
                     res.link = uri.getAttribute('label');
                     res.note = uri.getAttribute('use_restriction');
+                    IF res.link.match('^http');
+                        res.link = 'Connect to this resource online';
+                    END;
                     args.uris.push(res);
                     IF res.href.match('^http://via.tadl.org/');
                         args.ezproxy = 1;