Permalink
Browse files

Fixed conditional to allow print materials links to be captured corre…

…ctly. (Borked after last commit)
  • Loading branch information...
1 parent dfc065b commit f54e9e804817cdb7e76b4a620ca5f598ddeb6541 @mreidsma mreidsma committed Oct 11, 2012
Showing with 29 additions and 9 deletions.
  1. +7 −7 360link-reset.2.0.js
  2. +22 −2 360link-reset.2.0.min.js
View
@@ -195,6 +195,8 @@ jQuery("table#JournalLinkTable").find("tr").each(function(index) { // Grab value
journalLinksdata = journalLinksdata + "NA|||";
+ console.log(journalLinksdata);
+
}
@@ -218,6 +220,7 @@ jQuery("table#JournalLinkTable").find("tr").each(function(index) { // Grab value
}
results = index; // Get total number of results
+ BookLinksdata = "NA|||";
});
if(results === "") {
@@ -231,7 +234,6 @@ jQuery("table#BookLinkTable").find("tr").each(function(index) { // Grab values f
var newHref = jQuery(this).find("#BookCL a").attr("href");
//console.log(BookLinksdata);
BookLinksdata = BookLinksdata + newHref + "|||";
- console.log(newHref);
} else { // No book link
@@ -263,24 +265,24 @@ jQuery("table#BookLinkTable").find("tr").each(function(index) { // Grab values f
});
}
- console.log(BookLinksdata);
// Bust apart arrays into variabls we can call
var articleLinks = articleLinksdata.split("|||");
var journalLinks = journalLinksdata.split("|||");
var BookLinks = BookLinksdata.split("|||");
- console.log(BookLinks[0]);
var dateRange = dateRangedata.split("|||");
var DatabaseNames = DatabaseNamedata.split("|||");
var DatabaseLinks = DatabaseLinkdata.split("|||");
var additionalLinksnum = results - 1; // Number of links in the additional results list
-if((articleLinks[0] === "NA") && (journalLinks[0] !== "NA") && (BookLinks[0] === "NA")) { // There was no article link, but there is a journal link
+if((articleLinks[0] === "NA") && (BookLinks[0] === "NA")) { // There was no article link, but there is a journal link
TopDatabaseName = jQuery.trim(DatabaseNames[0]);
+ console.log('Journal:' + journalLinks[0]);
+
// Check to see if top result is a print journal
@@ -294,17 +296,15 @@ var topResultdiv = '<ul id="top-result"><li><a href="' + journalLinks[0] + '" cl
}} else {
- console.log(articleLinks[0]);
+ console.log('Article:' + articleLinks[0]);
if((BookLinks[0] !== "NA") && (BookLinksdata !== "")) { // Book Link
-console.log(BookLinks[0]);
var topResultdiv = '<ul id="top-result"><li><a href="' + BookLinks[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>';
} else { // Article link
-console.log(BookLinks[0]);
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>';
}
Oops, something went wrong. Retry.

0 comments on commit f54e9e8

Please sign in to comment.