From: Mike Taylor Date: Tue, 4 Mar 2014 12:20:47 +0000 (+0000) Subject: Move more global code (protocol-independent link adjusting) out of the team. X-Git-Tag: 1.0.0~1350 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=e7a59689a9f67bd5745cc1fd455b654d4fb2b578;p=mkws-moved-to-github.git Move more global code (protocol-independent link adjusting) out of the team. --- diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index b5e9908..163da6a 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -232,12 +232,6 @@ function team($, teamName) { m_perpage = parseInt(mkws_config.perpage_default); } - // protocol independent 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 independent 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 @@ -1432,6 +1426,12 @@ function team($, teamName) { $(document).ready(function() { mkws.resizePage() }); } + // protocol independent 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 independent links: " + mkws_config.pazpar2_url); + } + // Backwards compatibility: set new magic class names on any // elements that have the old magic IDs. var ids = [ "Switch", "Lang", "Search", "Pager", "Navi",