vendor/assets/javascripts/delogger.js in delogger-0.3.0.alpha2 vs vendor/assets/javascripts/delogger.js in delogger-0.3.0.alpha3
- old
+ new
@@ -1 +1 @@
-(function(){var t=[].slice;this.DeLogger=function(){function n(t){var n,e;null==t&&(t={}),n=t.disabled||!1,e=null==t.formatStrings||t.formatStrings,this.settings={disabled:n,formatStrings:e}}var e,r,o;return n.prototype.log=function(){return this.print.apply(this,["log"].concat(t.call(arguments)))},n.prototype.info=function(){return this.print.apply(this,["info"].concat(t.call(arguments)))},n.prototype.debug=function(){return this.print.apply(this,["debug"].concat(t.call(arguments)))},n.prototype.warn=function(){return this.print.apply(this,["warn"].concat(t.call(arguments)))},n.prototype.error=function(){return this.print.apply(this,["error"].concat(t.call(arguments)))},n.prototype.enable=function(){return localStorage.setItem("deloggerEnabled",!0)},n.prototype.disable=function(){return localStorage.removeItem("deloggerEnabled")},n.prototype.print=function(){var n,e,o,l,i,a,c,p,s,u,g;if(a=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],this.canPrint()){for(g="",u=[],o=0,l=0,i=e.length;l<i&&(n=e[l],"string"==typeof n&&this.settings.formatStrings);l++)c=r(n),p=c[0],s=c[1],g+=p,u.push.apply(u,s),o+=1;return e.splice(0,o),console[a].apply(console,[g].concat(t.call(u),t.call(e)))}},n.prototype.canPrint=function(){return!this.settings.disabled&&null!=localStorage.deloggerEnabled},r=function(t){var n,r,o;for(n=[],o=/\(([^\(\)]+)\)(\.[\.\w]+)/;r=t.match(o);)n.push(e(r[2].split(".").join(" "))),n.push(e("default")),t=t.replace(o,"%c"+r[1]+"%c");return[t,n]},e=function(t){var n,e,r,l;return e=document.createElement("div"),e.id="delogger",e.className=t,e.style="display: none;",document.getElementsByTagName("body")[0].appendChild(e),n=getComputedStyle(e),l=function(){var t,e,l;for(l=[],t=0,e=o.length;t<e;t++)r=o[t],l.push(r+":"+n.getPropertyValue(r));return l}().join(";"),e.parentNode.removeChild(e),l},o=["margin-right","color","background-color","border-radius","padding","font-weight","font-style"],n}()}).call(this);
+(function(){var t=[].slice;this.DeLogger=function(){function e(t){var e,o;null==t&&(t={}),e=t.disabled||!1,o=null==t.formatStrings||t.formatStrings,this.settings={disabled:e,formatStrings:o}}var o,n,r;return e.prototype.log=function(){return this.print.apply(this,["log"].concat(t.call(arguments)))},e.prototype.info=function(){return this.print.apply(this,["info"].concat(t.call(arguments)))},e.prototype.debug=function(){return this.print.apply(this,["debug"].concat(t.call(arguments)))},e.prototype.warn=function(){return this.print.apply(this,["warn"].concat(t.call(arguments)))},e.prototype.error=function(){return this.print.apply(this,["error"].concat(t.call(arguments)))},e.prototype.enable=function(){return localStorage.setItem("deloggerEnabled",!0)},e.prototype.disable=function(){return localStorage.removeItem("deloggerEnabled")},e.prototype.focus=function(){return arguments.length<1?localStorage.setItem("deloggerFocus",!0):this.print.apply(this,["focus"].concat(t.call(arguments)))},e.prototype.unfocus=function(){return localStorage.removeItem("deloggerFocus")},e.prototype.print=function(){var e,r,l,a,c,i,u,p,s,g,d;if(i=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],this.canPrint(i)){for(d="",g=[],l=0,"focus"===i&&(d+="%cFOCUS%c ",g.push(o("badge blue bold")),g.push(o("default"))),a=0,c=r.length;a<c&&(e=r[a],"string"==typeof e&&this.settings.formatStrings);a++)u=n(e),p=u[0],s=u[1],d+=p,g.push.apply(g,s),l+=1;return r.splice(0,l),"focus"===i&&(i="log"),console[i].apply(console,[d].concat(t.call(g),t.call(r)))}},e.prototype.canPrint=function(t){return!this.settings.disabled&&null!=localStorage.deloggerEnabled&&("focus"===t||null==localStorage.deloggerFocus)},n=function(t){var e,n,r;for(e=[],r=/\(([^\(\)]+)\)(\.[\.\w]+)/;n=t.match(r);)e.push(o(n[2].split(".").join(" "))),e.push(o("default")),t=t.replace(r,"%c"+n[1]+"%c");return[t,e]},o=function(t){var e,o,n,l;return o=document.createElement("div"),o.id="delogger",o.className=t,o.style="display: none;",document.getElementsByTagName("body")[0].appendChild(o),e=getComputedStyle(o),l=function(){var t,o,l;for(l=[],t=0,o=r.length;t<o;t++)n=r[t],l.push(n+":"+e.getPropertyValue(n));return l}().join(";"),o.parentNode.removeChild(o),l},r=["margin-right","color","background-color","border-radius","padding","font-weight","font-style"],e}()}).call(this);
\ No newline at end of file