From: Wolfram Schneider Date: Wed, 22 Jan 2014 16:40:17 +0000 (+0000) Subject: adjust protocol independend link for pazpar2 object, MKWS-103 X-Git-Tag: 1.0.0~1654^2~9 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=ed4bbecdf389e73ac88b8f8b0158b8180d5945a0;hp=7df213947f66e078f3ac244fb4a7512c4410cd3f;p=mkws-moved-to-github.git adjust protocol independend link for pazpar2 object, MKWS-103 It turns out that pz2.js does not support protocol independend link. As a workaround, we will add the protocoll if needed after checking the config in MKWS. e.g.: "//mkws/sp" -> "https://mkws/sp" --- diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 7343749..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