www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 3878e8ac9c633621a3e4f721ecb1d001e68699e5
parent 824eb06c73e65d887c508037599229a4f18df0e1
Author: Avram Lyon <ajlyon@gmail.com>
Date:   Fri, 29 Apr 2011 16:17:55 +0000

Trans: Fix for PDF+HTML framed pages in Highwire


Diffstat:
Mtranslators/Highwire 2.0.js | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/translators/Highwire 2.0.js b/translators/Highwire 2.0.js @@ -47,9 +47,10 @@ function detectWeb(doc, url) { url.match("content/firstcite") ) { return "multiple"; - } else if (url.match("content/(early/)?[0-9]+")) { + } else if (url.match("content/(early/)?[0-9]+") + && (url.indexOf("frame") === -1 || url.indexOf("frame=sidebar") !== -1)) { return "journalArticle"; - } + } } } @@ -117,6 +118,9 @@ function doWeb(doc, url) { newurl = newurls.shift(); if (newurl.match("cgi/content")) { pdfurl = newurl.replace(/cgi\/content\/abstract/, "content") + ".full.pdf"; + // This is here to catch those pdf+html pages + } else if (newurl.match("\.full\.pdf")) { + pdfurl = newurl.slice(0, newurl.lastIndexOf(".full.pdf")) + ".full.pdf"; } else { // This is not ideal...todo: brew a regex that grabs the correct URL pdfurl = newurl.slice(0, newurl.lastIndexOf(".")) + ".full.pdf";