X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=68892ea67971211c09b0d6f5198c14a307cedf66;hb=d184860c42c779063d3ce515ce625836d5451b2e;hp=597e55b96ca5ab88c96d41c337001bec5a12d90c;hpb=e14aea2ca68c5b8975d53bab9877dac6370796f7;p=mkws-moved-to-github.git diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 597e55b..68892ea 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -1283,8 +1283,12 @@ function _mkws_jquery_plugin ($) { // wrapper to call _make_mkws_team() after page load (function (j) { function log(s) { - if (console && console.log) console.log(s); + if (typeof console === "undefined" || typeof console.log === "undefined") { /* ARGH!!! old IE */ + return; + } + console.log(s); } + // enable before page load, so we could call it before mkws() runs _mkws_jquery_plugin(j); @@ -1339,12 +1343,12 @@ function _mkws_jquery_plugin ($) { }); if (mkws_config.use_service_proxy) { - mkws.authenticate_session(mkws_config.service_proxy_auth, - mkws_config.service_proxy_auth_domain, - mkws_config.pazpar2_url); + authenticate_session(mkws_config.service_proxy_auth, + mkws_config.service_proxy_auth_domain, + mkws_config.pazpar2_url); } else { // raw pp2 - mkws.run_auto_searches(); + run_auto_searches(); } }); @@ -1399,7 +1403,7 @@ function _mkws_jquery_plugin ($) { * The username/password is configured in the apache config file * for the site. */ - mkws.authenticate_session = function(auth_url, auth_domain, pp2_url) { + function authenticate_session(auth_url, auth_domain, pp2_url) { debug("Run service proxy auth URL: " + auth_url); if (!auth_domain) { @@ -1425,13 +1429,13 @@ function _mkws_jquery_plugin ($) { debug("Service proxy auth successfully done"); mkws.authenticated = true; - mkws.run_auto_searches(); + run_auto_searches(); }); } - mkws.run_auto_searches = function() { - debug("running auto searches"); + function run_auto_searches() { + console.log("running auto searches"); $('[id^="mkwsRecords"]').each(function () { var node = $(this); @@ -1450,7 +1454,7 @@ function _mkws_jquery_plugin ($) { if (windowid) s += " [windowid '" + windowid + "']"; if (sort) s += " sorted by '" + sort + "'"; if (targets) s += " in targets '" + targets + "'"; - debug(s); + console.log(s); newSearch(query, sort, targets, windowid); } });