{ "translatorID": "e8544423-1515-4daf-bb5d-3202bf422b58", "label": "beck-online", "creator": "Philipp Zumstein", "target": "^https?://beck-online\\.beck\\.de", "minVersion": "3.0", "maxVersion": "", "priority": 100, "inRepository": true, "translatorType": 4, "browserSupport": "gcsv", "lastUpdated": "2014-04-14 11:50:31" } /* ***** BEGIN LICENSE BLOCK ***** beck-online Translator, Copyright © 2014 Philipp Zumstein 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 ***** */ //Disclaimer: //This is written mainly for articles/cases in the journals in beck-online //Probably, it might work further on other material (e.g. ebooks) in beck-online. var mappingClassNameToItemType = { 'ZAUFSATZ' : 'journalArticle', 'ZRSPR' : 'case',//Rechtssprechung 'ZENTB' : 'journalArticle',//Entscheidungsbesprechung 'ZBUCHB' : 'journalArticle',//Buchbesprechung 'ZSONST' : 'journalArticle',//Sonstiges, z.B. Vorwort 'ZINHALTVERZ' : 'multiple'//Inhaltsverzeichnis } function detectWeb(doc, url) { var documentClassName = doc.getElementById("dokument").className; //Z.debug(documentClassName); if (mappingClassNameToItemType[documentClassName.toUpperCase()]) { return mappingClassNameToItemType[documentClassName.toUpperCase()]; } } function doWeb(doc, url) { if (detectWeb(doc, url) == "multiple") { var items = new Object(); var articles = new Array(); var rows = ZU.xpath(doc, '//div[@class="inh"]//span[@class="inhdok"]//a | //div[@class="autotoc"]//a'); for(var i=0; iBKR Jahr 2014 Seite // Dr. iur. habil. Christian Hofmann: Haftung im Zahlungsverkehr var title = ZU.trimInternal( ZU.xpathText(rows[i], './text()[1]') ); var link = rows[i].href; items[link] = title; } Zotero.selectItems(items, function (items) { if (!items) { return true; } for (var i in items) { articles.push(i); } ZU.processDocuments(articles, scrape); }); } else { scrape(doc, url); } } function scrape(doc, url) { var documentClassName = doc.getElementById("dokument").className; var item; if (mappingClassNameToItemType[documentClassName.toUpperCase()]) { item = new Zotero.Item(mappingClassNameToItemType[documentClassName.toUpperCase()]); } var titleNode = ZU.xpath(doc, '//div[@class="titel"]')[0] || ZU.xpath(doc, '//div[@class="dk2"]//span[@class="titel"]')[0]; item.title = ZU.trimInternal(titleNode.textContent); var authorNode = ZU.xpath(doc, '//div[@class="autor"]'); for (var i=0; i posComma) { var posComma = authorString.indexOf(",",posUnd); } if (posComma > 0) { authorString = authorString.substr(0,posComma); } //Z.debug(authorString); authorArray = authorString.split(/und|,/); for (var k=0; k