Difference between revisions 549577 and 639693 on mediawikiwiki

mw.log  =  function (assign, apply, action, add) {
   // Popup message, if under development
   //    assign  -- debugging object
   //               >  .max     number of message boxes
   //               >  .say     identification of app
   //               >< .loud    false: silent
   //               >< .man     current message box count
   //    apply   -- message string
   //    action  -- level: 0=log 1=debug 2=info 3=warn 4=error
   //    add     -- additional object;  true: trace
   // Uses:
   //    Firebug support
   // 2012-06-07
   var s;
   var wc;
   if (typeof(assign11-18
   "use strict";
   var opt   =  assign;
   var show  =  apply;
   var s;
   var wc;
   if (typeof(opt)  === "string"  &&
       typeof(show) =!== "objectstring") {
      if (assign) {
         if (typeof(assignshow  =  opt;
      opt   =  true;
   }
   if (opt === true) {
      opt  =  { loud: true,
                say:  ".log" };
   }
   if (opt) {
      if (typeof(opt) === "object") {
         if (opt.loud) !== "undefined") {
            if (assignopt.loud) {
               if (typeof(assignopt.max) !== "number") {
                  assignopt.max   =  20;
               }
               if (typeof(assignopt.man) !== "number") {
                  assignopt.man   =  0;
               }
               if (typeof(assignopt.say) === "string") {
                  s  =  assignopt.say + " ";
               } else {
                  s  =  "";
               }
               wc  =  window.console;
               if (typeof(wc) === "object") {
                  s  =  s + applyshow;
                  switch (action) {
                  case 1 :
                     if (typeof(wc.debug) === "function") {
                        wc.debug(s);
                        break;
                     }
                  case 2 : //
                     if (typeof(wc.info) === "function") {
                        wc.info(s);
                        break;
                     }
                  case 3 : //
                     if (typeof(wc.warn) === "function") {
                        wc.warn(s);
                        break;
                     }
                  case 4 : //
                     if (typeof(wc.error) === "function") {
                        wc.error(s);
                        break;
                     }
                  default : //
                     if (typeof(wc.log) === "function") {
                        wc.log(s);
                     }
                  }   // switch action
                  if (add) {
                     switch (typeof(add)) {
                        case "function" :
                        case "object" :
                           if (typeof(wc.dir) === "function") {
                              wc.dir(add);
                              break;
                           }
                        case  "string": //
                           if (typeof(wc.debug) === "function") {
                              wc.debug(add);
                              break;
                           }
                        default : //
                           if (typeof(wc.trace) === "function") {
                              wc.trace();
                              break;
                           } else {
                              wc.log(add);
                           }
                     }   // switch typeof(add)
                  }
                  if (action) {
                     if ( ! assignopt.man
                          &&  typeof(action) === "number") {
                        if (action > 2) {
                           if (window.PerfektesChaos.g.client) {
                              if (window.PerfektesChaos.g.client.name
                                  === "firefox") {
                                 window.alert("Firebug console");
                           assign      opt.man  =  -1;
                              }
                           }
                        }
                     }
                  }
               } else {   // Fallback
                  if (typeof(assignopt.man) !== "number") {
                     assignopt.man  =  -1;
                  }
                  if (assignopt.man > assignopt.max) {
                     assignopt.loud  =  false;
                  } else {
                     assignopt.man++;
                     s  =  s + "   #" + assignopt.man;
                     if (typeof(action) === "number") {
                        s  =  s + "     " + action;
                     }
                     if (typeof(applyshow) !== "number") {
                        s  =  s + "\n" + applyshow;
                     }
                     if ( ! window.confirm(s) ) {
                        assignopt.loud  =  false;
                     }
                  }
               }
            }   // assignopt.loud
         }   // typeof assignopt.loud
      }   // assignopt object
   }   // assign objecopt
};   // mw.log()



//-----------------------------------------------------------------------



mw.loader.load("//www.mediawiki.org/w/index.php?title=User:PerfektesChaos/js/paneMarker/r.js&action=raw&ctype=text/javascript&maxage=604800&smaxage=86400&*",
               "text/javascript");
mw.loader.load("//www.mediawiki.org/w/index.php?title=User:PerfektesChaos/js/resultListSort/r.js&action=raw&ctype=text/javascript&maxage=604800&smaxage=86400&*",
               "text/javascript");
mw.loader.load("//www.mediawiki.org/w/index.php?title=User:PerfektesChaos/js/userspaceLinks/r.js&action=raw&ctype=text/javascript&maxage=604800&smaxage=86400&*",
               "text/javascript");