From: Mike Taylor Date: Thu, 23 Jan 2014 10:16:03 +0000 (+0000) Subject: Merge branch 'master' of ssh://git.indexdata.com/home/git/private/mkws X-Git-Tag: 1.0.0~1667 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=c9ac5649e3ca4351f3ce03584d675b3993df181f;hp=758eff59c297d8ec0fe709b63d6612729abdc7a8;p=mkws-moved-to-github.git Merge branch 'master' of ssh://git.indexdata.com/home/git/private/mkws --- diff --git a/examples/htdocs/jasmine-popup.html b/examples/htdocs/jasmine-popup.html index 305b728..9150efe 100644 --- a/examples/htdocs/jasmine-popup.html +++ b/examples/htdocs/jasmine-popup.html @@ -28,6 +28,10 @@ diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 439ee36..b8a92a7 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(/^https?:\/\/(.*?)\/.*/, '$1'); + auth_domain = pp2_url.replace(/^(https?:)?\/\/(.*?)\/.*/, '$2'); debug("guessed auth_domain '" + auth_domain + "' from pp2_url '" + pp2_url + "'"); }