{ "translatorID": "60e55b65-08cb-4a8f-8a61-c36338ec8754", "label": "Access Medicine", "creator": "Jaret M. Karnuta", "target": "^https?://(0-)?(access(anesthesiology|cardiology|emergencymedicine|medicine|pediatrics|surgery)|neurology)\\.mhmedical\\.com", "minVersion": "3.0", "maxVersion": "", "priority": 100, "inRepository": true, "translatorType": 4, "browserSupport": "gcsibv", "lastUpdated": "2017-01-12 22:14:02" } /* ***** BEGIN LICENSE BLOCK ***** Copyright © 2016 Jaret M. Karnuta 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 ***** */ function detectWeb(doc, url){ //check if search page //case differs between browsers, force lower case var pattern = /\/searchresults/i; var search = url.search(pattern) != -1; if (search){ return "multiple"; } //check if book section pattern = /\/content.*/i; var section = url.search(pattern) != -1; if (section){ return "bookSection"; } } function doWeb(doc, url){ var contentType = detectWeb(doc, url); if (contentType == "multiple"){ //for formatting citation, recall case differences in url (see detectWeb) var pattern = /\/searchresults.*/i; var baseUrl = url.replace(pattern,''); var baseCitation = baseUrl + "/downloadCitation.aspx?format=ris§ionid="; //search page //easier to use XPaths here var sections = ZU.xpath(doc, '//div[@class="search-entries"]/div[@class="row-fluid bordered-bottom"]/div[@class="span10"]'); var sectionDict = {}; var selectedSections = []; for (var i=0;i