delogger 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cea3f747cb16e5f906aa834840cb2d2c0ca9ea28
4
- data.tar.gz: 2f4423f403d3d3a393f1fb86dfa5564958504393
3
+ metadata.gz: a5448716bba84b254c24535ea4a3c2f40313359b
4
+ data.tar.gz: fd6ad2d8beb3b8dc2bcf7c05ba65158ea62e5ff1
5
5
  SHA512:
6
- metadata.gz: af5de38ecdefe3016bb94a2fc3d4aa08f99150383d72a5af6544759ecc7e32edc1cb67e6430546796e8261a38abb71ad5d87ece0ca0f8c77a132652faea5f3f3
7
- data.tar.gz: 22d44db257bf782d4192e564fa5664dfdab7064a2deb33606fd0bc7da641656de6893dd28a4fad72f48e73351f8886f589836a21e510c4049bf7bc216d18cf31
6
+ metadata.gz: 86e4bc4123e81da17be37110abf354e7a6fd3dd0fc6b3dbdfb96aa8f15592f69e9389139f71e2b19a7a2beb20f4ccc62221d55c009799b0ec14086318ee44544
7
+ data.tar.gz: 29897cc4e6550e0ef03f45fa1bfbd74fe0cbd0822bf393f8f72cd174ed20f2b7ec4901dfa0a670476f04f72510e01452c48dca4fc13158d3fba180e04168b0fb
@@ -1,5 +1,5 @@
1
1
  module Delogger
2
2
  module Rails
3
- VERSION = "0.3.2"
3
+ VERSION = "0.3.3"
4
4
  end
5
5
  end
@@ -1 +1 @@
1
- (function(){var t=[].slice;this.Delogger=function(){function r(t){var r,e,o;null==t&&(t={}),o=null==t.enabledByDefault||t.enabledByDefault,e=null==t.enableFormatting||t.enableFormatting,r=null==t.collapseGroups||t.collapseGroups,this.settings={enabledByDefault:o,enableFormatting:e,collapseGroups:r},this.currentGroupStack=[],this.previousGroupStack=[]}var e;return e=["log","info","debug","warn","error","focus"],r.prototype.log=function(){return this.perform.apply(this,["log"].concat(t.call(arguments)))},r.prototype.info=function(){return this.perform.apply(this,["info"].concat(t.call(arguments)))},r.prototype.debug=function(){return this.perform.apply(this,["debug"].concat(t.call(arguments)))},r.prototype.warn=function(){return this.perform.apply(this,["warn"].concat(t.call(arguments)))},r.prototype.error=function(){return this.perform.apply(this,["error"].concat(t.call(arguments)))},r.prototype.assert=function(){return this.perform.apply(this,["assert"].concat(t.call(arguments)))},r.prototype.count=function(){return this.perform.apply(this,["count"].concat(t.call(arguments)))},r.prototype.dir=function(){return this.perform.apply(this,["dir"].concat(t.call(arguments)))},r.prototype.dirxml=function(){return this.perform.apply(this,["dirxml"].concat(t.call(arguments)))},r.prototype.profile=function(){return this.perform.apply(this,["profile"].concat(t.call(arguments)))},r.prototype.time=function(){return this.perform.apply(this,["time"].concat(t.call(arguments)))},r.prototype.timeEnd=function(){return this.perform("timeEnd")},r.prototype.trace=function(){return this.perform.apply(this,["trace"].concat(t.call(arguments)))},r.prototype.enable=function(){return localStorage.setItem("deloggerEnabled",!0)},r.prototype.disable=function(){return localStorage.removeItem("deloggerEnabled")},r.prototype.focus=function(){return arguments.length<1?localStorage.setItem("deloggerFocus",!0):this.perform.apply(this,["focus"].concat(t.call(arguments)))},r.prototype.unfocus=function(){return localStorage.removeItem("deloggerFocus")},r.prototype.group=function(){var r,e,o,n,l,c,a,u,i,p,s,f,h,g;if(g=1<=arguments.length?t.call(arguments,0):[],this.canPrint()){for(this.currentGroupStack=g,e=this.settings.collapseGroups?"groupCollapsed":"group",r=0,s=this.previousGroupStack,l=n=0,u=s.length;n<u;l=++n)p=s[l],p===this.currentGroupStack[l]&&(r+=1);if(o=this.previousGroupStack.length-r)for(c=1,f=o;1<=f?c<=f:c>=f;1<=f?c++:c--)console.groupEnd();for(h=this.currentGroupStack.slice(r),a=0,i=h.length;a<i;a++)p=h[a],console[e](p);return this}},r.prototype.perform=function(){var r,o,n,l,c;if(l=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=e.indexOf(l)>-1&&this.settings.enableFormatting?this.format.apply(this,[l].concat(t.call(r))):r,!this.currentGroupStack.length)for(n=1,c=this.previousGroupStack.length;1<=c?n<=c:n>=c;1<=c?n++:n--)console.groupEnd();this.print.apply(this,[l].concat(t.call(o))),this.previousGroupStack=this.currentGroupStack,this.currentGroupStack=[]},r.prototype.print=function(){var r,e;if(e=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],this.canPrint(e))return"focus"===e&&(e="log"),console[e].apply(console,r)},r.prototype.enabled=function(){return null!=localStorage.deloggerEnabled||this.settings.enabledByDefault},r.prototype.canPrint=function(t){return!!enabled&&("focus"===t||null==localStorage.deloggerFocus)},r.prototype.format=function(){var e,o,n,l,c,a,u,i,p,s,f,h,g,m,y,d;for(f=arguments[0],o=2<=arguments.length?t.call(arguments,1):[],d="",y=[],c=0,"focus"===f&&(d+="%cfocus%c ",y.push(computeStyle("badge focus")),y.push(computeStyle("default"))),u=0,p=o.length;u<p&&(e=o[u],l=r.Formatter.format(e),null!=l);u++)a=l[0],m=l[1],d+=a,y.push.apply(y,m),c+=1;for(o.splice(0,c),h=[d].concat(t.call(y),t.call(o)),g=[],i=0,s=h.length;i<s;i++)n=h[i],(null==n.length||n.length>0)&&g.push(n);return g},r}(),Delogger.Formatter=function(){function t(){}var r,e,o,n,l,c;return t.format=function(t){if("string"==typeof t)return o(t)},o=function(t){var o,n,c,a;for(a=[];r(t);)n=l(t),c=n.format.replacer||function(t,r){return"%c"+r+"%c"},o="string"==typeof n.format.classes?n.format.classes:n.format.classes(n.match),t=t.replace(n.format.regex,c),a.push(e(o)),a.push(e("default"));return[t,a]},r=function(t){var r,e,o;for(e=0,o=n.length;e<o;e++)if(r=n[e],r.regex.test(t))return!0;return!1},l=function(t){var r,e;return e=function(){var e,o,l;for(l=[],e=0,o=n.length;e<o;e++)r=n[e],r.regex.test(t)&&l.push({match:t.match(r.regex),format:r});return l}(),e.sort(function(t,r){return t.match.index-r.match.index})[0]},e=function(t){var r,e,o,n;return e=document.createElement("div"),e.id="delogger",e.className=t,e.style="display: none;",document.getElementsByTagName("body")[0].appendChild(e),r=getComputedStyle(e),n=function(){var t,e,n;for(n=[],t=0,e=c.length;t<e;t++)o=c[t],n.push(o+":"+r.getPropertyValue(o));return n}().join(";"),e.parentNode.removeChild(e),n},c=["margin","color","background-color","border-radius","padding","font-weight","font-style","text-decoration"],n=[{regex:/\*\*([^\*]+)\*\*/,classes:"bold"},{regex:/\*([^\*]+)\*/,classes:"italic"},{regex:/~([^~]+)~/,classes:"strikethrough"},{regex:/_([^_]+)_/,classes:"underline"},{regex:/\[([^\[\]]+)\](\.[\.\w]+)?(\{[^\{\}]+\})?/,classes:function(t){var r,e,o;return r=t[0],e=t[1],o=t[2],o.split(".").join(" ")}}],t}()}).call(this);
1
+ (function(){var t=[].slice;this.Delogger=function(){function r(t){var r,e,o;null==t&&(t={}),o=null==t.enabledByDefault||t.enabledByDefault,e=null==t.enableFormatting||t.enableFormatting,r=null==t.collapseGroups||t.collapseGroups,this.settings={enabledByDefault:o,enableFormatting:e,collapseGroups:r},this.currentGroupStack=[],this.previousGroupStack=[]}var e;return e=["log","info","debug","warn","error","focus"],r.prototype.log=function(){return this.perform.apply(this,["log"].concat(t.call(arguments)))},r.prototype.info=function(){return this.perform.apply(this,["info"].concat(t.call(arguments)))},r.prototype.debug=function(){return this.perform.apply(this,["debug"].concat(t.call(arguments)))},r.prototype.warn=function(){return this.perform.apply(this,["warn"].concat(t.call(arguments)))},r.prototype.error=function(){return this.perform.apply(this,["error"].concat(t.call(arguments)))},r.prototype.assert=function(){return this.perform.apply(this,["assert"].concat(t.call(arguments)))},r.prototype.count=function(){return this.perform.apply(this,["count"].concat(t.call(arguments)))},r.prototype.dir=function(){return this.perform.apply(this,["dir"].concat(t.call(arguments)))},r.prototype.dirxml=function(){return this.perform.apply(this,["dirxml"].concat(t.call(arguments)))},r.prototype.profile=function(){return this.perform.apply(this,["profile"].concat(t.call(arguments)))},r.prototype.time=function(){return this.perform.apply(this,["time"].concat(t.call(arguments)))},r.prototype.timeEnd=function(){return this.perform("timeEnd")},r.prototype.trace=function(){return this.perform.apply(this,["trace"].concat(t.call(arguments)))},r.prototype.enable=function(){return localStorage.setItem("deloggerEnabled",!0)},r.prototype.disable=function(){return localStorage.setItem("deloggerEnabled",!1)},r.prototype.focus=function(){return arguments.length<1?localStorage.setItem("deloggerFocus",!0):this.perform.apply(this,["focus"].concat(t.call(arguments)))},r.prototype.unfocus=function(){return localStorage.removeItem("deloggerFocus")},r.prototype.group=function(){var r,e,o,n,l,a,c,u,i,p,s,f,h,g;if(g=1<=arguments.length?t.call(arguments,0):[],this.canPrint()){for(this.currentGroupStack=g,e=this.settings.collapseGroups?"groupCollapsed":"group",r=0,s=this.previousGroupStack,l=n=0,u=s.length;n<u;l=++n)p=s[l],p===this.currentGroupStack[l]&&(r+=1);if(o=this.previousGroupStack.length-r)for(a=1,f=o;1<=f?a<=f:a>=f;1<=f?a++:a--)console.groupEnd();for(h=this.currentGroupStack.slice(r),c=0,i=h.length;c<i;c++)p=h[c],console[e](p);return this}},r.prototype.perform=function(){var r,o,n,l,a;if(l=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=e.indexOf(l)>-1&&this.settings.enableFormatting?this.format.apply(this,[l].concat(t.call(r))):r,!this.currentGroupStack.length)for(n=1,a=this.previousGroupStack.length;1<=a?n<=a:n>=a;1<=a?n++:n--)console.groupEnd();this.print.apply(this,[l].concat(t.call(o))),this.previousGroupStack=this.currentGroupStack,this.currentGroupStack=[]},r.prototype.print=function(){var r,e;if(e=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],this.canPrint(e))return"focus"===e&&(e="log"),console[e].apply(console,r)},r.prototype.enabled=function(){return null!=localStorage.deloggerEnabled?"false"!==localStorage.deloggerEnabled:this.settings.enabledByDefault},r.prototype.canPrint=function(t){return!!this.enabled()&&("focus"===t||null==localStorage.deloggerFocus)},r.prototype.format=function(){var e,o,n,l,a,c,u,i,p,s,f,h,g,m,d,y;for(f=arguments[0],o=2<=arguments.length?t.call(arguments,1):[],y="",d=[],a=0,"focus"===f&&(y+="%cfocus%c ",d.push(computeStyle("badge focus")),d.push(computeStyle("default"))),u=0,p=o.length;u<p&&(e=o[u],l=r.Formatter.format(e),null!=l);u++)c=l[0],m=l[1],y+=c,d.push.apply(d,m),a+=1;for(o.splice(0,a),h=[y].concat(t.call(d),t.call(o)),g=[],i=0,s=h.length;i<s;i++)n=h[i],(null==n.length||n.length>0)&&g.push(n);return g},r}(),Delogger.Formatter=function(){function t(){}var r,e,o,n,l,a;return t.format=function(t){if("string"==typeof t)return o(t)},o=function(t){var o,n,a,c;for(c=[];r(t);)n=l(t),a=n.format.replacer||function(t,r){return"%c"+r+"%c"},o="string"==typeof n.format.classes?n.format.classes:n.format.classes(n.match),t=t.replace(n.format.regex,a),c.push(e(o)),c.push(e("default"));return[t,c]},r=function(t){var r,e,o;for(e=0,o=n.length;e<o;e++)if(r=n[e],r.regex.test(t))return!0;return!1},l=function(t){var r,e;return e=function(){var e,o,l;for(l=[],e=0,o=n.length;e<o;e++)r=n[e],r.regex.test(t)&&l.push({match:t.match(r.regex),format:r});return l}(),e.sort(function(t,r){return t.match.index-r.match.index})[0]},e=function(t){var r,e,o,n;return e=document.createElement("div"),e.id="delogger",e.className=t,e.style="display: none;",document.getElementsByTagName("body")[0].appendChild(e),r=getComputedStyle(e),n=function(){var t,e,n;for(n=[],t=0,e=a.length;t<e;t++)o=a[t],n.push(o+":"+r.getPropertyValue(o));return n}().join(";"),e.parentNode.removeChild(e),n},a=["margin","color","background-color","border-radius","padding","font-weight","font-style","text-decoration"],n=[{regex:/\*\*([^\*]+)\*\*/,classes:"bold"},{regex:/\*([^\*]+)\*/,classes:"italic"},{regex:/~([^~]+)~/,classes:"strikethrough"},{regex:/_([^_]+)_/,classes:"underline"},{regex:/\[([^\[\]]+)\](\.[\.\w]+)?(\{[^\{\}]+\})?/,classes:function(t){var r,e,o;return r=t[0],e=t[1],o=t[2],o.split(".").join(" ")}}],t}()}).call(this);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delogger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Komarov