run service proxy auth after the HTML page was rendered, and make it configurable
[mkws-moved-to-github.git] / experiments / spclient / mkws.js
index d8f43e3..21cd04b 100644 (file)
@@ -432,6 +432,7 @@ function mkws_html_all(data) {
       </div>');
     $("#mkwsTargets").css("display", "none");
 
+    mkws_service_proxy_auth(config.service_proxy_auth);
     domReady();
 }
 
@@ -493,8 +494,11 @@ function mkws_html_perpage(config) {
  * The username/password is configured in the apache config file
  * for the site.
  */
-function mkws_service_proxy_auth() {
-    var jqxhr = jQuery.get("/service-proxy-auth")
+function mkws_service_proxy_auth(auth_url) {
+    if (!auth_url)
+       auth_url = "/service-proxy-auth";
+
+    var jqxhr = jQuery.get(auth_url)
        .fail(function() {
            alert("service proxy authentication failed, give up!");
        })
@@ -511,5 +515,5 @@ function mkws_service_proxy_auth() {
        });
 }
 
+/* magic */
 $(document).ready(function() { mkws_html_all(mkws_config) });
-$(document).ready(function() { mkws_service_proxy_auth(); });