[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch rel_2_4 updated. d7ef743766389a85111f9061cce17687ba5326a1

Evergreen Git git at git.evergreen-ils.org
Mon Dec 16 10:50:30 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_4 has been updated
       via  d7ef743766389a85111f9061cce17687ba5326a1 (commit)
      from  ccc9672ab69909cfe9c7dcdd52b9fa84d0784c44 (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 d7ef743766389a85111f9061cce17687ba5326a1
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 3dbb5f9..2af92b9 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