{ "translatorID": "930d49bc-44a1-4c22-9dde-aa6f72fb11e5", "label": "Cornell LII", "creator": "Bill McKinney", "target": "^https?://www\\.law\\.cornell\\.edu/supct/.+", "minVersion": "3.0", "maxVersion": "", "priority": 100, "inRepository": true, "translatorType": 4, "browserSupport": "gcsbv", "lastUpdated": "2013-02-09 12:09:10" } function detectWeb(doc, url) { var liiRegexp = /\/supct\/html\/.+/ if(liiRegexp.test(url)) { return "case"; } else { var aTags = doc.getElementsByTagName("a"); for(var i=0; i 0) { var tmpDis = dis[0].innerHTML; tmpDis = tmpDis.replace(/\s+/g, " "); newItem.title = newItem.title + " (" + tmpDis + ")"; newItem.caseName= newItem.caseName + " (" + tmpDis + ")"; } // parse citation into parts so that bluebook can be constructed var cite = doc.getElementsByTagName("CASENUMBER"); if (cite.length > 0) { var citeRegex = /([0-9]+)\s+U\.S\.\s+([0-9]+)/; var citeMatch = citeRegex.exec(cite[0].innerHTML); if (citeMatch) { caselawSourceVolume = citeMatch[1]; newItem.reporterVolume = citeMatch[1]; caselawSourceStartPage = citeMatch[2]; newItem.firstPage = citeMatch[2]; } } // look for offcite span element var spanTags = doc.getElementsByTagName("span"); if (spanTags.length > 0) { for(var i=0; i 0) { var tmpNotice= notice [0].innerHTML; tmpNotice= tmpNotice.replace(/\s+/g, " "); newItem.notes.push({note:tmpNotice}); } newItem.complete(); } function doWeb(doc, url) { //sample search result URL: //http://www.law.cornell.edu/supct/search/display.html?terms=citizens&url=/supct/html/94-1340.ZS.html var liiRegexp = /\/supct\/html\/.+/ if(liiRegexp.test(url)) { scrape(doc, url); } else { var items = Zotero.Utilities.getItemArray(doc, doc, liiRegexp); var urls = new Array(); Zotero.selectItems(items, function (items) { if (!items) { return true; } for (var i in items) { urls.push(i); } Zotero.Utilities.processDocuments(urls, scrape, function () {}); }); } }/** BEGIN TEST CASES **/ var testCases = [ { "type": "web", "url": "http://www.law.cornell.edu/supct/html/01-618.ZD1.html", "items": [ { "itemType": "case", "creators": [ { "lastName": "Breyer", "creatorType": "judge", "fieldMode": true } ], "notes": [ { "note": "Bluebook citation: Eldred v. Ashcroft, 537 U.S. 186 (2003)." } ], "tags": [], "seeAlso": [], "attachments": [ { "title": "PDF version", "mimeType": "application/pdf", "downloadable": true } ], "url": "http://www.law.cornell.edu/supct/html/01-618.ZD1.html", "language": "en-us", "court": "U.S. Supreme Court", "reporter": "U.S.", "title": "Eldred v. Ashcroft (Breyer, J., dissenting)", "caseName": "Eldred v. Ashcroft (Breyer, J., dissenting)", "shortTitle": "Eldred v. Ashcroft", "history": "ON WRIT OF CERTIORARI TO THE UNITED STATES COURT OF APPEALS FOR THE DISTRICT OF COLUMBIA CIRCUIT", "dateDecided": "2003 January 15", "reporterVolume": "537", "firstPage": "186", "libraryCatalog": "Cornell LII", "accessDate": "CURRENT_TIMESTAMP" } ] }, { "type": "web", "url": "http://www.law.cornell.edu/supct/search/index.html?query=animals&scope=onlysyllabi", "items": "multiple" } ] /** END TEST CASES **/