Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed OpenURL sid field to pull value from the link resolver rfr_id f…
…ield
  • Loading branch information
Matthew Reidsma authored and Matthew Reidsma committed Mar 31, 2014
1 parent 479915f commit 728b1b2
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion 360link-reset.js
Expand Up @@ -62,6 +62,21 @@ $j(document).ready(function() { // Wait until the original page loads
// Remove existing styles
$j("head").find("link").remove();

// Function to grab items from the URL

function getQueryVariable(v) {
var sidquery = window.location.search.substring(1);
var vars = query.split('&');
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
if (decodeURIComponent(pair[0]) == v) {
return decodeURIComponent(pair[1]);
console.log(pair[1]);
}
}
console.log('Query variable %s not found', v);
}

// Define common variables
var problemUrl=encodeURIComponent(document.URL),authorFirst=$j(".given-name").text().trim(),authorLast=$j(".family-name").text().trim(),results="",articleLinkdata=new Array(),journalLinkdata=new Array(),BookLinkdata=new Array(),dateRangedata=new Array(),DatabaseNamedata=new Array(),DatabaseLinkdata=new Array(),clicks=0,refinerlink=$j("#RefinerLink0").find("a").attr("href"),hasPrint=false,newHref,i=0,illLabel='Order a copy from Interlibrary Loan',searchLabel='Search the Library Catalog for this ',query = document.location.search,authorName = authorLast + ', ' + authorFirst;

Expand All @@ -83,7 +98,7 @@ $j(document).ready(function() { // Wait until the original page loads
}

// Build OpenURL for document delivery
var OpenUrl = 'sid=info%3Asid=&genre='+O+'&aulast='+encodeURI(authorLast)+'&aufirst='+encodeURI(authorFirst)+'&title='+encodeURI(title)+'&date='+encodeURI(date);
var OpenUrl = 'sid=' + encodeURI(getQueryVariable('rfr_id')) + '&genre='+O+'&aulast='+encodeURI(authorLast)+'&aufirst='+encodeURI(authorFirst)+'&title='+encodeURI(title)+'&date='+encodeURI(date);
if(format === "Journal" || format === "JournalFormat") {
OpenUrl += '&issn='+standardno+'&atitle='+encodeURI(article)+'&volume='+vol+'&part=&issue='+issue;
} else {
Expand Down Expand Up @@ -449,5 +464,8 @@ $j(document).ready(function() { // Wait until the original page loads
} // End doc del tooltip behavior code

} // End page rewrite




});

0 comments on commit 728b1b2

Please sign in to comment.