var isbnList = new Array();
var googleBooksLink = true;
var OpenLibraryLinks = true;
+var fetchedOpenLibraryLinks = false;
+
+/* If you use EZProxy or similar to enable remote access to protected content,
+ * set your proxy prefix accordingly; for example:
+ * var localProxyPrefix = 'http://proxy.example.com/login?url='
+ */
+var localProxyPrefix = '';
var resultFetchAllRecords = false;
var resultCompiledSearch = null;
}
function fetchOpenLibraryLinks() {
- if (isbnList.length > 0 && OpenLibraryLinks) {
+ if (isbnList.length > 0 && OpenLibraryLinks && !fetchedOpenLibraryLinks) {
+
+ fetchedOpenLibraryLinks = true;
/* OpenLibrary supports a number of different identifiers:
* ISBN: isbn:<isbn>
* LCCN: lccn:<lccn>
/* Fall back to slightly less palatable options */
else if (ol_ebooks[isbn]['exact_lendable']) {
createOpenLibraryLink(
- isbn, ol_ebooks[isbn]['exact_lendable'], 'Borrow online'
+ isbn, localProxyPrefix + ol_ebooks[isbn]['exact_lendable'],
+ 'Borrow online'
);
}
);
} else if (ol_ebooks[isbn]['similar_lendable']) {
createOpenLibraryLink(
- isbn, ol_ebooks[isbn]['similar_lendable'], 'Borrow similar online'
+ isbn, localProxyPrefix + ol_ebooks[isbn]['similar_lendable'],
+ 'Borrow similar online'
);
}
}