|
@@ -9,7 +9,7 @@ |
|
|
"inRepository": true,
|
|
|
"translatorType": 4,
|
|
|
"browserSupport": "gcsbv",
|
|
|
"lastUpdated": "2016-08-10 09:29:21"
|
|
|
"lastUpdated": "2018-04-27 02:53:31"
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -103,15 +103,22 @@ function translateCOinS(COinS) { |
|
|
|
|
|
// Build URL for RIS, and for PDF if available
|
|
|
function scrapePage(doc, url) {
|
|
|
var risPopupURL = getXPathStr("href", doc, '//form[@id="pagepicker"]//a[contains(@href, "PrintRequest")][1]');
|
|
|
if (risPopupURL) {
|
|
|
// If page has RIS, use that
|
|
|
var docParams = extractQueryValues(risPopupURL);
|
|
|
// We need the id= and the handle= of the current target item.
|
|
|
// From that, we can build URL for RIS.
|
|
|
|
|
|
// Check for an RIS popup link in the page.
|
|
|
var risPopupLink = getXPathStr("href", doc, '//form[@id="pagepicker"]//a[contains(@href, "PrintRequest")][1]');
|
|
|
if (risPopupLink) {
|
|
|
// Get the id from pageSelect.
|
|
|
var pageID = doc.getElementById("pageSelect").value;
|
|
|
// Get other parameters from the page URL.
|
|
|
var docParams = extractQueryValues(url);
|
|
|
// Compose the RIS link.
|
|
|
var risURL = docParams.base
|
|
|
+ "CitationFile?handle=" + docParams.handle
|
|
|
+ "&div=" + docParams.div
|
|
|
+ "&id=" + docParams.id
|
|
|
+ "CitationFile?kind=ris&handle=" + docParams.handle
|
|
|
+ "&id=" + pageID
|
|
|
+ "&base=js";
|
|
|
// updatediv apparently gives us a page that will refresh itself to the PDF.
|
|
|
var pdfPageURLs = doc.getElementsByClassName("updatediv");
|
|
|
ZU.doGet(risURL, function(ris) {
|
|
|
if (pdfPageURLs) {
|
|
@@ -176,7 +183,7 @@ function doWeb (doc,url) { |
|
|
ZU.processDocuments(urls, scrapePage);
|
|
|
});
|
|
|
} else {
|
|
|
scrapePage(doc);
|
|
|
scrapePage(doc, url);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
0 comments on commit
fbbef89