[open-ils-commits] r7944 - in trunk/Open-ILS/web/opac: common/js
locale/en-US skin/default/js skin/default/xml/rdetail
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Oct 29 16:14:29 EDT 2007
Author: erickson
Date: 2007-10-29 16:00:01 -0400 (Mon, 29 Oct 2007)
New Revision: 7944
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/js/rdetail.js
trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_summary.xml
Log:
added content url is now encoded in the DTD for easier localization. JS config is now just an on/off switch
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:13:59 UTC (rev 7943)
+++ trunk/Open-ILS/web/opac/common/js/added_content.js 2007-10-29 20:00:01 UTC (rev 7944)
@@ -10,16 +10,7 @@
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;
}
Modified: trunk/Open-ILS/web/opac/common/js/config.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/config.js 2007-10-29 15:13:59 UTC (rev 7943)
+++ trunk/Open-ILS/web/opac/common/js/config.js 2007-10-29 20:00:01 UTC (rev 7944)
@@ -140,13 +140,11 @@
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 */
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:13:59 UTC (rev 7943)
+++ trunk/Open-ILS/web/opac/locale/en-US/opac.dtd 2007-10-29 20:00:01 UTC (rev 7944)
@@ -622,4 +622,5 @@
<!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/">
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:13:59 UTC (rev 7943)
+++ trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2007-10-29 20:00:01 UTC (rev 7944)
@@ -192,10 +192,10 @@
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) {}
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:13:59 UTC (rev 7943)
+++ trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_summary.xml 2007-10-29 20:00:01 UTC (rev 7944)
@@ -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>
More information about the open-ils-commits
mailing list