correct the logic for detecting whether ChiliFresh has been configured, and add simil...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 23 Jun 2010 18:09:13 +0000 (18:09 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 23 Jun 2010 18:09:13 +0000 (18:09 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16791 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/apache/eg_vhost.conf
Open-ILS/web/opac/locale/en-US/opac.dtd
Open-ILS/web/opac/skin/default/js/rdetail.js
Open-ILS/web/opac/skin/default/js/result_common.js
Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml
Open-ILS/web/opac/skin/default/xml/result/result_table.xml
Open-ILS/web/opac/theme/default/css/colors.css

index b8b7bc1..1f3c6b8 100644 (file)
@@ -102,6 +102,10 @@ RewriteRule - - [E=locale:%1] [L]
     #SetEnv OILS_CHILIFRESH_ACCOUNT
     #SetEnv OILS_CHILIFRESH_PROFILE
     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
+
+    # Specify the initial script URL for Novelist (containing account credentials, etc.)
+    #SetEnv OILS_NOVELIST_URL
+
 </LocationMatch>
 
 
index 959c4b5..5751373 100644 (file)
@@ -549,6 +549,7 @@ We recommend that you remove this title from any bookbags it may have been added
 <!ENTITY rdetail.extras.preview.fulltext "Full text">
 <!ENTITY rdetail.extras.preview.title "See the full text of this book.">
 <!ENTITY rdetail.extras.preview.badge "Show a preview of this book from Google Book Search">
+<!ENTITY rdetail.extras.novelist "Suggestions by Novelist">
 <!ENTITY rdetail.loading "Loading copy information...">
 <!ENTITY rdetail.noneAvailable " * There are no copies in this location">
 <!ENTITY rdetail.summary.online "Online Resources">
index 7adfa00..8dee437 100644 (file)
@@ -469,16 +469,32 @@ function _rdetailDraw(r) {
        resultDrawSeries();
 
        // grab added content 
+
+    // Proxied through Evergreen AddedContent module
        acCollectData(cleanISBN(record.isbn()), rdetailhandleAC);
 
-    // different type of added content
     var currentISBN = cleanISBN(record.isbn());
-    if (chilifresh && currentISBN) {
+
+    // Not proxied, cross-site javascript
+
+    // ChiliFresh
+    if (chilifresh && chilifresh != '(none)' && currentISBN) {
         $('chilifreshReviewLink').setAttribute('id','isbn_'+currentISBN);
         $('chilifreshReviewResult').setAttribute('id','chili_review_'+currentISBN);
         unHideMe($('rdetail_reviews_link'));
         unHideMe($('rdetail_chilifresh_reviews'));
-        chili_init();
+        try {
+            chili_init();
+        } catch(E) {
+            dump(E + '\n');
+            hideMe($('rdetail_reviews_link'));
+            hideMe($('rdetail_chilifresh_reviews'));
+        }
+    }
+
+    // Novelist
+    if (novelist && currentISBN) {
+        unHideMe($('rdetail_novelist_link'));
     }
 }
 
@@ -560,6 +576,7 @@ function rdetailShowExtra(type, args) {
        hideMe($('rdetail_marc_div'));
        hideMe($('cn_browse'));
        hideMe($('rdetail_cn_browse_div'));
+       hideMe($('rdetail_novelist_div'));
        hideMe($('rdetail_notes_div'));
 
        removeCSSClass($('rdetail_copy_info_link'), 'rdetail_extras_selected');
@@ -571,6 +588,7 @@ function rdetailShowExtra(type, args) {
        removeCSSClass($('rdetail_anotes_link'), 'rdetail_extras_selected');
        removeCSSClass($('rdetail_annotation_link'), 'rdetail_extras_selected');
        removeCSSClass($('rdetail_viewmarc_link'), 'rdetail_extras_selected');
+       removeCSSClass($('rdetail_novelist_link'), 'rdetail_extras_selected');
 
        switch(type) {
 
@@ -616,6 +634,11 @@ function rdetailShowExtra(type, args) {
                        req.send();
                        break;
 
+               case "novelist": 
+                       addCSSClass($('rdetail_novelist_link'), 'rdetail_extras_selected');
+                       unHideMe($('rdetail_novelist_div')); 
+                       break;
+
                case 'cn':
                        addCSSClass($('rdetail_viewcn_link'), 'rdetail_extras_selected');
                        unHideMe($('rdetail_cn_browse_div'));
index 743420a..1ae9074 100644 (file)
@@ -453,7 +453,7 @@ function resultDisplayRecord(rec, pos, is_mr) {
         }
     }
 
-    if (currentISBN && chilifresh) {
+    if (currentISBN && chilifresh && chilifresh != '(none)') {
         var cfrow = $n(r, "chilifreshReview");
         if (cfrow) {
             removeCSSClass( cfrow, 'hide_me' );
@@ -672,8 +672,8 @@ function fetchGoogleBooksLink () {
 }
 
 function fetchChiliFreshReviews() {
-    if (chilifresh) {
-        chili_init();
+    if (chilifresh && chilifresh != '(none)') {
+        try { chili_init(); } catch(E) { dump(E + '\n'); }
     }
 }
 
index 9842985..1913c69 100644 (file)
@@ -46,7 +46,6 @@
                                                class='classic_link'>&rdetail.extras.author.notes;</a>
                                </td>
 
-
                                <td id='rdetail_annotation_link' class='hide_me rdetail_extras_td'
                                        style='padding-right: 15px; padding-left: 15px;' >
                                        <a href='javascript:rdetailShowExtra("annotation");' 
                                                class='classic_link'>&rdetail.extras.marc;</a>
                                </td>
 
+                               <td id='rdetail_novelist_link' class='hide_me rdetail_extras_td'
+                                       style='padding-right: 15px; padding-left: 15px;' >
+                                       <a href='javascript:rdetailShowExtra("novelist");' 
+                                               class='classic_link'>&rdetail.extras.novelist;</a>
+                               </td>
 
                        </tr>
                </thead>
                        <div id='rdetail_view_marc_box'> </div>
                </div>
 
+        <div id='rdetail_novelist_div' class='rdetail_extras_div hide_me'>
+            <div id="NoveListSelect" class="NoveListSelect">
+                <div id="NoveListAnchor" class="NoveListSelect"></div>
+                <div id="novsuggestions"></div>
+                <div id="nextreads"></div>
+                <div id="novrelatedauthors"></div>
+               <div id="novrelateditems"></div>
+            </div>
+        </div>
+
                <div id='rdetail_cn_browse_div' style='text-align: center;' class='hide_me'>
 
                        <div id='cn_browse_none' class='hide_me color_4' style='width: 90%; text-align: center; margin: 10px;'>
     <!-- ChiliFresh setup -->
     <script language='javascript' type='text/javascript'>
         var chilifresh = '<!--#echo var="OILS_CHILIFRESH_ACCOUNT"-->';
+        if (chilifresh == '(none)') { chilifresh = false; }
     </script>
-    <!--if expr="$OILS_CHILIFRESH_ACCOUNT"-->
+    <!--if expr="${OILS_CHILIFRESH_ACCOUNT} && ${OILS_CHILIFRESH_ACCOUNT}!='(none)'"-->
         <input type="hidden" id="chilifresh_account" name="chilifresh_account"
             value="<!--#echo var='OILS_CHILIFRESH_ACCOUNT'-->" />
         <input type="hidden" id="chilifresh_profile" name="chilifresh_profile"
         <script language="javascript" type="text/javascript" src="<!--#echo var='OILS_CHILIFRESH_URL'-->"></script>
     <!--endif-->
 
+    <!-- Novelist setup -->
+    <!--if expr="${OILS_NOVELIST_URL} && ${OILS_NOVELIST_URL}!='(none)'"-->
+        <script type="text/javascript" id="EIT" src="<!--#echo var='OILS_NOVELIST_URL'-->"></script>
+    <!--endif-->
+    <script language='javascript' type='text/javascript'>
+        var novelist = '<!--#echo var="OILS_NOVELIST_URL"-->';
+        if (novelist == '(none)') { novelist = false; }
+    </script>
+
 </div>
index b34f4d3..46edda8 100644 (file)
     <!-- ChiliFresh setup -->
     <script language='javascript' type='text/javascript'>
         var chilifresh = '<!--#echo var="OILS_CHILIFRESH_ACCOUNT"-->';
+        if (chilifresh=='(none)') { chilifresh = false; }
     </script>
-    <!--if expr="$OILS_CHILIFRESH_ACCOUNT"-->
+    <!--if expr="${OILS_CHILIFRESH_ACCOUNT} && ${OILS_CHILIFRESH_ACCOUNT}!='(none)'"-->
         <input type="hidden" id="chilifresh_account" name="chilifresh_account"
             value="<!--#echo var='OILS_CHILIFRESH_ACCOUNT'-->" />
         <input type="hidden" id="chilifresh_profile" name="chilifresh_profile"
index fe25047..0412887 100644 (file)
@@ -1,6 +1,8 @@
 body a                 { color: black; text-decoration: none;}
 body a:visited { color: black; text-decoration: none;}
 body a:hover   { color: red; text-decoration: underline;}
+.NoveListSelect a                      { color: blue; text-decoration: underline;}
+.NoveListSelect a:visited      { color: purple; text-decoration: underline;}
 
 
 /* the idea is to have 4 complimentary colors that