}
}
+// 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
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 + "'");
}
* implement jQuery plugin $.pazpar2({})
*/
function _mkws_jquery_plugin ($) {
- // delayed debug, internal variables are set after dom ready
+ var debug_level = 1;
+
function debug (string) {
- setTimeout(function() { mkws.debug_function(string); }, 500);
+ if (!debug_level)
+ return;
+
+ if (typeof console === "undefined" || typeof console.log === "undefined")
+ return;
+
+ console.log("jquery.pazpar2: " + string);
}
function init_popup(obj) {