#zotero.org.js
adding 2.0 site changes to translator.
This commit is contained in:
parent
3e7995fee5
commit
120f850045
1 changed files with 7 additions and 9 deletions
|
@ -16,7 +16,7 @@ function detectWeb(doc, url) {
|
||||||
var nsResolver = namespace ? function(prefix) {
|
var nsResolver = namespace ? function(prefix) {
|
||||||
if (prefix == 'x') return namespace; else return null;
|
if (prefix == 'x') return namespace; else return null;
|
||||||
} : 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
|
// Skip current user's library
|
||||||
if (a && url.indexOf(a.href.match(/(^.+)\/items/)[1]) == 0) {
|
if (a && url.indexOf(a.href.match(/(^.+)\/items/)[1]) == 0) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -134,15 +134,13 @@ function xmlToItem(xmlItem) {
|
||||||
|
|
||||||
function doWeb(doc, url) {
|
function doWeb(doc, url) {
|
||||||
if (url.indexOf("/groups/") == -1) {
|
if (url.indexOf("/groups/") == -1) {
|
||||||
var userID = url.match(/^http:\/\/[^\/]*zotero\.net\/[^\/]+\/([0-9]+)/)[1];
|
var userID = url.match(/^http:\/\/[^\/]*zotero\.org\/[^\/]+\/([0-9]+)/)[1];
|
||||||
var apiPrefix = "https://apidev.zotero.org/users/" + userID + "/";
|
var apiPrefix = "https://api.zotero.org/users/" + userID + "/";
|
||||||
var itemRe = /^http:\/\/[^\/]*zotero\.net\/[^\/]+\/[0-9]+\/items\/([0-9]+)/;
|
var itemRe = /^http:\/\/[^\/]*zotero\.org\/[^\/]+\/[0-9]+\/items\/([0-9]+)/;
|
||||||
} else {
|
} else {
|
||||||
//var groupID = url.match(/^http:\/\/[^\/]*zotero\.net\/groups\/[^\/]+\/([0-9]+)/)[1]; // need slug url fix
|
var groupID = url.match(/^http:\/\/[^\/]*zotero\.org\/groups\/[^\/]+\/([0-9]+)/)[1];
|
||||||
var groupID = url.match(/^http:\/\/[^\/]*zotero\.net\/groups\/([0-9]+)/)[1];
|
var apiPrefix = "https://api.zotero.org/groups/" + groupID + "/";
|
||||||
var apiPrefix = "https://apidev.zotero.org/groups/" + groupID + "/";
|
var itemRe = /^http:\/\/[^\/]*zotero\.org\/groups\/[^\/]+\/[0-9]+\/items\/([0-9]+)/;
|
||||||
//var itemRe = /^http:\/\/[^\/]*zotero\.net\/groups\/[^\/]+\/[0-9]+\/items\/([0-9]+)/;
|
|
||||||
var itemRe = /^http:\/\/[^\/]*zotero\.net\/groups\/[0-9]+\/items\/([0-9]+)/;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var nsAtom = new Namespace('http://www.w3.org/2005/Atom');
|
var nsAtom = new Namespace('http://www.w3.org/2005/Atom');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue