Permalink
Browse files

[HAL] Fix saving from PDF view (#1501)

  • Loading branch information...
adam3smith committed Dec 21, 2017
1 parent ce38a08 commit 42b4f2320011c6d56b57a176ca9dede1e475e153
Showing with 10 additions and 4 deletions.
  1. +10 −4 HAL Archives Ouvertes.js
View
@@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2016-11-02 21:46:36"
"lastUpdated": "2017-12-21 03:11:03"
}
/*
@@ -91,15 +91,21 @@ function doWeb(doc, url) {
Zotero.Utilities.processDocuments(articles, scrape)
});
} else {
scrape(doc, url);
//work on PDF pages
if (url.search(/\/document$/) != -1 ) {
var articleURL = url.replace(/\/document$/, "")
//Z.debug(articleURL)
ZU.processDocuments(articleURL, scrape);
}
else scrape(doc, url);
}
}
function scrape(doc, url) {
var bibtexUrl = url.replace(/#.+|\/$/, "") + "/bibtex";
var abstract = ZU.xpathText(doc, '//div[@class="abstract-content"]');
var pdfUrl = ZU.xpathText(doc, '//meta[@name="citation_pdf_url"]/@content');
//Z.debug(pdfUrl)
//Z.debug("pdfURL " + pdfUrl)
ZU.doGet(bibtexUrl, function (bibtex) {
//Z.debug(bibtex)
var translator = Zotero.loadTranslator("import");
@@ -333,4 +339,4 @@ var testCases = [
"items": "multiple"
}
]
/** END TEST CASES **/
/** END TEST CASES **/

0 comments on commit 42b4f23

Please sign in to comment.