X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=e3f02a27afbf0018a92ef00aa24c2d1e5028b124;hb=ed4bbecdf389e73ac88b8f8b0158b8180d5945a0;hp=f7f324b4fd1142d2d7cac2c3a7d2320522057789;hpb=c756fb64ab176db37eb3a8822008de1e1e4ad1a0;p=mkws-moved-to-github.git diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index f7f324b..e3f02a2 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -237,6 +237,12 @@ for (var key in mkws_config) { } } +// protocol independend link for pazpar2: "//mkws/sp" -> "https://mkws/sp" +if (mkws_config.pazpar2_url.match(/^\/\//)) { + mkws_config.pazpar2_url = document.location.protocol + mkws_config.pazpar2_url; + debug("adjust protocol independend links: " + mkws_config.pazpar2_url); +} + debug("Create main pz2 object"); // create a parameters array and pass it to the pz2's constructor // then register the form submit event with the pz2.search function @@ -1084,7 +1090,7 @@ function mkws_service_proxy_auth(auth_url, auth_domain, pp2_url) { debug("Run service proxy auth URL: " + auth_url); if (!auth_domain) { - auth_domain = pp2_url.replace(/^http:\/\/(.*?)\/.*/, '$1'); + auth_domain = pp2_url.replace(/^(https?:)?\/\/(.*?)\/.*/, '$2'); debug("guessed auth_domain '" + auth_domain + "' from pp2_url '" + pp2_url + "'"); }