[open-ils-commits] r16770 - in trunk/Open-ILS/web/opac/skin/default: js xml xml/rdetail xml/result (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Jun 21 16:42:05 EDT 2010
Author: phasefx
Date: 2010-06-21 16:41:59 -0400 (Mon, 21 Jun 2010)
New Revision: 16770
Added:
trunk/Open-ILS/web/opac/skin/default/xml/chilifresh.xml
Modified:
trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
trunk/Open-ILS/web/opac/skin/default/js/result_common.js
trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml
trunk/Open-ILS/web/opac/skin/default/xml/result/result_table.xml
Log:
rough cut at integrating ChiliFresh reviews with OPAC search results and record details page. Needs polish
Modified: trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2010-06-21 20:35:57 UTC (rev 16769)
+++ trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2010-06-21 20:41:59 UTC (rev 16770)
@@ -470,6 +470,16 @@
// grab added content
acCollectData(cleanISBN(record.isbn()), rdetailhandleAC);
+
+ // different type of added content
+ var currentISBN = cleanISBN(record.isbn());
+ if (chilifresh && currentISBN) {
+ $('chilifreshReviewLink').setAttribute('id','isbn_'+currentISBN);
+ $('chilifreshReviewResult').setAttribute('id','chili_review_'+currentISBN);
+ unHideMe($('rdetail_reviews_link'));
+ unHideMe($('rdetail_chilifresh_reviews'));
+ chili_init();
+ }
}
Modified: trunk/Open-ILS/web/opac/skin/default/js/result_common.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/result_common.js 2010-06-21 20:35:57 UTC (rev 16769)
+++ trunk/Open-ILS/web/opac/skin/default/js/result_common.js 2010-06-21 20:41:59 UTC (rev 16770)
@@ -15,7 +15,7 @@
G.evt.result.copyCountsReceived.push(resultDisplayCopyCounts);
G.evt.result.allRecordsReceived.push(resultBuildCaches, resultDrawSubjects,
resultDrawAuthors, resultDrawSeries, function(){unHideMe($('result_info_2'))},
- fetchGoogleBooksLink);
+ fetchGoogleBooksLink,fetchChiliFreshReviews);
attachEvt('result','lowHits',resultLowHits);
attachEvt('result','zeroHits',resultZeroHits);
@@ -453,6 +453,27 @@
}
}
+ if (currentISBN && chilifresh) {
+ var cfrow = $n(r, "chilifreshReview");
+ if (cfrow) {
+ removeCSSClass( cfrow, 'hide_me' );
+ }
+ var cflink = $n(r, "chilifreshReviewLink");
+ if (cflink) {
+ cflink.setAttribute(
+ 'id',
+ 'isbn_' + currentISBN
+ );
+ }
+ var cfdiv = $n(r, "chilifreshReviewResult");
+ if (cfdiv) {
+ cfdiv.setAttribute(
+ 'id',
+ 'chili_review_' + currentISBN
+ )
+ }
+ }
+
/*
try {
var rank = parseFloat(ranks[pos + getOffset()]);
@@ -650,6 +671,12 @@
}
}
+function fetchChiliFreshReviews() {
+ if (chilifresh) {
+ chili_init();
+ }
+}
+
function resultPageIsDone(pos) {
return (recordsHandled == getDisplayCount()
Added: trunk/Open-ILS/web/opac/skin/default/xml/chilifresh.xml
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/xml/chilifresh.xml (rev 0)
+++ trunk/Open-ILS/web/opac/skin/default/xml/chilifresh.xml 2010-06-21 20:41:59 UTC (rev 16770)
@@ -0,0 +1,6 @@
+<!-- Specify your ChiliFresh account # below to enable ChiliFresh integration with the OPAC -->
+
+<!--#set var='OILS_CHILIFRESH_ACCOUNT' value=""-->
+<!--#set var='OILS_CHILIFRESH_PROFILE' value=""-->
+<!--#set var='OILS_CHILIFRESH_URL' value="http://chilifresh.com/on-site/js/evergreen.js"-->
+
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 2010-06-21 20:35:57 UTC (rev 16769)
+++ trunk/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml 2010-06-21 20:41:59 UTC (rev 16770)
@@ -77,6 +77,10 @@
<div name='review_text' style='width: 100%; padding: 15px; border: 1px solid #E0E0E0;'> </div>
</div>
-->
+ <div id='rdetail_chilifresh_reviews' class='hide_me'>
+ <div id='chilifreshReviewLink' name='chilifreshReviewLink' class='chili_review'></div>
+ <div id='chilifreshReviewResult' name='chilifreshReviewResult' style='display:none'></div>
+ </div>
</div>
<div id='rdetail_toc_div' class='rdetail_extras_div hide_me'> </div>
@@ -114,4 +118,20 @@
<div id='rdetail_preview_full_text' class='hide_me'>&rdetail.extras.preview.fulltext;</div>
<div id='rdetail_preview_title' class='hide_me'>&rdetail.extras.preview.title;</div>
<div id='rdetail_preview_badge' class='hide_me'>&rdetail.extras.preview.badge;</div>
+
+ <!-- ChiliFresh setup -->
+ <!--#include virtual="../chilifresh.xml"-->
+ <script language='javascript' type='text/javascript'>
+ var chilifresh = '<!--#echo var="OILS_CHILIFRESH_ACCOUNT"-->';
+ </script>
+ <!--if expr="$OILS_CHILIFRESH_ACCOUNT"-->
+ <input type="hidden" id="chilifresh_account" name="chilifresh_account"
+ value="<!--#echo var='OILS_CHILIFRESH_ACCOUNT'-->" />
+ <input type="hidden" id="chilifresh_profile" name="chilifresh_profile"
+ value="<!--#echo var='OILS_CHILIFRESH_PROFILE'-->" />
+ <input type="hidden" id="chilifresh_version" name="chilifresh_version" value="onsite_v1" />
+ <input type="hidden" id="chilifresh_type" name="chilifresh_type" value="search" />
+ <script language="javascript" type="text/javascript" src="<!--#echo var='OILS_CHILIFRESH_URL'-->"></script>
+ <!--endif-->
+
</div>
Modified: trunk/Open-ILS/web/opac/skin/default/xml/result/result_table.xml
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/xml/result/result_table.xml 2010-06-21 20:35:57 UTC (rev 16769)
+++ trunk/Open-ILS/web/opac/skin/default/xml/result/result_table.xml 2010-06-21 20:41:59 UTC (rev 16770)
@@ -134,11 +134,12 @@
<a style='padding-left: 8px;' class='classic_link' name="googleBooks-link">&result.googleBooks.browse;</a>
</span>
-
+ <!-- Placeholder for ChilFresh Review link -->
+ <span name="chilifreshReviewLink" class="chili_review"></span>
</td>
</tr>
<tr name="local_callnumber_list" class="result_table_title_cell hide_me">
- <td>&result.localCallNumbers;
+ <td colspan="2">&result.localCallNumbers;
<span type='opac/slot-data+holdings_xml' query='volumes volume' join=", ">
<!-- Because we clone this template table, and IE won't clone <script>
nodes (yes, even when it doesn't understand the type ARG) we need
@@ -147,7 +148,13 @@
</span>
</td>
</tr>
-
+ <!-- Placeholder for ChiliFresh Review -->
+ <tr class="hide_me" name="chilifreshReview">
+ <td></td>
+ <td valign="top">
+ <div name="chilifreshReviewResult" style="display:none"></div>
+ </td>
+ </tr>
</tbody>
</table>
</td>
@@ -214,6 +221,20 @@
config.names.result.format_pic = 'format_pic'
</script>
+ <!-- ChiliFresh setup -->
+ <!--#include virtual="../chilifresh.xml"-->
+ <script language='javascript' type='text/javascript'>
+ var chilifresh = '<!--#echo var="OILS_CHILIFRESH_ACCOUNT"-->';
+ </script>
+ <!--if expr="$OILS_CHILIFRESH_ACCOUNT"-->
+ <input type="hidden" id="chilifresh_account" name="chilifresh_account"
+ value="<!--#echo var='OILS_CHILIFRESH_ACCOUNT'-->" />
+ <input type="hidden" id="chilifresh_profile" name="chilifresh_profile"
+ value="<!--#echo var='OILS_CHILIFRESH_PROFILE'-->" />
+ <input type="hidden" id="chilifresh_version" name="chilifresh_version" value="onsite_v1" />
+ <input type="hidden" id="chilifresh_type" name="chilifresh_type" value="search" />
+ <script language="javascript" type="text/javascript" src="<!--#echo var='OILS_CHILIFRESH_URL'-->"></script>
+ <!--endif-->
</div>
More information about the open-ils-commits
mailing list