User:Year2000Prob/Y2P.Debug.js

Y2P.Debug = new Object;

if (!Y2P.Debug.Retry) Y2P.Debug.Retry = function(message, options) { this.acceptHandler = function { document.getElementById("mw-js-message").parentNode.removeChild(document.getElementById("mw-js-message")); if (options && options.onAccept && typeof options.onAccept == "function") { Y2P.Debug._OnAccept = options.onAccept; window.setTimeout('Y2P.Debug._OnAccept', 1000); } };  this.declineHandler = function { document.getElementById("mw-js-message").parentNode.removeChild(document.getElementById("mw-js-message")); if (options && options.onDecline && typeof options.onDecline == "function") { Y2P.Debug._OnDecline = options.onDecline; window.setTimeout('Y2P.Debug._OnDecline', 1000); } };  if (typeof jsMsg == "function") { jsMsg(message.replace("\n", " ") + "

Try again? ");   document.getElementById("y2p-retry-yes").addEventListener("click", this.acceptHandler, false);    document.getElementById("y2p-retry-no").addEventListener("click", this.declineHandler, false);  } else {    switch (confirm(message + "\n\nTry again?")) {      case true: this.acceptHandler;      case false: this.declineHandler;    };  } };

if (!Y2P.Debug.Error) Y2P.Debug.Error = function(message) { if (typeof jsMsg == "function") { jsMsg(message.replace("\n", " ")); window.setTimeout('document.getElementById("mw-js-message").parentNode.removeChild(document.getElementById("mw-js-message"))', 5000); } else alert(message); };

Y2P.Debug.Enabled = true;