added content url is now encoded in the DTD for easier localization. JS config is...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 29 Oct 2007 20:00:01 +0000 (20:00 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 29 Oct 2007 20:00:01 +0000 (20:00 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@7944 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/js/rdetail.js
Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_summary.xml

index 1fb9cfc..850858d 100644 (file)
@@ -10,15 +10,6 @@ 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) {
        return '../../../../extras/ac/' + type + '/html/' + key;
index a8a5af2..2243997 100644 (file)
@@ -140,13 +140,11 @@ 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'
+/** If enabled, added content attribution links will be 
+    made visible where appropriate.  The added content vendor name 
+    and URL are defined in the entities in opac.dtd
     */
-var ADDED_CONTENT_VENDOR=null; 
+var ENABLE_ADDED_CONTENT_ATTRIB_LINKS = false;
 
 
 /* container for global variables shared accross pages */
index 7202092..a8b7f84 100644 (file)
@@ -622,4 +622,5 @@ Ensure Caps-Lock is off and try again or contact your local library.">
 <!ENTITY slimpac.advanced.edit_date "Record Edit Date">
 
 <!ENTITY opac.image_provided "Image provided by">
-<!ENTITY vendor.amazon "Amazon">
+<!ENTITY vendor.name "Amazon">
+<!ENTITY vendor.base_link "http://amazon.com/dp/">
index 95b2422..356a69c 100644 (file)
@@ -192,10 +192,10 @@ function _rdetailDraw(r) {
        G.ui.rdetail.abstr.appendChild(text(record.synopsis()));
 
     try{
-        if(ADDED_CONTENT_VENDOR) {
+        if(ENABLE_ADDED_CONTENT_ATTRIB_LINKS) {
             unHideMe($('rdetail.jacket_attrib_div'));
-            $('rdetail.jacket_attrib_link').setAttribute(
-                'href', buildVendorProductLink(cleanISBN(record.isbn())));
+            var href = $('rdetail.jacket_attrib_link').getAttribute('href') +cleanISBN(record.isbn());
+            $('rdetail.jacket_attrib_link').setAttribute('href', href);
         }
     } catch(E) {}
 
index 9d92a03..42af1fc 100644 (file)
@@ -15,7 +15,8 @@
                     <!-- 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><a target='_blank' href='&vendor.base_link;' 
+                            class='classic_link' id='rdetail.jacket_attrib_link'>&vendor.name;</a></div>
                     </div>
                                </td>
                                <td nowrap='nowrap' class='rdetail_desc'>&common.title;</td>