From 3878e8ac9c633621a3e4f721ecb1d001e68699e5 Mon Sep 17 00:00:00 2001 From: Avram Lyon Date: Fri, 29 Apr 2011 16:17:55 +0000 Subject: [PATCH] Trans: Fix for PDF+HTML framed pages in Highwire --- translators/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 index bb2bf5256..ba7ac7934 100644 --- 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";