Difference between revisions 137366 and 137372 on testwikimw.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(assign) === "object") { if (assign) { if (typeof(assign.loud) !== "undefined") { if (assign.loud) { if (typeof(assign.max) !== "number") { assign.max = 20; } if (typeof(assign.man) !== "number") { assign.man = 0; } if (typeof(assign.say) === "string") { s = assign.say + " "; } else { s = ""; } wc = window.console; if (typeof(wc) === "object") { s = s + apply; 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 ( ! assign.man && typeof(action) === "number") { if (action > 2) { window.alert("Firebug console"); assign.man = -1; } } } } else { // Fallback if (typeof(assign.man) !== "number") { assign.man = -1; } if (assign.man > assign.max) { assign.loud = false; } else { assign.man++; s = s + " #" + assign.man; if (typeof(action) === "number") { s = s + " " + action; } if (typeof(apply) !== "number") { s = s + "\n" + apply; } if ( ! window.confirm(s) ) { assign.loud = false; } } } } // assign.loud } // typeof assign.loud } // assign } // assign object }; // mw.log() window.debugging = { loud: true, say: "## (test.PC) ##" }; mw.libs.paneMarker = { opt: { faviconICO: "https://secure.wikimedia.org/favicon.ico", faviconPNG: false } }; mw.loader.load("//www.mediawikitest.wikipedia.org/w/index.php?title=" + "User:PerfektesChaos/js/paneMarker/r.js" + "&action=raw&ctype=text/javascript&maxage=3600&smaxage=3600", "text/javascript"); All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://test.wikipedia.org/w/index.php?diff=prev&oldid=137372.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|