commit 0ab3366cdd40a64062164273a4445a88b8cc1aa5
parent 59f3caa7180a12f20cd217ce1e84859fcf52f992
Author: Avram Lyon <ajlyon@gmail.com>
Date: Thu, 24 Feb 2011 23:23:46 +0000
Trans: Fix for EBSCOhost. See http://forums.zotero.org/discussion/16603
Diffstat:
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/translators/EBSCOhost.js b/translators/EBSCOhost.js
@@ -1,14 +1,14 @@
{
- "translatorID":"d0b1914a-11f1-4dd7-8557-b32fe8a3dd47",
- "translatorType":4,
- "label":"EBSCOhost",
- "creator":"Simon Kornblith and Michael Berkowitz",
- "target":"https?://[^/]+/(?:bsi|ehost)/(?:results|detail|folder)",
- "minVersion":"1.0.0b3.r1",
- "maxVersion":"",
- "priority":100,
- "inRepository":true,
- "lastUpdated":"2010-11-10 10:10:00"
+ "translatorID": "d0b1914a-11f1-4dd7-8557-b32fe8a3dd47",
+ "label": "EBSCOhost",
+ "creator": "Simon Kornblith and Michael Berkowitz",
+ "target": "https?://[^/]+/(?:bsi|ehost)/(?:results|detail|folder)",
+ "minVersion": "1.0.0b3.r1",
+ "maxVersion": "",
+ "priority": 100,
+ "inRepository": "1",
+ "translatorType": 4,
+ "lastUpdated": "2011-02-24 23:44:28"
}
function detectWeb(doc, url) {
@@ -87,7 +87,7 @@ function generateDeliverString(nsResolver, doc){
function downloadFunction(text) {
//Zotero.debug("POSTTEXT="+text);
- var postLocation = /<form (?:autocomplete="o(?:ff|n)" )?name="aspnetForm" method="post" action="([^"]+)"/
+ var postLocation = /<form method="post" action="([^"]+)"[^><]*id="aspnetForm"/
var postMatch = postLocation.exec(text);
var deliveryURL = postMatch[1].replace(/&/g, "&");
postMatch = customViewStateMatch.exec(text);
@@ -162,7 +162,7 @@ function doWeb(doc, url) {
}
Zotero.Utilities.processDocuments(uris, function(newDoc){
- var postURL = newDoc.evaluate('//form[@name="aspnetForm"]/@action', newDoc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
+ var postURL = newDoc.evaluate('//form[@id="aspnetForm"]/@action', newDoc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
postURL = host+"/ehost/"+postURL.nodeValue;
var deliverString = generateDeliverString(nsResolver, newDoc);
Zotero.Utilities.HTTP.doPost(postURL, deliverString, downloadFunction);
@@ -171,7 +171,7 @@ function doWeb(doc, url) {
//This is a hack, generateDeliveryString is acting up for single pages, but it works on the plink url
var link = [doc.evaluate("//input[@id ='pLink']/@value", doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().nodeValue];
Zotero.Utilities.processDocuments(link, function(newDoc){
- var postURL = newDoc.evaluate('//form[@name="aspnetForm"]/@action', newDoc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
+ var postURL = newDoc.evaluate('//form[@id="aspnetForm"]/@action', newDoc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
postURL = host+"/ehost/"+postURL.nodeValue;
var deliverString = generateDeliverString(nsResolver, newDoc);
Zotero.Utilities.HTTP.doPost(postURL, deliverString, downloadFunction);