The third debug() function in mkws.js, inside the jQuery plugin, is
authorMike Taylor <mike@indexdata.com>
Tue, 11 Feb 2014 16:31:56 +0000 (16:31 +0000)
committerMike Taylor <mike@indexdata.com>
Tue, 11 Feb 2014 16:31:56 +0000 (16:31 +0000)
now also reduced to a one-line delegation to mkws.debug(). Nice to be
down to a single logging function.

tools/htdocs/mkws.js

index bd122e2..8fc2d89 100644 (file)
@@ -1116,16 +1116,8 @@ function team($, teamName) {
  * implement jQuery plugin $.pazpar2({})
  */
 function _mkws_jquery_plugin ($) {
-    var debug_level = 1;
-
     function debug (string) {
-       if (!debug_level)
-           return;
-
-       if (typeof console === "undefined" || typeof console.log === "undefined")
-           return;
-
-       console.log("jquery.pazpar2: " + string);
+       mkws.debug("jquery.pazpar2: " + string);
     }
 
     function init_popup(obj) {