Bug 8733: Follow-up The isbn sent to idream contains dash
authorJonathan Druart <jonathan.druart@biblibre.com>
Fri, 1 Feb 2013 12:38:13 +0000 (13:38 +0100)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Mon, 4 Feb 2013 13:01:19 +0000 (08:01 -0500)
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt

index a8e13be..07d4f68 100644 (file)
@@ -186,6 +186,7 @@ $(function () {
         var isbn = $(".isbn:last").text().split(" ")[1];
         if (isbn) {
         isbn = isbn.replace(/\W*$/, '');
+        isbn = isbn.replace(/-/, '');
 
         if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) {
         // Use Microsoft XDR for IE version 8 or above
@@ -210,6 +211,7 @@ $(function () {
 function parseIDBJSON( json ) {
     if(json.total_results > 0 && json.book.rating > 0){
         var isbn = $(".isbn:last").text().split(" ")[1];
+        isbn = isbn.replace(/-/, '');
 
 [% IF ( IDreamBooksReadometer ) %]
         $(".title").append('<a href="'+json.book.detail_link+'" id="idreambooksreadometer"><img src="http://idreambooks.com/remotereadometer/'+isbn+'.jpg" alt="'+json.book.title+' by '+json.book.author+'" title="Rating based on reviews of '+json.book.title+'"></a>');