[open-ils-commits] r7943 - in trunk/Open-ILS/web/opac: common/js
locale/en-US skin/default/css skin/default/js
skin/default/xml/rdetail
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Oct 29 11:28:26 EDT 2007
Author: erickson
Date: 2007-10-29 11:13:59 -0400 (Mon, 29 Oct 2007)
New Revision: 7943
Modified:
trunk/Open-ILS/web/opac/common/js/added_content.js
trunk/Open-ILS/web/opac/common/js/config.js
trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
trunk/Open-ILS/web/opac/skin/default/css/layout.css
trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_summary.xml
Log:
added ability to link back to a vendor product page from the record details page. this is useful for supplying cover art attribution. only currently supported options are null (no vendor links, default) and "amazon"
Modified: trunk/Open-ILS/web/opac/common/js/added_content.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/added_content.js 2007-10-29 15:09:21 UTC (rev 7942)
+++ trunk/Open-ILS/web/opac/common/js/added_content.js 2007-10-29 15:13:59 UTC (rev 7943)
@@ -1,9 +1,8 @@
/**
* This function should return a URL which points to the book cover image based on ISBN.
-* Ideally, this should point to some type of added content service.
-* The example below uses Amazon... *use at own risk*
*/
+
function buildISBNSrc(isbn, size) {
size = (size) ? size : 'small';
if(OILS_OPAC_IMAGES_HOST)
@@ -11,6 +10,14 @@
return '../../../../extras/ac/jacket/'+size+'/'+isbn;
}
+function buildVendorProductLink(isbn, vendor) {
+ vendor = (vendor) ? vendor : ADDED_CONTENT_VENDOR;
+ switch(vendor) {
+ case 'amazon':
+ return 'http://www.amazon.com/dp/' + isbn;
+ }
+ return '';
+}
function acMakeURL(type, key) {
Modified: trunk/Open-ILS/web/opac/common/js/config.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/config.js 2007-10-29 15:09:21 UTC (rev 7942)
+++ trunk/Open-ILS/web/opac/common/js/config.js 2007-10-29 15:13:59 UTC (rev 7943)
@@ -140,6 +140,15 @@
var PREF_DEF_DEPTH = 'opac.default_search_depth';
+/** global added content vendor setting. This setting is only needed/used
+ if your added content vendor requires links back to their site. If
+ set to null, no links will be constructed
+
+ Current options are: null and 'amazon'
+ */
+var ADDED_CONTENT_VENDOR=null;
+
+
/* container for global variables shared accross pages */
var G = {};
G.user = null; /* global user object */
Modified: trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/opac.dtd 2007-10-29 15:09:21 UTC (rev 7942)
+++ trunk/Open-ILS/web/opac/locale/en-US/opac.dtd 2007-10-29 15:13:59 UTC (rev 7943)
@@ -620,3 +620,6 @@
<!ENTITY slimpac.advanced.language "Item Language">
<!ENTITY slimpac.advanced.create_date "Record Creation Date">
<!ENTITY slimpac.advanced.edit_date "Record Edit Date">
+
+<!ENTITY opac.image_provided "Image provided by">
+<!ENTITY vendor.amazon "Amazon">
Modified: trunk/Open-ILS/web/opac/skin/default/css/layout.css
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/css/layout.css 2007-10-29 15:09:21 UTC (rev 7942)
+++ trunk/Open-ILS/web/opac/skin/default/css/layout.css 2007-10-29 15:13:59 UTC (rev 7943)
@@ -206,3 +206,8 @@
.invalid_hold { background: #F0F0D0; }
.myopac_summary_table td { padding : 3px; }
+
+.jacket_attrib { font-size: 7pt; }
+
+
+
Modified: trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2007-10-29 15:09:21 UTC (rev 7942)
+++ trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2007-10-29 15:13:59 UTC (rev 7943)
@@ -191,7 +191,15 @@
}
G.ui.rdetail.abstr.appendChild(text(record.synopsis()));
+ try{
+ if(ADDED_CONTENT_VENDOR) {
+ unHideMe($('rdetail.jacket_attrib_div'));
+ $('rdetail.jacket_attrib_link').setAttribute(
+ 'href', buildVendorProductLink(cleanISBN(record.isbn())));
+ }
+ } catch(E) {}
+
// see if the record has any external links
var links = record.online_loc();
for( var i = 0; links && links.length > 0 && i < links.length; i++ ) {
@@ -206,7 +214,6 @@
}
-
$('rdetail_place_hold').setAttribute(
'href','javascript:holdsDrawEditor({record:"'+record.doc_id()+'",type:"T"});');
Modified: trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_summary.xml
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_summary.xml 2007-10-29 15:09:21 UTC (rev 7942)
+++ trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_summary.xml 2007-10-29 15:13:59 UTC (rev 7943)
@@ -4,13 +4,19 @@
<table id='rdetail_details_table'>
<tbody id='rdetail_details_tbody'>
-
-
<tr>
<td id='rdetail_image_cell' rowspan='10'>
<a id='rdetail_img_link'>
- <img style='border: none;' id='rdetail_image'> </img>
+ <img style='border: none;' id='rdetail_image'
+ onerror='
+ hideMe($("rdetail.jacket_attrib_div"));
+ hideMe($("rdetail_img_link"));'/>
</a>
+ <!-- vendor attribution link -->
+ <div class='jacket_attrib hide_me' id='rdetail.jacket_attrib_div'>
+ <div>&opac.image_provided;</div>
+ <div><a class='classic_link' id='rdetail.jacket_attrib_link'>&vendor.amazon;</a></div>
+ </div>
</td>
<td nowrap='nowrap' class='rdetail_desc'>&common.title;</td>
<td class='rdetail_item' id='rdetail_title'> </td>
More information about the open-ils-commits
mailing list