{ "translatorID": "b10bf941-12e9-4188-be04-f6357fa594a0", "label": "Old Bailey Online", "creator": "Adam Crymble & Sharon Howard", "target": "^https?://www\\.oldbaileyonline\\.org/", "minVersion": "3.0", "maxVersion": "", "priority": 100, "inRepository": true, "translatorType": 4, "browserSupport": "gcsibv", "lastUpdated": "2018-10-12 23:37:03" } /* ***** BEGIN LICENSE BLOCK ***** Copyright © 2018 Sharon Howard This file is part of Zotero. Zotero is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Zotero 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Zotero. If not, see . ***** END LICENSE BLOCK ***** */ // URLs // trial: div=t18000115-12 // session: name=16900430 // OA: can use either name= or div= ! // div/name excludes dir= pages in browse.jsp function detectWeb(doc, url) { if (url.includes('browse.jsp') && ( url.includes('div=OA') || url.includes('name=') ) ) { return "book"; } else if (url.includes('browse.jsp') && ( url.includes('div=') ) ) { return "case"; } else if ( url.includes("search.jsp") && getSearchResults(doc, true)) { return "multiple"; } } // to do: not trials... // div=f16740429-1 - front matter // div=a16860520-1 - advertisements // div=s16740717-1 - punishment summary // div=o16751208-1 - supplementary material function getSearchResults(doc, checkOnly) { var items = {}; var found = false; var rows = ZU.xpath(doc, '//li/p[@class="srchtitle"]/a'); for (var i=0; i