added ability to link back to a vendor product page from the record details page...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 29 Oct 2007 15:13:59 +0000 (15:13 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 29 Oct 2007 15:13:59 +0000 (15:13 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@7943 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/common/js/added_content.js
Open-ILS/web/opac/common/js/config.js
Open-ILS/web/opac/locale/en-US/opac.dtd
Open-ILS/web/opac/skin/default/css/layout.css
Open-ILS/web/opac/skin/default/js/rdetail.js
Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_summary.xml

index 4f97433..1fb9cfc 100644 (file)
@@ -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 @@ function buildISBNSrc(isbn, size) {
        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) {
index 87c6ab6..a8a5af2 100644 (file)
@@ -140,6 +140,15 @@ var PREF_DEF_LOCATION = 'opac.default_search_location';
 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 */
index 0ad7241..7202092 100644 (file)
@@ -620,3 +620,6 @@ Ensure Caps-Lock is off and try again or contact your local library.">
 <!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">
index 33cbce6..978fffc 100644 (file)
@@ -206,3 +206,8 @@ table { border-collapse: collapse; }
 
 .invalid_hold { background: #F0F0D0; }
 .myopac_summary_table td { padding : 3px; }
+
+.jacket_attrib { font-size: 7pt; }
+
+
+
index 8cc6c53..95b2422 100644 (file)
@@ -191,6 +191,14 @@ function _rdetailDraw(r) {
     }
        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();
@@ -206,7 +214,6 @@ function _rdetailDraw(r) {
        }
 
 
-
        $('rdetail_place_hold').setAttribute(
                'href','javascript:holdsDrawEditor({record:"'+record.doc_id()+'",type:"T"});');
 
index c0eb675..9d92a03 100644 (file)
@@ -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>