{ "translatorID": "1f40baef-eece-43e4-a1cc-27d20c0ce086", "label": "Engineering Village", "creator": "Ben Parr, Sebastian Karcher", "target": "^https?://(www\\.)?engineeringvillage(2)?\\.(com|org)", "minVersion": "3.0", "maxVersion": "", "priority": 100, "inRepository": true, "translatorType": 4, "browserSupport": "gcsibv", "lastUpdated": "2018-10-07 10:02:04" } /* ***** BEGIN LICENSE BLOCK ***** Engineering Village Translator - Copyright © 2018 Sebastian Karcher 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) { Z.monitorDOMChanges(doc.getElementById("ev-application"), {childList: true}); var printlink = doc.getElementById('printlink'); if (url.includes("/search/doc/") && printlink && getDocIDs(printlink.href)) { return "journalArticle"; } if ((url.includes("quick.url?") || url.includes("expert.url?") || url.includes("thesaurus.url?")) && getSearchResults(doc, true)) { return "multiple"; } } function getDocIDs(url) { var m = url.match(/\bdocidlist=([^&#]+)/); if (!m) return false; return decodeURIComponent(m[1]).split(','); } function getSearchResults(doc, checkOnly) { var rows = doc.querySelectorAll('div[class*=result-row]'), items = {}, found = false; for (var i=0; i