From: dbs Date: Tue, 24 Mar 2009 03:53:36 +0000 (+0000) Subject: Enhance i18n support for Google Book Preview - addresses #50. X-Git-Tag: sprint4-merge-nov22~10427 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d906df8ce512c4f905b86058b2c1ce312cdbdb99;p=working%2FEvergreen.git Enhance i18n support for Google Book Preview - addresses #50. git-svn-id: svn://svn.open-ils.org/ILS/trunk@12650 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/opac/locale/en-US/opac.dtd b/Open-ILS/web/opac/locale/en-US/opac.dtd index 42664be843..fdaf6562a3 100644 --- a/Open-ILS/web/opac/locale/en-US/opac.dtd +++ b/Open-ILS/web/opac/locale/en-US/opac.dtd @@ -535,6 +535,9 @@ We recommend that you remove this title from any bookbags it may have been added + + + diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js index b9732675d1..04ce43543d 100644 --- a/Open-ILS/web/opac/skin/default/js/rdetail.js +++ b/Open-ILS/web/opac/skin/default/js/rdetail.js @@ -800,17 +800,11 @@ function _rdetailSortStatuses(a, b) { } /** - * XXX Need to adopt a more typical approach to showing loading status + * Check for a Google Book preview */ function rdetailCheckForGBPreview() { - if (!googleBookPreview) return; - var GBPp = document.createElement('p'); - GBPp.appendChild( document.createTextNode('Loading... ' ) ); - GBPp.id = 'loading'; - $('rdetail_preview_div').appendChild(GBPp); searchForGBPreview( cleanISBN(record.isbn()) ); - } /** @@ -850,7 +844,6 @@ function searchForGBPreview( isbn ) { * @param {JSON} booksInfo is the JSON object pulled from the Google books service. */ function GBPreviewCallback(GBPBookInfo) { - // Clear any old data to prepare to display the Loading... message. var GBPreviewDiv = document.getElementById("rdetail_preview_div"); var GBPBook; @@ -864,22 +857,23 @@ function GBPreviewCallback(GBPBookInfo) { if ( GBPBook.preview != "noview" ) { if ( GBPBook.preview == 'full' ) { - setText( $('rdetail_preview_link'), 'Full Text' ); - $('rdetail_preview_link_a').title = 'See the full text of this book.'; + setText( $('rdetail_preview_link'), $('rdetail_preview_full_text').innerHTML ); + $('rdetail_preview_link_a').title = $('rdetail_preview_title').innerHTML; } // Add a button below the book cover image to load the preview. GBPBadge = document.createElement( 'img' ); GBPBadge.src = 'http://books.google.com/intl/en/googlebooks/images/gbs_preview_button1.gif'; - GBPBadge.title = 'Show a preview of this book from Google Book Search'; + GBPBadge.title = $('rdetail_preview_badge').innerHTML; GBPBadge.style.border = 0; GBPBadgelink = document.createElement( 'a' ); GBPBadgelink.href = 'javascript:rdetailShowExtra("preview");'; GBPBadgelink.appendChild( GBPBadge ); $('rdetail_image_cell').appendChild( GBPBadgelink ); + $('rdetail_preview_div').style.height = 600; + /* Display the "Preview" tab in the Extras section */ unHideMe( $('rdetail_preview_link' ) ); - $('rdetail_preview_div').style.height = 600; } } @@ -890,6 +884,7 @@ function GBPreviewCallback(GBPBookInfo) { * XXX I18N of Google Book Preview language attribute needed */ function rdetailDisplayGBPreview() { + unHideMe($('rdetail_extras_loading')); GBPreviewPane = $('rdetail_preview_div'); if ( GBPreviewPane.getAttribute('loaded') == null || GBPreviewPane.getAttribute('loaded') == "false" ) { @@ -899,6 +894,7 @@ function rdetailDisplayGBPreview() { } function rdetailGBPViewerLoadCallback() { + hideMe($('rdetail_extras_loading')); var GBPViewer = new google.books.DefaultViewer(document.getElementById('rdetail_preview_div')); GBPViewer.load('ISBN:' + cleanISBN(record.isbn()) ); diff --git a/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml b/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml index 7b38f9aba6..96a8fdccdc 100644 --- a/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml +++ b/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml @@ -110,4 +110,8 @@ + +
&rdetail.extras.preview.fulltext;
+
&rdetail.extras.preview.title;
+
&rdetail.extras.preview.badge;