diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-06-28 20:54:58 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-06-30 12:33:08 +0200 |
commit | 70022b58d156ca58ff7cb53a4a0c1f111d161403 (patch) | |
tree | 81cbe4601d64ad49f1d26db554445329e17ff5f3 /src | |
parent | ac7a34c854aef814e6a5de7750356e8dcd34fe26 (diff) | |
download | hydrilla-fixes-bundle-70022b58d156ca58ff7cb53a4a0c1f111d161403.tar.gz hydrilla-fixes-bundle-70022b58d156ca58ff7cb53a4a0c1f111d161403.zip |
update Worldcat fix
Diffstat (limited to 'src')
-rw-r--r-- | src/worldcat-org-fix/index.json | 4 | ||||
-rw-r--r-- | src/worldcat-org-fix/worldcat.js | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/worldcat-org-fix/index.json b/src/worldcat-org-fix/index.json index a4e8edd..0c1f341 100644 --- a/src/worldcat-org-fix/index.json +++ b/src/worldcat-org-fix/index.json @@ -16,8 +16,8 @@ "type": "mapping_and_resource", "identifier": "worldcat-org-fix", "long_name": "WorldCat catalog search fix", - "version": [2022, 2, 18], - "revision": 2, + "version": [2022, 6, 28], + "revision": 1, "description": "Make library catalogs on worldcat.org searchable without relying on site-served JavaScript.", "dependencies": [], "scripts": [{"file": "worldcat.js"}], diff --git a/src/worldcat-org-fix/worldcat.js b/src/worldcat-org-fix/worldcat.js index 0a4b531..b35a12f 100644 --- a/src/worldcat-org-fix/worldcat.js +++ b/src/worldcat-org-fix/worldcat.js @@ -20,9 +20,10 @@ var pathParts = location.pathname.split('/'), itemRef = pathParts[pathParts.leng // Generate a function which, when invoked, loads the catalog holdings starting at i (one-indexed) focused on loc function generateGoTo(i, set_loc) { - return function () { + return function (e) { + e.preventDefault(); ; // If this is a new search, "set_loc" won't be set; set it - var xhr = new content.XMLHttpRequest(), loc = set_loc || encodeURIComponent(locInput.value); + var xhr = new XMLHttpRequest(), loc = set_loc || encodeURIComponent(locInput.value); xhr.onreadystatechange = function () { if (this.readyState === 4) { if (this.status === 200) { @@ -42,7 +43,6 @@ function generateGoTo(i, set_loc) { xhr.open('GET', 'https://www.worldcat.org/wcpa/servlet/org.oclc.lac.ui.ajax.ServiceServlet?wcoclcnum=' + itemRef + '&start_holding=' + i + '&serviceCommand=holdingsdata&loc=' + loc, true); xhr.send(); - return false; // Make sure the browser doesn't try to submit any holding form }; } |