[open-ils-commits] r12467 - 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
Sun Mar 8 11:10:30 EDT 2009
Author: dbs
Date: 2009-03-08 11:10:28 -0400 (Sun, 08 Mar 2009)
New Revision: 12467
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:
Stop trampling on added content "Excerpt" tab and create a new "Preview" tab (which also follows GBS branding requirements). Part of #50
Modified: trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/opac.dtd 2009-03-08 14:34:47 UTC (rev 12466)
+++ trunk/Open-ILS/web/opac/locale/en-US/opac.dtd 2009-03-08 15:10:28 UTC (rev 12467)
@@ -529,6 +529,7 @@
<!ENTITY rdetail.extras.reviews "Reviews">
<!ENTITY rdetail.extras.toc "Table of Contents">
<!ENTITY rdetail.extras.excerpt "Excerpt">
+<!ENTITY rdetail.extras.preview "Preview">
<!ENTITY rdetail.extras.author.notes "Author Notes">
<!ENTITY rdetail.extras.annotation "Annotation">
<!ENTITY rdetail.extras.marc "MARC Record">
Modified: trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2009-03-08 14:34:47 UTC (rev 12466)
+++ trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2009-03-08 15:10:28 UTC (rev 12467)
@@ -24,9 +24,9 @@
var rdetailShowLocal = true;
var rdetailShowCopyLocation = true;
+var googleBookPreview = true;
-
var nextContainerIndex;
function rdetailReload() {
@@ -349,6 +349,7 @@
hideMe($('rdetail_toc_div'));
hideMe($('rdetail_anotes_div'));
hideMe($('rdetail_excerpt_div'));
+ hideMe($('rdetail_preview_div'));
hideMe($('rdetail_marc_div'));
hideMe($('cn_browse'));
hideMe($('rdetail_cn_browse_div'));
@@ -359,6 +360,7 @@
removeCSSClass($('rdetail_reviews_link'), 'rdetail_extras_selected');
removeCSSClass($('rdetail_toc_link'), 'rdetail_extras_selected');
removeCSSClass($('rdetail_excerpt_link'), 'rdetail_extras_selected');
+ removeCSSClass($('rdetail_preview_link'), 'rdetail_extras_selected');
removeCSSClass($('rdetail_anotes_link'), 'rdetail_extras_selected');
removeCSSClass($('rdetail_annotation_link'), 'rdetail_extras_selected');
removeCSSClass($('rdetail_viewmarc_link'), 'rdetail_extras_selected');
@@ -375,10 +377,14 @@
unHideMe($('rdetail_reviews_div'));
break;
-
case "excerpt":
addCSSClass($('rdetail_excerpt_link'), 'rdetail_extras_selected');
unHideMe($('rdetail_excerpt_div'));
+ break;
+
+ case "preview":
+ addCSSClass($('rdetail_preview_link'), 'rdetail_extras_selected');
+ unHideMe($('rdetail_preview_div'));
rdetailDisplayPreview();
break;
@@ -811,10 +817,11 @@
function rdetailCheckForPreview() {
+ if (!googleBookPreview) return;
var p = document.createElement('p');
p.appendChild( document.createTextNode('Loading... ' ) );
p.id = 'loading';
- $('rdetail_excerpt_div').appendChild(p);
+ $('rdetail_preview_div').appendChild(p);
searchForPreview( cleanISBN(record.isbn()) );
}
@@ -853,7 +860,7 @@
*/
function previewCallback(bookInfo) {
// Clear any old data to prepare to display the Loading... message.
- var div = document.getElementById("rdetail_excerpt_div");
+ var div = document.getElementById("rdetail_preview_div");
var book;
for ( i in bookInfo ) {
@@ -866,8 +873,8 @@
if ( book.preview != "noview" ) {
if ( book.preview == 'full' ) {
- setText( $('rdetail_excerpt_link_a'), 'Full Text' );
- $('rdetail_excerpt_link_a').title = 'See the full text of this book.';
+ setText( $('rdetail_preview_link'), 'Full Text' );
+ $('rdetail_preview_link_a').title = 'See the full text of this book.';
}
// Add a button below the book cover image to load the preview.
@@ -876,12 +883,12 @@
badge.title = 'Show a preview of this book from Google Book Search';
badge.style.border = 0;
badgelink = document.createElement( 'a' );
- badgelink.href = 'javascript:rdetailShowExtra("excerpt");';
+ badgelink.href = 'javascript:rdetailShowExtra("preview");';
badgelink.appendChild( badge );
$('rdetail_image_cell').appendChild( badgelink );
- unHideMe( $('rdetail_excerpt_link' ) );
- $('rdetail_excerpt_div').style.height = 600;
+ unHideMe( $('rdetail_preview_link' ) );
+ $('rdetail_preview_div').style.height = 600;
}
}
@@ -890,16 +897,16 @@
* a preview is available from Google if this link was made visible.
*/
function rdetailDisplayPreview() {
- previewPane = $('rdetail_excerpt_div');
- if ( $('rdetail_excerpt_div').getAttribute('loaded') == null || $('rdetail_excerpt_div').getAttribute('loaded') == "false" ) {
+ previewPane = $('rdetail_preview_div');
+ if ( $('rdetail_preview_div').getAttribute('loaded') == null || $('rdetail_preview_div').getAttribute('loaded') == "false" ) {
google.load("books", "0", {"callback" : rdetailViewerLoadCallback, "language": "hy"} );
- $('rdetail_excerpt_div').setAttribute('loaded', 'true');
+ $('rdetail_preview_div').setAttribute('loaded', 'true');
}
}
function rdetailViewerLoadCallback() {
- var viewer = new google.books.DefaultViewer(document.getElementById('rdetail_excerpt_div'));
+ var viewer = new google.books.DefaultViewer(document.getElementById('rdetail_preview_div'));
viewer.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-08 14:34:47 UTC (rev 12466)
+++ trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml 2009-03-08 15:10:28 UTC (rev 12467)
@@ -31,9 +31,15 @@
<td id='rdetail_excerpt_link' class='hide_me rdetail_extras_td'
style='padding-right: 15px; padding-left: 15px;' >
<a href='javascript:rdetailShowExtra("excerpt");'
- class='classic_link'>&rdetail.extras.excerpt;</a>
+ class='classic_link'>&rdetail.extras.preview;</a>
</td>
+ <td id='rdetail_preview_link' class='hide_me rdetail_extras_td'
+ style='padding-right: 15px; padding-left: 15px;' >
+ <a href='javascript:rdetailShowExtra("preview");'
+ class='classic_link'>&rdetail.extras.preview;</a>
+ </td>
+
<td id='rdetail_anotes_link' class='hide_me rdetail_extras_td'
style='padding-right: 15px; padding-left: 15px;' >
<a href='javascript:rdetailShowExtra("anotes");'
@@ -77,6 +83,8 @@
<div id='rdetail_excerpt_div' class='rdetail_extras_div hide_me'> </div>
+ <div id='rdetail_preview_div' class='rdetail_extras_div hide_me'> </div>
+
<div id='rdetail_anotes_div' class='rdetail_extras_div hide_me'> </div>
<div id='rdetail_marc_div' class='rdetail_extras_div hide_me'>
More information about the open-ils-commits
mailing list