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
- pp2_hostname: "mkws.indexdata.com",
- sp_path: "service-proxy-auth",
- sp_auth_query: undefined, // Will be: "command=auth&action=perconfig",
- sp_auth_credentials: undefined,
+ pazpar2_url: undefined,
+ pp2_hostname: "sp-mkws.indexdata.com",
+ pp2_path: "service-proxy",
+ service_proxy_auth: undefined,
+ sp_auth_path: "service-proxy/",
+ sp_auth_query: "command=auth&action=perconfig",
+ sp_auth_credentials: "XXX/XXX", // Should be undefined: see bug MKSP-125.
lang: "",
sort_options: [["relevance"], ["title:1", "title"], ["date:0", "newest"], ["date:1", "oldest"]],
perpage_options: [10, 20, 30, 50],
};
+mkws.pazpar2_url = function() {
+ 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;
+ }
+};
+
+
// wrapper to provide local copy of the jQuery object.
(function($) {
var log = mkws.log;
}
// 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.config.pazpar2_url);
+ log("adjusted protocol independent link to " + mkws.pazpar2_url());
}
if (mkws.config.responsive_design_width) {
} else {
var s = '//';
s += config.auth_hostname ? config.auth_hostname : config.pp2_hostname;
- s += '/' + config.sp_path;
+ s += '/' + config.sp_auth_path;
var q = config.sp_auth_query;
if (q) {
s += '?' + q;
if (mkws.config.use_service_proxy && !mkws.authenticated && !mkws.authenticating) {
authenticateSession(sp_auth_url(mkws.config),
mkws.config.service_proxy_auth_domain,
- mkws.config.pazpar2_url);
+ mkws.pazpar2_url());
} else if (!mkws.authenticating) {
// raw pp2 or we have a session already open
runAutoSearches();