{
"translatorID": "b7bd798d-e518-46d1-aa13-a69f2864fa91",
"label": "Edinburgh University Press Journals",
"creator": "Sebastian Karcher",
"target": "^https?://www\\.euppublishing\\.com/",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2013-01-22 02:43:55"
}
/*
Edinburg Universitz Press Journals Translator
Closely based on the ESA journals translator
Copyright (C) 2013 Sebastian Karcher
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
function detectWeb(doc, url) {
if (url.match(/\/doi\/abs\/10\.|\/doi\/full\/10\./)) return "journalArticle";
else if (url.match(/\/action\/doSearch|\/toc\//) && getSearchResults(doc).length) return "multiple";
}
function getSearchResults(doc) {
return ZU.xpath(doc,
'//div[@class="articleInfo"]/p[@class="title"]/a[contains(@href, "/doi/abs/")][1]|\
//div[@class="art_title"]/a[contains(@href, "/doi/abs/")][1]');
}
function doWeb(doc, url) {
var arts = new Array();
if (detectWeb(doc, url) == "multiple") {
var items = new Object();
var rows = getSearchResults(doc);
for (var i=0, n=rows.length; i