From 859b1df6c95bcf4bd9ef4b25e4e9e373a4e871f8 Mon Sep 17 00:00:00 2001 From: Matt Burton Date: Wed, 20 May 2009 21:04:39 +0000 Subject: [PATCH] Fixes #1451, fixed bug where detect web triggered on private groups --- translators/zotero.org.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/translators/zotero.org.js b/translators/zotero.org.js index 56241e5ac..6e9ac6eef 100644 --- a/translators/zotero.org.js +++ b/translators/zotero.org.js @@ -8,7 +8,7 @@ "maxVersion":"", "priority":100, "inRepository":true, - "lastUpdated":"2009-05-14 20:55:00" + "lastUpdated":"2009-05-20 20:55:00" } function detectWeb(doc, url) { @@ -16,6 +16,12 @@ function detectWeb(doc, url) { var nsResolver = namespace ? function(prefix) { if (prefix == 'x') return namespace; else return null; } : null; + + // don't display for private groups + if (url.match(/\/groups\/[0-9]+\/items/)) { + return false; + } + 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) { @@ -28,6 +34,7 @@ function detectWeb(doc, url) { } return "multiple"; } + // Individual item else if (url.match(/\/items\/[0-9]+(\?.*)?$/)) { // TODO: embed in page, because this is absurd