Permalink
Browse files

Fixed display bug when item was only available in print

  • Loading branch information...
1 parent 6036a9d commit b708112bbf98e1448e079dba134b03c3f535b2a8 @mreidsma mreidsma committed Feb 21, 2012
Showing with 42 additions and 33 deletions.
  1. +41 −32 360link-reset.2.0.js
  2. +1 −1 360link-reset.2.0.min.js
View
@@ -13,12 +13,13 @@ var journalLinksdata = "";
var dateRangedata = "";
var DatabaseNamedata = "";
var DatabaseLinkdata = "";
+var clicks = 0;
var refinerlink = jQuery("#RefinerLink0 a").attr("href");
// The following are special links created by Serials Solutions for us. These can guide you in adding your own
-// var illiadLink = jQuery("table.CandyWrapper:last a.AnchorButton:contains('Document Delivery')").attr("href");
-// var refworksLink = jQuery("table.CandyWrapper:last a.AnchorButton:last").attr("href");
-// var melLink = jQuery("table.CandyWrapper:last a.AnchorButton:contains('MeLCat')").attr("href"); // Currently not used, but we *could* use it
+var illiadLink = jQuery("table.CandyWrapper:last a.AnchorButton:contains('Document Delivery')").attr("href");
+var refworksLink = jQuery("table.CandyWrapper:last a.AnchorButton:last").attr("href");
+var melLink = jQuery("table.CandyWrapper:last a.AnchorButton:contains('MeLCat')").attr("href"); // Currently not used, but we *could* use it
// Build the citation
@@ -50,14 +51,12 @@ if (format === "Journal" || format === "JournalFormat") {
// Ok, let's get rid of that table and replace it with a semantic div for our citation
- var citationDiv = '<span id="CitationJournalAuthorValue">' + authorName + '</span>&nbsp; <span id="CitationJournalDateValue">(' + journalDate + ')</span>.&nbsp; <span id="CitationJournalArticleValue">' + articleName + '.</span>&nbsp; <span id="CitationJournalTitleValue">' + journalName + '.</span>&nbsp;' + journalissn + journalVol + journalIssue + journalPages;
+ var citationDiv = '<span id="CitationJournalAuthorValue">' + authorName + '</span>&nbsp; <span id="CitationJournalDateValue">(' + journalDate + ')</span>.&nbsp; <span id="CitationJournalArticleValue">' + articleName + '.</span>&nbsp; <span id="CitationJournalTitleValue">' + journalName + '.</span>&nbsp;' + journalVol + journalIssue + journalPages;
// Replace the final table with semantic HTML, along with the dynamic links
-
- var nextstepslink = "";
-
+
// Remove the line above and uncomment the line below to add items to the bottom of your link resolver
- // var nextstepsLink = '<li>Not Available Online? <a href="' + illiadLink + '">Order a copy from Document Delivery</a></li>';
+var nextstepsLink = '<li>Not Available Online? <a href="' + illiadLink + '">Order a copy from Document Delivery</a></li><li>Found a problem? <a href="mailto:erms@gvsu.edu">Let our crack team of link fixers know</a>!</li>';
}
@@ -79,11 +78,10 @@ if (format === "BookFormat") {
// Replace the final table with semantic HTML, along with the dynamic links
- var nextstepslink = "";
// Remove the line above and uncomment the line below to add items to the bottom of your link resolver
- // var bookTitleLink = encodeURI(bookTitle); // Encode the white space in the URL
- // var nextstepsLink = '<li><a href="http://library.catalog.gvsu.edu/search/t' + bookTitleLink + '">Search the GVSU Catalog for this book</a></li><li><a href="' + melLink + '">Order from another Michigan library</a></li><li>Not Available Online? <a href="' + illiadLink + '">Order a copy from Interlibrary Loan</a></li>';
+var bookTitleLink = encodeURI(bookTitle); // Encode the white space in the URL
+var nextstepsLink = '<li><a href="http://library.catalog.gvsu.edu/search/t' + bookTitleLink + '">Search the GVSU Catalog for this book</a></li><li><a href="' + melLink + '">Order from another Michigan library</a></li><li>Not Available Online? <a href="' + illiadLink + '">Order a copy from Interlibrary Loan</a></li><li>Found a problem? <a href="mailto:erms@gvsu.edu">Let our crack team of link fixers know</a>!</li>';
}
@@ -105,11 +103,10 @@ if (format === "UnknownFormat") {
// Replace the final table with semantic HTML, along with the dynamic links
- var nextstepslink = "";
// Remove the line above and uncomment the line below to add items to the bottom of your link resolver
- // var bookTitleLink = encodeURI(bookTitle); // Encode the white space in the URL
- // var nextstepsLink = '<li><a href="http://library.catalog.gvsu.edu/search/t' + bookTitleLink + '">Search the GVSU Catalog for this book</a></li><li>Not Available Online? <a href="' + illiadLink + '">Order a copy from Interlibrary Loan</a></li>';
+var bookTitleLink = encodeURI(bookTitle); // Encode the white space in the URL
+var nextstepsLink = '<li><a href="http://library.catalog.gvsu.edu/search/t' + bookTitleLink + '">Search the GVSU Catalog for this book</a></li><li>Not Available Online? <a href="' + illiadLink + '">Order a copy from Interlibrary Loan</a></li><li>Found a problem? <a href="mailto:erms@gvsu.edu">Let our crack team of link fixers know</a>!</li>';
}
@@ -183,13 +180,21 @@ var additionalLinksnum = results - 1; // Number of links in the additional resul
if((articleLinks[0] === "NA") && (journalLinks[0] !== "NA")) { // There was no article link, but there is a journal link
-// TK Check to see if top result is a print journal
+TopDatabaseName = jQuery.trim(DatabaseNames[0]);
+
+// Check to see if top result is a print journal
-var topResultdiv = '<ul id="top-result"><li><a href="' + journalLinks[0] + '" class="article-button">Browse the Journal Online</a> in <a href="' + DatabaseLinks[0] + '" class="SS_DatabaseHyperLink">' + jQuery.trim(DatabaseNames[0]) + '</a></li></ul>';
+if(TopDatabaseName === "Print at GVSU Libraries") {
-} else { // There is an article link
+var topResultdiv = '<ul id="top-result"><li><a href="' + journalLinks[0] + '" class="article-button" target="_blank">Find a Copy</a> in <a href="' + DatabaseLinks[0] + '" class="SS_DatabaseHyperLink">' + jQuery.trim(DatabaseNames[0]) + '</a></li></ul>';
+
+} else {
+
+var topResultdiv = '<ul id="top-result"><li><a href="' + journalLinks[0] + '" class="article-button" target="_blank">Browse the Journal Online</a> in <a href="' + DatabaseLinks[0] + '" class="SS_DatabaseHyperLink">' + jQuery.trim(DatabaseNames[0]) + '</a></li></ul>';
+
+}} else { // There is an article link
-var topResultdiv = '<ul id="top-result"><li><a href="' + articleLinks[0] + '" class="article-button">Full Text Online</a> from <a href="' + DatabaseLinks[0] + '" class="SS_DatabaseHyperLink">' + jQuery.trim(DatabaseNames[0]) + '</a> <a class="holding-details"><img src="http://gvsu.edu/icon/help.png" alt="" /></a><div class="tooltip"><p><a href="' + journalLinks[0] + '" style="text-decoration: none;">Browse Journal</a></p><p style="font-size: 1em;"><i>Dates covered:</i><br />' + dateRange[0] + '</p></div></li></ul>';
+var topResultdiv = '<ul id="top-result"><li><a href="' + articleLinks[0] + '" class="article-button" target="_blank">Full Text Online</a> from <a href="' + DatabaseLinks[0] + '" class="SS_DatabaseHyperLink">' + jQuery.trim(DatabaseNames[0]) + '</a> <a class="holding-details"><img src="http://gvsu.edu/icon/help.png" alt="" /></a><div class="tooltip"><p><a href="' + journalLinks[0] + '" style="text-decoration: none;">Browse Journal</a></p><p style="font-size: 1em;"><i>Dates covered:</i><br />' + dateRange[0] + '</p></div></li></ul>';
}
@@ -222,7 +227,7 @@ if(articleLinks[i] !== "NA") { // Article link - article has to be online
}
- onlineAdditionalResults = onlineAdditionalResults + '<li><a href="' + articleLinks[i] + '">Full Text Online</a> from <a href="' + DatabaseLinks[i] + '" class="SS_DatabaseHyperLink">' + DatabaseNames[i] + '</a><a class="holding-details"><img src="http://gvsu.edu/icon/help.png" alt="" /></a><div class="tooltip"><p><a href="' + journalLinks[i] + '" style="text-decoration: none;">Browse Journal</a></p><p style="font-size: 1em;"><i>Dates covered:</i><br />' + dateRange[i] + '</p></div></li>';
+ onlineAdditionalResults = onlineAdditionalResults + '<li><a href="' + articleLinks[i] + '" target="_blank">Full Text Online</a> from <a href="' + DatabaseLinks[i] + '" class="SS_DatabaseHyperLink">' + DatabaseNames[i] + '</a><a class="holding-details"><img src="http://gvsu.edu/icon/help.png" alt="" /></a><div class="tooltip"><p><a href="' + journalLinks[i] + '" style="text-decoration: none;">Browse Journal</a></p><p style="font-size: 1em;"><i>Dates covered:</i><br />' + dateRange[i] + '</p></div></li>';
} else { // No article link
@@ -238,7 +243,7 @@ if(articleLinks[i] !== "NA") { // Article link - article has to be online
}
- printAdditionalResults = printAdditionalResults + '<li><a href="' + journalLinks[i] + '">Available in Print</a> at the <abbr title="Grand Valley State University">GVSU</abbr> University Libraries</li>';
+ printAdditionalResults = printAdditionalResults + '<li><a href="' + journalLinks[i] + '" target="_blank">Available in Print</a> at the <abbr title="Grand Valley State University">GVSU</abbr> University Libraries</li>';
} else { // Item is online
@@ -248,7 +253,7 @@ if(articleLinks[i] !== "NA") { // Article link - article has to be online
}
- onlineAdditionalResults = onlineAdditionalResults + '<li><a href="' + journalLinks[i] + '">Browse the Journal Online</a> in <a href="' + DatabaseLinks[i] + '" class="SS_DatabaseHyperLink">' + DatabaseNames[i] + '</a><a class="holding-details"><img src="http://gvsu.edu/icon/help.png" alt="" /></a><div class="tooltip"><p style="font-size: 1em;"><i>Dates covered:</i><br />' + dateRange[i] + '</p></div></li>';
+ onlineAdditionalResults = onlineAdditionalResults + '<li><a href="' + journalLinks[i] + '" target="_blank">Browse the Journal Online</a> in <a href="' + DatabaseLinks[i] + '" class="SS_DatabaseHyperLink">' + DatabaseNames[i] + '</a><a class="holding-details"><img src="http://gvsu.edu/icon/help.png" alt="" /></a><div class="tooltip"><p style="font-size: 1em;"><i>Dates covered:</i><br />' + dateRange[i] + '</p></div></li>';
}
}
@@ -353,18 +358,22 @@ jQuery("#360link-reset").html('<div id="page-content" style="margin: 0; padding-
}
-jQuery(".event-body").hide(); // Hide additional results
+// Let's show a tooltip highlighting Document Delivery when the user has tried a few sources.
+// First, let's add the code for the tooltip:
-jQuery(".event-head").click(function() { // Show additional results when div is clicked and change text
- jQuery(".event-body").slideToggle(400);
- var current_text = jQuery(".event-head").text();
- if(current_text === "Hide Additional Results") {
- jQuery(".event-head").text('Show More Results');
- } else {
- jQuery(".event-head").text('Hide Additional Results');
- }
-});
+jQuery("#next-step ul").append('<li class="doc-del-tooltip">Having trouble? You can order a copy from Document Delivery, and they\'ll get it for you. It\'s free!<br /><a href="' + illiadLink + '" class="lib-db-access-button" style="font-size: 1.2em !important;">Order a Copy</a></li>');
+jQuery(".doc-del-tooltip").hide();
+
+// Now let's count clicks
-jQuery(".holding-details").tooltip({effect: 'slide',offset:[0,0]});
+jQuery("#360link-reset ul li a").click(function() {
+
+ clicks = clicks + 1;
+
+ if(clicks > 1) {
+ jQuery(".doc-del-tooltip").show();
+ }
+
+});
});
Oops, something went wrong.

0 comments on commit b708112

Please sign in to comment.