www

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

commit 120f8500458b58d7920aa69274fd92641b6150a9
parent 3e7995fee5e37f4590f02058f9f5245bf6680466
Author: Matt Burton <mcburton@gmail.com>
Date:   Thu, 14 May 2009 20:23:49 +0000

	#zotero.org.js

adding 2.0 site changes to translator.

Diffstat:
Mtranslators/zotero.org.js | 16+++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/translators/zotero.org.js b/translators/zotero.org.js @@ -16,7 +16,7 @@ function detectWeb(doc, url) { var nsResolver = namespace ? function(prefix) { if (prefix == 'x') return namespace; else return null; } : null; - var a = doc.evaluate('//li[@class="topnav"]/a[text()="My Library"]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); + var a = doc.evaluate('//li[@id="library-tab"]/a[text()="My Library"]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); // Skip current user's library if (a && url.indexOf(a.href.match(/(^.+)\/items/)[1]) == 0) { return false; @@ -134,15 +134,13 @@ function xmlToItem(xmlItem) { function doWeb(doc, url) { if (url.indexOf("/groups/") == -1) { - var userID = url.match(/^http:\/\/[^\/]*zotero\.net\/[^\/]+\/([0-9]+)/)[1]; - var apiPrefix = "https://apidev.zotero.org/users/" + userID + "/"; - var itemRe = /^http:\/\/[^\/]*zotero\.net\/[^\/]+\/[0-9]+\/items\/([0-9]+)/; + var userID = url.match(/^http:\/\/[^\/]*zotero\.org\/[^\/]+\/([0-9]+)/)[1]; + var apiPrefix = "https://api.zotero.org/users/" + userID + "/"; + var itemRe = /^http:\/\/[^\/]*zotero\.org\/[^\/]+\/[0-9]+\/items\/([0-9]+)/; } else { - //var groupID = url.match(/^http:\/\/[^\/]*zotero\.net\/groups\/[^\/]+\/([0-9]+)/)[1]; // need slug url fix - var groupID = url.match(/^http:\/\/[^\/]*zotero\.net\/groups\/([0-9]+)/)[1]; - var apiPrefix = "https://apidev.zotero.org/groups/" + groupID + "/"; - //var itemRe = /^http:\/\/[^\/]*zotero\.net\/groups\/[^\/]+\/[0-9]+\/items\/([0-9]+)/; - var itemRe = /^http:\/\/[^\/]*zotero\.net\/groups\/[0-9]+\/items\/([0-9]+)/; + var groupID = url.match(/^http:\/\/[^\/]*zotero\.org\/groups\/[^\/]+\/([0-9]+)/)[1]; + var apiPrefix = "https://api.zotero.org/groups/" + groupID + "/"; + var itemRe = /^http:\/\/[^\/]*zotero\.org\/groups\/[^\/]+\/[0-9]+\/items\/([0-9]+)/; } var nsAtom = new Namespace('http://www.w3.org/2005/Atom');