workarounds for IE8
[mkws-moved-to-github.git] / experiments / spclient / mkws.js
index 7067296..a45600d 100644 (file)
@@ -437,7 +437,7 @@ function mkws_html_all(data) {
        sort_default: "relevance",
        perpage_default: 20,
        query_width: 50,
-       switch: true, /* show/hide Records|Targets menu */
+       switch_menu: true, /* show/hide Records|Targets menu */
        debug: 0,     /* debug level for development: 0..2 */
 
        dummy: "dummy"
@@ -532,8 +532,8 @@ function mkws_html_switch(config) {
       </div>');
     $("#mkwsTargets").css("display", "none");
 
-    if (!config.switch) {
-       debug("disable switch");
+    if (!config.switch_menu) {
+       debug("disable switch menu");
         $("#mkwsSwitch").css("display", "none");
     }
 }
@@ -661,7 +661,13 @@ function debug(string) {
     if (!console) { /* ARGH!!! */
        return;
     }
-    
+
+    // you need to disable use strict at the top of the file!!!
+    if (mkws_debug >= 3) {
+       console.log(arguments.callee.caller);
+    } else if (mkws_debug >= 2) {
+       console.log(">>> called from function " + arguments.callee.caller.name + ' <<<');
+    }
     console.log(string);
 }