www

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

commit a02301cb155238dfe28174562dd7a57438ae7334
parent b76fdd8e43a26e10125b26e5febdcfb038ee3836
Author: Sean Takats <sean@takats.org>
Date:   Fri, 24 Apr 2009 17:28:24 +0000

Updates Firefox maxVersion to 3.5b5pre and deletes problematic Persée translator


Diffstat:
Minstall.rdf | 2+-
Dtranslators/Persée.js | 111-------------------------------------------------------------------------------
Mupdate.rdf | 2+-
3 files changed, 2 insertions(+), 113 deletions(-)

diff --git a/install.rdf b/install.rdf @@ -25,7 +25,7 @@ <Description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minVersion>3.0</em:minVersion> - <em:maxVersion>3.5b4pre</em:maxVersion> + <em:maxVersion>3.5b5pre</em:maxVersion> </Description> </em:targetApplication> diff --git a/translators/Persée.js b/translators/Persée.js @@ -1,110 +0,0 @@ -{ - "translatorID":"dd149efc-7f0e-43e4-b3df-b6d15e171717", - "translatorType":4, - "label":"Persée", - "creator":"Adam Crymble", - "target":"http://www.persee.fr", - "minVersion":"1.0.0b4.r5", - "maxVersion":"", - "priority":100, - "inRepository":true, - "lastUpdated":"2008-07-15 19:40:00" -} - -function detectWeb(doc, url) { - if (doc.location.href.match("search") && doc.evaluate('//div[@id="searchResults"]/div[@class="oneResult"]/a', doc, null, XPathResult.ANY_TYPE, null).iterateNext()) { - return "multiple"; - } else if (doc.location.href.match("article")) { - return "journalArticle"; - } -} - -//Persee Translator. Code by Adam Crymble - -function scrape(doc, url) { - - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - - var newItem = new Zotero.Item("journalArticle"); - - newItem.url = doc.location.href; - newItem.title = doc.evaluate('//div[@class="oneResult"]/h2', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent.replace(/^\s*|\s+$/g, ''); - - //various journal info - if (doc.title.match(", ")) { - var contents = doc.title.split(", "); - newItem.publicationTitle = contents[0].substr(9); - for (var i = 1; i < contents.length; i++) { - if (contents[i].match("Year ")) { - newItem.date = contents[i].substr(5); - } else if (contents[i].match("Volume ")) { - newItem.volume = contents[i].substr(7); - } else if (contents[i].match("Issue ")) { - newItem.issue = contents[i].substr(6); - } else if (contents[i].match("pp. ")) { - newItem.pages = contents[i].substr(4); - } - } - } - - //authors - var getAuthors = doc.evaluate('//div[@class="oneResult"]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent.replace(/^\s*|\s+$/g, ''); - var chopAuthors1 = getAuthors.indexOf(newItem.title) + newItem.title.length; - var chopAuthors2 = getAuthors.indexOf(newItem.publicationTitle); - - var authors = getAuthors.substr(chopAuthors1, chopAuthors2-chopAuthors1); - if (authors.match(", ")) { - authors = authors.split(", "); - for (var i in authors) { - newItem.creators.push(Zotero.Utilities.cleanAuthor(authors[i], "author")); - } - } else { - newItem.creators.push(Zotero.Utilities.cleanAuthor(authors, "author")); - } - - newItem.complete(); -} - -function doWeb(doc, url) { - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - - var articles = new Array(); - - if (detectWeb(doc,url) == "journalArticle") { - articles = [url]; - - } else if (detectWeb(doc, url) == "multiple") { - var items = new Object(); - - var titles = doc.evaluate('//div[@id="searchResults"]/div[@class="oneResult"]/a', doc, nsResolver, XPathResult.ANY_TYPE, null); - - var next_title; - var titlesArray = new Array(); - var linksArray = new Array(); - - while (next_title = titles.iterateNext()) { - titlesArray.push(next_title.textContent.replace(/^\s*|\s+$/g, '')); - linksArray.push(next_title.href); - } - - for (var i = 0; i < titlesArray.length; i++) { - - if (linksArray[i].match("article")) { - items[linksArray[i]] = titlesArray[i]; - } - } - - items = Zotero.selectItems(items); - for (var i in items) { - articles.push(i); - } - } - Zotero.Utilities.processDocuments(articles, scrape, function() {Zotero.done();}); - Zotero.wait(); -} -\ No newline at end of file diff --git a/update.rdf b/update.rdf @@ -12,7 +12,7 @@ <RDF:Description> <id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id> <minVersion>3.0</minVersion> - <maxVersion>3.5b4pre</maxVersion> + <maxVersion>3.5b5pre</maxVersion> <updateLink>http://www.zotero.org/download/zotero.xpi</updateLink> <updateHash>sha1:</updateHash> </RDF:Description>