Trans: Fix for EBSCOhost. See http://forums.zotero.org/discussion/16603
This commit is contained in:
parent
59f3caa718
commit
0ab3366cdd
|
@ -1,14 +1,14 @@
|
||||||
{
|
{
|
||||||
"translatorID":"d0b1914a-11f1-4dd7-8557-b32fe8a3dd47",
|
"translatorID": "d0b1914a-11f1-4dd7-8557-b32fe8a3dd47",
|
||||||
"translatorType":4,
|
"label": "EBSCOhost",
|
||||||
"label":"EBSCOhost",
|
"creator": "Simon Kornblith and Michael Berkowitz",
|
||||||
"creator":"Simon Kornblith and Michael Berkowitz",
|
"target": "https?://[^/]+/(?:bsi|ehost)/(?:results|detail|folder)",
|
||||||
"target":"https?://[^/]+/(?:bsi|ehost)/(?:results|detail|folder)",
|
"minVersion": "1.0.0b3.r1",
|
||||||
"minVersion":"1.0.0b3.r1",
|
"maxVersion": "",
|
||||||
"maxVersion":"",
|
"priority": 100,
|
||||||
"priority":100,
|
"inRepository": "1",
|
||||||
"inRepository":true,
|
"translatorType": 4,
|
||||||
"lastUpdated":"2010-11-10 10:10:00"
|
"lastUpdated": "2011-02-24 23:44:28"
|
||||||
}
|
}
|
||||||
|
|
||||||
function detectWeb(doc, url) {
|
function detectWeb(doc, url) {
|
||||||
|
@ -87,7 +87,7 @@ function generateDeliverString(nsResolver, doc){
|
||||||
function downloadFunction(text) {
|
function downloadFunction(text) {
|
||||||
|
|
||||||
//Zotero.debug("POSTTEXT="+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 postMatch = postLocation.exec(text);
|
||||||
var deliveryURL = postMatch[1].replace(/&/g, "&");
|
var deliveryURL = postMatch[1].replace(/&/g, "&");
|
||||||
postMatch = customViewStateMatch.exec(text);
|
postMatch = customViewStateMatch.exec(text);
|
||||||
|
@ -162,7 +162,7 @@ function doWeb(doc, url) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Zotero.Utilities.processDocuments(uris, function(newDoc){
|
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;
|
postURL = host+"/ehost/"+postURL.nodeValue;
|
||||||
var deliverString = generateDeliverString(nsResolver, newDoc);
|
var deliverString = generateDeliverString(nsResolver, newDoc);
|
||||||
Zotero.Utilities.HTTP.doPost(postURL, deliverString, downloadFunction);
|
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
|
//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];
|
var link = [doc.evaluate("//input[@id ='pLink']/@value", doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().nodeValue];
|
||||||
Zotero.Utilities.processDocuments(link, function(newDoc){
|
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;
|
postURL = host+"/ehost/"+postURL.nodeValue;
|
||||||
var deliverString = generateDeliverString(nsResolver, newDoc);
|
var deliverString = generateDeliverString(nsResolver, newDoc);
|
||||||
Zotero.Utilities.HTTP.doPost(postURL, deliverString, downloadFunction);
|
Zotero.Utilities.HTTP.doPost(postURL, deliverString, downloadFunction);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user