commit 24ace7c7330f527979caa8d8eb792c97cd8c693d
parent 99fba46ffc129eb56d958f52e4a743ec7824d432
Author: Avram Lyon <ajlyon@gmail.com>
Date: Sun, 22 Aug 2010 06:03:23 +0000
Fix for JSTOR translator, closes ticket #1715
Diffstat:
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/translators/JSTOR.js b/translators/JSTOR.js
@@ -1,15 +1,16 @@
{
- "translatorID":"d921155f-0186-1684-615c-ca57682ced9b",
- "translatorType":4,
- "label":"JSTOR",
- "creator":"Simon Kornblith, Sean Takats, Michael Berkowitz and Eli Osherovich",
- "target":"https?://[^/]*jstor\\.org[^/]*/(action/(showArticle|doBasicSearch|doAdvancedSearch|doLocatorSearch|doAdvancedResults|doBasicResults)|stable/|pss/)",
- "minVersion":"1.0.0b4.r1",
- "maxVersion":"",
- "priority":100,
- "inRepository":true,
- "lastUpdated":"2009-08-19 22:10:00"
+ "translatorID":"d921155f-0186-1684-615c-ca57682ced9b",
+ "label":"JSTOR",
+ "creator":"Simon Kornblith, Sean Takats, Michael Berkowitz and Eli Osherovich",
+ "target":"https?://[^/]*jstor\\.org[^/]*/(action/(showArticle|doBasicSearch|doAdvancedSearch|doLocatorSearch|doAdvancedResults|doBasicResults)|stable/|pss/)",
+ "minVersion":"1.0.0b4.r1",
+ "maxVersion":"",
+ "priority":100,
+ "inRepository":"1",
+ "translatorType":4,
+ "lastUpdated":"2010-08-22 08:01:40"
}
+
function detectWeb(doc, url) {
var namespace = doc.documentElement.namespaceURI;
@@ -70,7 +71,7 @@ function doWeb(doc, url) {
var xpath = '//a[@id="favorites"]';
var elmt = doc.evaluate(xpath, doc, nsResolver, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
var allJids = new Array();
- if (elmt && /jid=(\d+)/.test(elmt.href)) {
+ if (elmt && /jid=10\.2307%2F(\d+)/.test(elmt.href)) {
allJids.push(RegExp.$1);
var jid = RegExp.$1;
Zotero.debug("JID found 1 " + jid);
@@ -88,7 +89,7 @@ function doWeb(doc, url) {
return true;
}
- var allTitlesElmts = doc.evaluate('//li/ul/li/a[@class="title"]', resultsBlock, nsResolver, XPathResult.ANY_TYPE, null);
+ var allTitlesElmts = doc.evaluate('//ul/li//a[@class="title"]', resultsBlock, nsResolver, XPathResult.ANY_TYPE, null);
var currTitleElmt;
var availableItems = new Object();
while (currTitleElmt = allTitlesElmts.iterateNext()) {