{ "translatorID":"4fd6b89b-2316-2dc4-fd87-61a97dd941e8", "translatorType":4, "label":"Library Catalog (InnoPAC)", "creator":"Simon Kornblith and Michael Berkowitz", "target":"(search~|\\/search\\?|(a|X|t|Y|w)\\?|\\?(searchtype|searchscope)|frameset&FF)", "minVersion":"1.0.0b3.r1", "maxVersion":"", "priority":200, "inRepository":true, "lastUpdated":"2008-10-28 02:50:00" } function detectWeb(doc, url) { var namespace = doc.documentElement.namespaceURI; var nsResolver = namespace ? function(prefix) { if (prefix == 'x') return namespace; else return null; } : null; // Central Michigan University fix var xpath = '//div[@class="bibRecordLink"]'; var elmt = doc.evaluate(xpath, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); if(elmt) { return "book"; } // possibly disastrous edit to regular expression below if (!url.match(/SEARCH=/) && !url.match(/searchargs?=/) && !url.match(/&FF/)) return false; // First, check to see if the URL alone reveals InnoPAC, since some sites don't reveal the MARC button var matchRegexp = new RegExp('^https?://[^/]+/search[^/]*\\??/[^/]+/[^/]+/[^/]+\%2C[^/]+/frameset(.+)$'); if(matchRegexp.test(doc.location.href)) { if (!url.match("SEARCH") && !url.match("searchtype")) { return "book"; } } // Next, look for the MARC button xpath = '//a[img[@src="/screens/marcdisp.gif" or starts-with(@alt, "MARC ") or @src="/screens/regdisp.gif" or @alt="REGULAR RECORD DISPLAY"]]'; elmt = doc.evaluate(xpath, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); if(elmt) { return "book"; } // Also, check for links to an item display page var tags = doc.getElementsByTagName("a"); for(var i=0; i