From 362bccb583f775aaf55111c16cfab2bf93994a0d Mon Sep 17 00:00:00 2001 From: phasefx Date: Mon, 21 Jun 2010 20:41:59 +0000 Subject: [PATCH] rough cut at integrating ChiliFresh reviews with OPAC search results and record details page. Needs polish git-svn-id: svn://svn.open-ils.org/ILS/trunk@16770 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/skin/default/js/rdetail.js | 10 +++++++ .../web/opac/skin/default/js/result_common.js | 29 ++++++++++++++++++- .../web/opac/skin/default/xml/chilifresh.xml | 6 ++++ .../default/xml/rdetail/rdetail_extras.xml | 20 +++++++++++++ .../skin/default/xml/result/result_table.xml | 27 +++++++++++++++-- 5 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 Open-ILS/web/opac/skin/default/xml/chilifresh.xml diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js index 8af53a51b1..7adfa0028f 100644 --- a/Open-ILS/web/opac/skin/default/js/rdetail.js +++ b/Open-ILS/web/opac/skin/default/js/rdetail.js @@ -470,6 +470,16 @@ function _rdetailDraw(r) { // 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(); + } } diff --git a/Open-ILS/web/opac/skin/default/js/result_common.js b/Open-ILS/web/opac/skin/default/js/result_common.js index c31f399392..743420a97f 100644 --- a/Open-ILS/web/opac/skin/default/js/result_common.js +++ b/Open-ILS/web/opac/skin/default/js/result_common.js @@ -15,7 +15,7 @@ if( findCurrentPage() == MRESULT || findCurrentPage() == RRESULT ) { 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 @@ function resultDisplayRecord(rec, pos, is_mr) { } } + 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 fetchGoogleBooksLink () { } } +function fetchChiliFreshReviews() { + if (chilifresh) { + chili_init(); + } +} + function resultPageIsDone(pos) { return (recordsHandled == getDisplayCount() diff --git a/Open-ILS/web/opac/skin/default/xml/chilifresh.xml b/Open-ILS/web/opac/skin/default/xml/chilifresh.xml new file mode 100644 index 0000000000..7cbc40ce52 --- /dev/null +++ b/Open-ILS/web/opac/skin/default/xml/chilifresh.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml b/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml index 96a8fdccdc..06a27b5e78 100644 --- a/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml +++ b/Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml @@ -77,6 +77,10 @@
--> +
+ + +
@@ -114,4 +118,20 @@
&rdetail.extras.preview.fulltext;
&rdetail.extras.preview.title;
&rdetail.extras.preview.badge;
+ + + + + + + + + + + + diff --git a/Open-ILS/web/opac/skin/default/xml/result/result_table.xml b/Open-ILS/web/opac/skin/default/xml/result/result_table.xml index 4c66817bb5..5e6d596b53 100644 --- a/Open-ILS/web/opac/skin/default/xml/result/result_table.xml +++ b/Open-ILS/web/opac/skin/default/xml/result/result_table.xml @@ -134,11 +134,12 @@ &result.googleBooks.browse; - + + - &result.localCallNumbers; + &result.localCallNumbers; + + + +
+ + @@ -214,6 +221,20 @@ config.names.result.format_pic = 'format_pic' + + + + + + + + + + -- 2.43.2