[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch rel_2_5 updated. c922bb20a3e3ea5f9aed6f95ec7c8ca0b70c474d

Evergreen Git git at git.evergreen-ils.org
Mon Dec 16 10:49:58 EST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_5 has been updated
       via  c922bb20a3e3ea5f9aed6f95ec7c8ca0b70c474d (commit)
      from  ed310bf7a1a06c8e6b62052e7c1678e091774b87 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c922bb20a3e3ea5f9aed6f95ec7c8ca0b70c474d
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Mon Nov 25 10:05:21 2013 -0800

    LP#1254816: prevent cases where a Google Book preview is not displayed
    
    Due to quirks in how different parts of the Google Books API
    processes ISBN searches, it is possible for a Google Books Preview
    badge to get displayed, but when the user tries to display the preview,
    the embedded preview does not get displayed.
    
    This patch fixes the problem by grabbing the preview link from
    the GB volumes search results, which in turn can be fed into the
    Embedded Viewer initialization.
    
    An ISBN that can be used to reproduce the problem is 9781937994198.
    Before the patch, the badge is displayed but not the preview; after
    the patch, both badge and preview should be displayed.
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/templates/opac/parts/ac_google_books.tt2 b/Open-ILS/src/templates/opac/parts/ac_google_books.tt2
index cbec24f..a03bfb9 100644
--- a/Open-ILS/src/templates/opac/parts/ac_google_books.tt2
+++ b/Open-ILS/src/templates/opac/parts/ac_google_books.tt2
@@ -1,5 +1,6 @@
 <script type="text/javascript">
 var GBisbns = Array();
+var GBPreviewLink = '';
 var GBPreviewShowing = false;
 
 /**
@@ -27,6 +28,10 @@ function GBPreviewCallback(GBPBookInfo) {
   }
 
   if ( accessInfo.embeddable ) {
+    GPPreviewLink = GBPBookInfo.items[0].volumeInfo.previewLink;
+    if ( !GPPreviewLink) {
+        return;
+    }
     /* Add a button below the book cover image to load the preview. */
     var GBPBadge = document.createElement( 'img' );
     GBPBadge.id = 'gbpbadge';
@@ -66,7 +71,7 @@ function GBDisplayPreview(scroll_to_div) {
 
 function GBPViewerLoadCallback() {
   var GBPViewer = new google.books.DefaultViewer(dojo.byId('rdetail_preview_div'));
-  GBPViewer.load('ISBN:' + GBisbns[0]);
+  GBPViewer.load(GPPreviewLink);
   GBPViewer.resize();
   var GBPBadgelink = dojo.byId('gbpbadge_link');
   GBPBadgelink.href = 'javascript:GBShowHidePreview(true);';

-----------------------------------------------------------------------

Summary of changes:
 .../src/templates/opac/parts/ac_google_books.tt2   |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list