var config_default = {
use_service_proxy: true,
- pazpar2_url: "//mkws.indexdata.com/service-proxy/",
- service_proxy_auth: undefined, // generally rolled from the next three properties
- // Was: //mkws.indexdata.com/service-proxy-auth
+ pazpar2_url: undefined,
pp2_hostname: "mkws.indexdata.com",
+ pp2_path: "service-proxy",
+ service_proxy_auth: undefined,
sp_path: "service-proxy-auth",
sp_auth_query: undefined, // Will be: "command=auth&action=perconfig",
sp_auth_credentials: undefined,
mkws.pazpar2_url = function() {
- return mkws.config.pazpar2_url;
+ if (mkws.config.pazpar2_url) {
+ mkws.log("using pre-baked pazpar2_url '" + mkws.config.pazpar2_url + "'");
+ return mkws.config.pazpar2_url;
+ } else {
+ var s = document.location.protocol + "//" + mkws.config.pp2_hostname + "/" + mkws.config.pp2_path + "/";
+ mkws.log("generated pazpar2_url '" + s + "'");
+ return s;
+ }
};
}
// protocol independent link for pazpar2: "//mkws/sp" -> "https://mkws/sp"
- if (mkws.config.pazpar2_url.match(/^\/\//)) {
+ if (mkws.pazpar2_url().match(/^\/\//)) {
mkws.config.pazpar2_url = document.location.protocol + mkws.config.pazpar2_url;
log("adjusted protocol independent link to " + mkws.pazpar2_url());
}