[open-ils-commits] r12650 - in trunk/Open-ILS/web/opac: locale/en-US skin/default/js skin/default/xml/rdetail (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Mar 23 23:53:38 EDT 2009


Author: dbs
Date: 2009-03-23 23:53:36 -0400 (Mon, 23 Mar 2009)
New Revision: 12650

Modified:
   trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
   trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
   trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml
Log:
Enhance i18n support for Google Book Preview - addresses #50.


Modified: trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/opac.dtd	2009-03-24 02:26:56 UTC (rev 12649)
+++ trunk/Open-ILS/web/opac/locale/en-US/opac.dtd	2009-03-24 03:53:36 UTC (rev 12650)
@@ -535,6 +535,9 @@
 <!ENTITY rdetail.extras.marc "MARC Record">
 <!ENTITY rdetail.extras.call.null "There are no call numbers for this item at this location.">
 <!ENTITY rdetail.extras.call.local "Local Call Numbers:">
+<!ENTITY rdetail.extras.preview.fulltext "Full text">
+<!ENTITY rdetail.extras.preview.title "See the full text of this book.">
+<!ENTITY rdetail.extras.preview.badge "Show a preview of this book from Google Book Search">
 <!ENTITY rdetail.loading "Loading copy infomation...">
 <!ENTITY rdetail.noneAvailable " * There are no copies in this location">
 <!ENTITY rdetail.summary.online "Online Resources">

Modified: trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rdetail.js	2009-03-24 02:26:56 UTC (rev 12649)
+++ trunk/Open-ILS/web/opac/skin/default/js/rdetail.js	2009-03-24 03:53:36 UTC (rev 12650)
@@ -800,17 +800,11 @@
 }
 
 /**
- * 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 @@
  * @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 @@
 
 	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 @@
  * 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 rdetailGBPViewerLoadCallback() {
+	hideMe($('rdetail_extras_loading'));
 	var GBPViewer = new google.books.DefaultViewer(document.getElementById('rdetail_preview_div'));
 	GBPViewer.load('ISBN:' + cleanISBN(record.isbn()) );
 

Modified: trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml	2009-03-24 02:26:56 UTC (rev 12649)
+++ trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml	2009-03-24 03:53:36 UTC (rev 12650)
@@ -110,4 +110,8 @@
 		<!--#include virtual="rdetail_cn_details.xml"-->
 
 	</div>
+	<!-- Text for dynamic JavaScript -->
+	<div id='rdetail_preview_full_text' class='hide_me'>&rdetail.extras.preview.fulltext;</div>
+	<div id='rdetail_preview_title' class='hide_me'>&rdetail.extras.preview.title;</div>
+	<div id='rdetail_preview_badge' class='hide_me'>&rdetail.extras.preview.badge;</div>
 </div>



More information about the open-ils-commits mailing list