Fixes #1528, upated Voyager 7 to handled extra /uiu/ in url
This commit is contained in:
parent
872b90760c
commit
07918260c1
1 changed files with 7 additions and 6 deletions
|
@ -8,7 +8,7 @@
|
||||||
"maxVersion":"",
|
"maxVersion":"",
|
||||||
"priority":100,
|
"priority":100,
|
||||||
"inRepository":true,
|
"inRepository":true,
|
||||||
"lastUpdated":"2009-07-23 10:00:00"
|
"lastUpdated":"2009-08-10 12:00:00"
|
||||||
}
|
}
|
||||||
|
|
||||||
function detectWeb(doc, url){
|
function detectWeb(doc, url){
|
||||||
|
@ -22,7 +22,7 @@ function detectWeb(doc, url){
|
||||||
if (prefix == 'x') return namespace; else return null;
|
if (prefix == 'x') return namespace; else return null;
|
||||||
} : null;
|
} : null;
|
||||||
|
|
||||||
var titles = doc.evaluate('//div[@class="resultListTextCell"]/div/label', doc, nsResolver, XPathResult.ANY_TYPE, null);
|
var titles = doc.evaluate('//div[@class="resultListTextCell"]//a', doc, nsResolver, XPathResult.ANY_TYPE, null);
|
||||||
if (titles.iterateNext()){
|
if (titles.iterateNext()){
|
||||||
return "multiple";
|
return "multiple";
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@ function doWeb(doc, url){
|
||||||
var hostRegexp = new RegExp("^(https?://[^/]+)/");
|
var hostRegexp = new RegExp("^(https?://[^/]+)/");
|
||||||
var hMatch = hostRegexp.exec(url);
|
var hMatch = hostRegexp.exec(url);
|
||||||
var host = hMatch[1];
|
var host = hMatch[1];
|
||||||
|
var urlPrefix = url.indexOf("/uiu/") != -1 ? host + "/uiu/vwebv/exportRecord.do?bibId=" : host + "/vwebv/exportRecord.do?bibId=";
|
||||||
|
|
||||||
var namespace = doc.documentElement.namespaceURI;
|
var namespace = doc.documentElement.namespaceURI;
|
||||||
var nsResolver = namespace ? function(prefix) {
|
var nsResolver = namespace ? function(prefix) {
|
||||||
|
@ -43,20 +44,20 @@ function doWeb(doc, url){
|
||||||
var newUris = new Array();
|
var newUris = new Array();
|
||||||
|
|
||||||
if (m){ //single item
|
if (m){ //single item
|
||||||
newUris.push(host + "/vwebv/exportRecord.do?bibId=" + m[1] + "&format=utf-8");
|
newUris.push(urlPrefix + m[1] + "&format=utf-8");
|
||||||
}
|
}
|
||||||
else { //search results
|
else { //search results
|
||||||
var items = new Object();
|
var items = new Object();
|
||||||
var titles = doc.evaluate('//div[@class="resultListTextCell"]/div/label', doc, nsResolver, XPathResult.ANY_TYPE, null);
|
var titles = doc.evaluate('//div[@class="resultListTextCell"]//a', doc, nsResolver, XPathResult.ANY_TYPE, null);
|
||||||
var title;
|
var title;
|
||||||
|
|
||||||
while (title = titles.iterateNext()) {
|
while (title = titles.iterateNext()) {
|
||||||
var bibId = doc.evaluate('@for', title, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
|
var bibId = title.href.match(/bibId=([0-9]+)/)[1];
|
||||||
items[bibId] = title.textContent;
|
items[bibId] = title.textContent;
|
||||||
}
|
}
|
||||||
items = Zotero.selectItems(items);
|
items = Zotero.selectItems(items);
|
||||||
for (var i in items) {
|
for (var i in items) {
|
||||||
newUris.push(host + "/vwebv/exportRecord.do?bibId=" + i + "&format=utf-8");
|
newUris.push(urlPrefix + i + "&format=utf-8");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue