logalize 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -12
- data/lib/logalize/rails/version.rb +1 -1
- data/vendor/assets/javascripts/logalize.js +933 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec24c396b3ace8f4ce04bc243fba2d9dba12bb0e
|
4
|
+
data.tar.gz: a14459608f35ec9caed408bf3a091b38db94aa0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e2447b23a781c39453f0472460f57faf011b673dae3d027e5dbbcb4048067d52c1e06a875e482408c0bb4b46990726879b1b57386256b3b598436c493f08fa2
|
7
|
+
data.tar.gz: 880942097f1de3da7e7a7dbda8606ab93ac8a1589e4c1ee7037db8ea04005039865231489d34e5270972d2759ab95314a2ad082ec2973c3fa63a8e174af53153
|
data/README.md
CHANGED
@@ -81,7 +81,6 @@ logalize.log('my output')
|
|
81
81
|
logalize.configure({
|
82
82
|
enabled: true,
|
83
83
|
enableFormatting: true,
|
84
|
-
enableConsoleHooks: true,
|
85
84
|
collapseNamespaces: false
|
86
85
|
})
|
87
86
|
```
|
@@ -89,11 +88,6 @@ logalize.configure({
|
|
89
88
|
When Logalize is disabled, it will not produce any output. However, lambda versions of `profile`, `time`, `group` and `namespace`
|
90
89
|
will still execute given functions. Default: `true`.
|
91
90
|
- `enableFormatting`: Defines whether [formatting](#formatting) should be enabled. Default: `true`.
|
92
|
-
- `enableConsoleHooks`: Defines whether Logalize needs to modify `console`.
|
93
|
-
Generally, modifying global objects is a bad thing to do, but this is required if you want Logalize to
|
94
|
-
handle console output correctly. Logalize is modifying `console` functions *very carefully* (it just
|
95
|
-
needs to hook to those methods). You can safely disable this options, but regular console output
|
96
|
-
will occasionally get stuck inside groups it does not belong to. see [known issues](#known-issues). Default: `true`.
|
97
91
|
- `collapseNamespaces`: Defines whether [namespaces](#namespaces) should use `group` or `groupCollapsed` method.
|
98
92
|
Defaults to `false` (`group`).
|
99
93
|
|
@@ -164,12 +158,8 @@ At the moment, only these attributes are supported: `margin`, `color`, `backgrou
|
|
164
158
|
## Known issues
|
165
159
|
|
166
160
|
- **There's no way to detect when console output happens**. Development tools are separate from `window` and `document`,
|
167
|
-
and there is no way to know if the output is happening.
|
168
|
-
|
169
|
-
say, an error thrown with `throw` is going to appear in console. Groups are implemented in such a way that they don't get closed
|
170
|
-
until it's necessary, so that leads to console output being stuck inside groups it doesn't belong to.
|
171
|
-
Part of the problem is solved by modifying `console`, but another part is not solvable without a browser extension.
|
172
|
-
So, **some output will inevitably get stuck in a group it doesn't belong**.
|
161
|
+
and there is no way to know if the output is happening.
|
162
|
+
So, some output will inevitably get stuck in a group it doesn't belong.
|
173
163
|
|
174
164
|
- **Stack traces from `logalize.error` and `logalize.trace` contain unneeded information**.
|
175
165
|
Since `logalize.error` and `logalize.trace` call some functions under the hood, the stack trace produced
|
@@ -1 +1,933 @@
|
|
1
|
-
!function(e){function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}var t={};o.m=e,o.c=t,o.i=function(e){return e},o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},o.p="",o(o.s=7)}([function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var r={log:console.log,debug:console.debug,info:console.info,warn:console.warn,error:console.error,group:console.group,groupCollapsed:console.groupCollapsed,groupEnd:console.groupEnd,assert:console.assert,count:console.count,clear:console.clear,dir:console.dir,dirxml:console.dirxml,profile:console.profile,profileEnd:console.profileEnd,time:console.time,timeEnd:console.timeEnd,timeStamp:console.timeStamp,trace:console.trace};o.default=r},function(e,o,t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function n(e){if(Array.isArray(e)){for(var o=0,t=Array(e.length);o<e.length;o++)t[o]=e[o];return t}return Array.from(e)}function l(){for(var e=arguments.length,o=Array(e),t=0;t<e;t++)o[t]=arguments[t];l.print.apply(l,["log"].concat(o))}Object.defineProperty(o,"__esModule",{value:!0});var a=t(0),i=r(a),c=t(2),u=r(c),s=t(3),f=r(s),d=t(5),p=r(d);Object.assign(l,{init:function(){this.configure()},configure:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=e.enabled,t=void 0===o||o,r=e.enableFormatting,n=void 0===r||r,l=e.enableConsoleHooks,a=void 0===l||l,i=e.collapseNamespaces,c=void 0!==i&&i;Object.assign(this,{enabled:t,enableFormatting:n,enableConsoleHooks:a,collapseNamespaces:c,formattableMethods:["log","info","debug","warn","error","focus"]}),this.enableFormatting?this.appendStylesToDOM():this.removeStylesFromDOM(),this.enableConsoleHooks?this.setupConsoleHooks():this.removeConsoleHooks(),f.default.configure({loggingEnabled:this.isEnabled(),collapsed:this.collapseNamespaces})},namespace:function(){var e,o=f.default.setNamespace.apply(f.default,arguments);return"function"==(e=arguments.length-1,typeof(arguments.length<=e?void 0:arguments[e]))?o:this},log:function(){this.print.apply(this,["log"].concat(Array.prototype.slice.call(arguments)))},debug:function(){this.print.apply(this,["debug"].concat(Array.prototype.slice.call(arguments)))},info:function(){this.print.apply(this,["info"].concat(Array.prototype.slice.call(arguments)))},warn:function(){this.print.apply(this,["warn"].concat(Array.prototype.slice.call(arguments)))},error:function(){this.print.apply(this,["error"].concat(Array.prototype.slice.call(arguments)))},assert:function(){this.print.apply(this,["assert"].concat(Array.prototype.slice.call(arguments)))},count:function(e){this.print("count",e)},dir:function(e){this.print("dir",e)},dirxml:function(e){this.print("dirxml",e)},profile:function(){for(var e=arguments.length,o=Array(e),t=0;t<e;t++)o[t]=arguments[t];var r=o.pop();if("function"==typeof r){this.isEnabled()&&i.default.profile(o[0]);var n=r();return this.isEnabled()&&this.profileEnd(),n}this.isEnabled()&&i.default.profile(o[0])},profileEnd:function(){this.isEnabled()&&i.default.profileEnd()},time:function(){for(var e=arguments.length,o=Array(e),t=0;t<e;t++)o[t]=arguments[t];var r=o.pop();if("function"==typeof r){this.isEnabled()&&i.default.time(o[0]);var n=r();return this.isEnabled()&&this.timeEnd(o[0]),n}this.isEnabled()&&i.default.time(o[0])},timeEnd:function(e){this.isEnabled()&&i.default.timeEnd(e)},timeStamp:function(e){this.isEnabled()&&i.default.timeStamp(e)},trace:function(e){this.print("trace",e)},group:function(){for(var e=arguments.length,o=Array(e),t=0;t<e;t++)o[t]=arguments[t];var r=o.pop();if("function"==typeof r){this.isEnabled()&&i.default.group.apply(i.default,n(o));var l=r();return this.isEnabled()&&this.groupEnd(),l}this.isEnabled()&&i.default.group.apply(i.default,n(o).concat([r]))},groupCollapsed:function(){for(var e=arguments.length,o=Array(e),t=0;t<e;t++)o[t]=arguments[t];var r=o.pop();if("function"==typeof r){this.isEnabled()&&i.default.groupCollapsed.apply(i.default,n(o));var l=r();return this.isEnabled()&&this.groupEnd(),l}this.isEnabled()&&i.default.groupCollapsed.apply(i.default,n(o).concat([r]))},groupEnd:function(){this.isEnabled()&&i.default.groupEnd()},print:function(e){for(var o=arguments.length,t=Array(o>1?o-1:0),r=1;r<o;r++)t[r-1]=arguments[r];this.isEnabled()&&(this.formattableMethods.indexOf(e)>-1&&this.enableFormatting&&(t=u.default.format(t)),f.default.group(),i.default[e].apply(i.default,n(t)))},enable:function(){localStorage&&localStorage.setItem("logalizeEnabled","true"),f.default.configure({loggingEnabled:this.isEnabled()})},disable:function(){localStorage&&localStorage.setItem("logalizeEnabled","false"),f.default.configure({loggingEnabled:this.isEnabled()})},isEnabled:function(){return localStorage&&localStorage.logalizeEnabled?"false"!==localStorage.logalizeEnabled:this.enabled},setupConsoleHooks:function(){var e=this;console.log=function(){e.performConsoleAction("log",arguments)},console.debug=function(){e.performConsoleAction("debug",arguments)},console.info=function(){e.performConsoleAction("info",arguments)},console.warn=function(){e.performConsoleAction("warn",arguments)},console.error=function(){e.performConsoleAction("error",arguments)},console.assert=function(){e.performConsoleAction("assert",arguments)},console.count=function(){e.performConsoleAction("count",arguments)},console.dir=function(){e.performConsoleAction("dir",arguments)},console.dirxml=function(){e.performConsoleAction("dirxml",arguments)},console.group=function(){e.performConsoleAction("group",arguments)},console.groupCollapsed=function(){e.performConsoleAction("groupCollapsed",arguments)},console.groupEnd=function(){e.performConsoleAction("groupEnd",arguments)},console.profile=function(){e.performConsoleAction("profile",arguments)},console.profileEnd=function(){e.performConsoleAction("profileEnd",arguments)},console.time=function(){e.performConsoleAction("time",arguments)},console.timeEnd=function(){e.performConsoleAction("timeEnd",arguments)},console.timeStamp=function(){e.performConsoleAction("timeStamp",arguments)},console.trace=function(){e.performConsoleAction("trace",arguments)},console.clear=function(){e.performConsoleAction("clear",arguments)}},removeConsoleHooks:function(){console.log=i.default.log,console.debug=i.default.debug,console.info=i.default.info,console.warn=i.default.warn,console.error=i.default.error,console.assert=i.default.assert,console.count=i.default.count,console.dir=i.default.dir,console.dirxml=i.default.dirxml,console.group=i.default.group,console.groupCollapsed=i.default.groupCollapsed,console.groupEnd=i.default.groupEnd,console.profile=i.default.profile,console.profileEnd=i.default.profileEnd,console.time=i.default.time,console.timeEnd=i.default.timeEnd,console.timeStamp=i.default.timeStamp,console.trace=i.default.trace,console.clear=i.default.clear},performConsoleAction:function(e,o){return f.default.clear(),i.default[e].apply(i.default,n(o))},appendStylesToDOM:function(){if(!document.getElementById("logalize-stylesheet")){var e=document.createElement("style");e.id="logalize-stylesheet",e.innerHTML=p.default.toString(),document.head.insertBefore(e,document.head.firstChild)}},removeStylesFromDOM:function(){var e=document.getElementById("logalize-stylesheet");e&&e.remove()}}),o.default=l},function(e,o,t){"use strict";function r(e){if(Array.isArray(e)){for(var o=0,t=Array(e.length);o<e.length;o++)t[o]=e[o];return t}return Array.from(e)}Object.defineProperty(o,"__esModule",{value:!0});var n={format:function(e){var o,t,n=[],l=[],a=0,i=!0,c=!1,u=void 0;try{for(var s,f=e[Symbol.iterator]();!(i=(s=f.next()).done);i=!0){var d=s.value;if(void 0===(d=this.formatObject(d))||!d[1].length)break;n.push(d[0]),l.push.apply(l,r(d[1])),a+=1}}catch(e){c=!0,u=e}finally{try{!i&&f.return&&f.return()}finally{if(c)throw u}}if(e.splice(0,a),t=[],n.length){var p;t.push(n.join(" ")),(p=t).push.apply(p,l)}return(o=t).push.apply(o,r(e)),t},formatObject:function(e){if("string"==typeof e)return this.formatString(e)},formatString:function(e){for(var o,t=[];this.canFormat(e);){var r=this.getRelevantMatch(e);o="string"==typeof r.format.classes?r.format.classes:r.format.classes(r.match),e=e.replace(r.format.regex,function(e,o){return"%c"+o+"%c"}),t.push(this.computeStyle(o)),t.push(this.computeStyle("default"))}return[e,t]},canFormat:function(e){var o=!0,t=!1,r=void 0;try{for(var n,l=this.formats[Symbol.iterator]();!(o=(n=l.next()).done);o=!0){if(n.value.regex.test(e))return!0}}catch(e){t=!0,r=e}finally{try{!o&&l.return&&l.return()}finally{if(t)throw r}}return!1},getRelevantMatch:function(e){var o=[],t=!0,r=!1,n=void 0;try{for(var l,a=this.formats[Symbol.iterator]();!(t=(l=a.next()).done);t=!0){var i=l.value;i.regex.test(e)&&o.push({match:e.match(i.regex),format:i})}}catch(e){r=!0,n=e}finally{try{!t&&a.return&&a.return()}finally{if(r)throw n}}return o.sort(function(e,o){return e.match.index-o.match.index})[0]},computeStyle:function(e){var o=document.createElement("div");o.id="logalize",o.className=e,document.getElementsByTagName("body")[0].appendChild(o);var t=getComputedStyle(o),r=[],n=!0,l=!1,a=void 0;try{for(var i,c=this.supportedStyles[Symbol.iterator]();!(n=(i=c.next()).done);n=!0){var u=i.value;r.push(u+":"+t.getPropertyValue(u))}}catch(e){l=!0,a=e}finally{try{!n&&c.return&&c.return()}finally{if(l)throw a}}return o.remove(),r.join(";")},supportedStyles:["margin","color","background-color","border-radius","padding","font-weight","font-style","text-decoration"],formats:[{regex:/\*\*([^\*]+)\*\*/,classes:"bold"},{regex:/\*([^\*]+)\*/,classes:"italic"},{regex:/~([^~]+)~/,classes:"strikethrough"},{regex:/_([^_]+)_/,classes:"underline"},{regex:/\[([^\[\]]+)\](\.[\.\w]+)?/,classes:function(e){var o="badge";return e[2]&&(o+=e[2]&&e[2].split(".").join(" ")),o}},{regex:/\{([^\{\}]+)\}(\.[\.\w]+)/,classes:function(e){return e[2].split(".").join(" ")}}]};o.default=n},function(e,o,t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function n(e){if(Array.isArray(e)){for(var o=0,t=Array(e.length);o<e.length;o++)t[o]=e[o];return t}return Array.from(e)}Object.defineProperty(o,"__esModule",{value:!0});var l=function(){function e(e,o){var t=[],r=!0,n=!1,l=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(t.push(a.value),!o||t.length!==o);r=!0);}catch(e){n=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(n)throw l}}return t}return function(o,t){if(Array.isArray(o))return o;if(Symbol.iterator in Object(o))return e(o,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=t(0),i=r(a),c=t(4),u={clojureStack:[],currentStack:[],previousStack:[],configure:function(e){Object.assign(this,e),this.clear(),this.currentStack=[]},setNamespace:function(){for(var e=this,o=arguments.length,t=Array(o),r=0;r<o;r++)t[r]=arguments[r];if("function"==typeof t[t.length-1]){var n=t.pop();this.loggingEnabled&&this.clojureStack.push(t);var l=n();if(this.loggingEnabled){this.clojureStack.pop().forEach(function(){e.previousStack.pop(),i.default.groupEnd()})}return l}this.loggingEnabled&&this.currentStack.push(t)},group:function(){for(var e=[],o=[].concat(n(this.clojureStack),n(this.currentStack)),t=0;t<o.length;t++){var r=o[t];e.push.apply(e,n(r))}if(!(0,c.compareArrays)(this.previousStack,e)){var a=0,u=!0,s=!1,f=void 0;try{for(var d,p=this.previousStack.entries()[Symbol.iterator]();!(u=(d=p.next()).done);u=!0){var g=d.value,h=l(g,2),m=h[0];if(h[1]!==e[m])break;a+=1}}catch(e){s=!0,f=e}finally{try{!u&&p.return&&p.return()}finally{if(s)throw f}}for(var y=this.previousStack.length-a,v=0;v<y;v++)i.default.groupEnd();var b=e.slice(a),E=!0,S=!1,A=void 0;try{for(var x,k=b[Symbol.iterator]();!(E=(x=k.next()).done);E=!0){var C=x.value;i.default[this._groupingMethod()](C)}}catch(e){S=!0,A=e}finally{try{!E&&k.return&&k.return()}finally{if(S)throw A}}}this.previousStack=e,this.currentStack=[]},clear:function(){[].concat(n(this.clojureStack),n(this.currentStack),n(this.previousStack)).forEach(function(){return i.default.groupEnd()}),this.previousStack=[]},_groupingMethod:function(){return this.collapsed?"groupCollapsed":"group"}};o.default=u},function(e,o,t){"use strict";function r(e,o){if(e.length!==o.length)return!1;var t=!0,l=!1,a=void 0;try{for(var i,c=e.entries()[Symbol.iterator]();!(t=(i=c.next()).done);t=!0){var u=i.value,s=n(u,2),f=s[0],d=s[1];if(d instanceof Array&&o[f]instanceof Array){if(!r(d,o[f]))return!1}else if(d!==o[f])return!1}}catch(e){l=!0,a=e}finally{try{!t&&c.return&&c.return()}finally{if(l)throw a}}return!0}Object.defineProperty(o,"__esModule",{value:!0});var n=function(){function e(e,o){var t=[],r=!0,n=!1,l=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(t.push(a.value),!o||t.length!==o);r=!0);}catch(e){n=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(n)throw l}}return t}return function(o,t){if(Array.isArray(o))return o;if(Symbol.iterator in Object(o))return e(o,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();o.compareArrays=r},function(e,o,t){o=e.exports=t(6)(),o.push([e.i,"#logalize{color:#000;background-color:transparent;border-radius:0;padding:0;margin:0;font-weight:400;font-style:normal;display:none}#logalize.badge{color:#fff;background-color:#000;border-radius:3px;padding:2px;margin:0 2px}#logalize.badge.blue{color:#fff;background-color:#61afef}#logalize.badge.orange{color:#fff;background-color:#d19a66}#logalize.badge.red{color:#fff;background-color:#e06c75}#logalize.badge.green{color:#fff;background-color:#98c379}#logalize.badge.cyan{color:#fff;background-color:#56b6c2}#logalize.badge.purple{color:#fff;background-color:#c678dd}#logalize.badge.focus{color:#bada55;background:#444}#logalize.blue{color:#4078f2}#logalize.orange{color:#986801}#logalize.red{color:#e45649}#logalize.green{color:#50a14f}#logalize.cyan{color:#0184bc}#logalize.purple{color:#a626a4}#logalize.bold{font-weight:700}#logalize.italic{font-style:italic}#logalize.strikethrough{text-decoration:line-through}#logalize.underline{text-decoration:underline}",""])},function(e,o){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],o=0;o<this.length;o++){var t=this[o];t[2]?e.push("@media "+t[2]+"{"+t[1]+"}"):e.push(t[1])}return e.join("")},e.i=function(o,t){"string"==typeof o&&(o=[[null,o,""]]);for(var r={},n=0;n<this.length;n++){var l=this[n][0];"number"==typeof l&&(r[l]=!0)}for(n=0;n<o.length;n++){var a=o[n];"number"==typeof a[0]&&r[a[0]]||(t&&!a[2]?a[2]=t:t&&(a[2]="("+a[2]+") and ("+t+")"),e.push(a))}},e}},function(e,o,t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var n=t(1),l=r(n);window.logalize=l.default,window.logalize.init()}]);
|
1
|
+
/******/ (function(modules) { // webpackBootstrap
|
2
|
+
/******/ // The module cache
|
3
|
+
/******/ var installedModules = {};
|
4
|
+
|
5
|
+
/******/ // The require function
|
6
|
+
/******/ function __webpack_require__(moduleId) {
|
7
|
+
|
8
|
+
/******/ // Check if module is in cache
|
9
|
+
/******/ if(installedModules[moduleId])
|
10
|
+
/******/ return installedModules[moduleId].exports;
|
11
|
+
|
12
|
+
/******/ // Create a new module (and put it into the cache)
|
13
|
+
/******/ var module = installedModules[moduleId] = {
|
14
|
+
/******/ i: moduleId,
|
15
|
+
/******/ l: false,
|
16
|
+
/******/ exports: {}
|
17
|
+
/******/ };
|
18
|
+
|
19
|
+
/******/ // Execute the module function
|
20
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
21
|
+
|
22
|
+
/******/ // Flag the module as loaded
|
23
|
+
/******/ module.l = true;
|
24
|
+
|
25
|
+
/******/ // Return the exports of the module
|
26
|
+
/******/ return module.exports;
|
27
|
+
/******/ }
|
28
|
+
|
29
|
+
|
30
|
+
/******/ // expose the modules object (__webpack_modules__)
|
31
|
+
/******/ __webpack_require__.m = modules;
|
32
|
+
|
33
|
+
/******/ // expose the module cache
|
34
|
+
/******/ __webpack_require__.c = installedModules;
|
35
|
+
|
36
|
+
/******/ // identity function for calling harmony imports with the correct context
|
37
|
+
/******/ __webpack_require__.i = function(value) { return value; };
|
38
|
+
|
39
|
+
/******/ // define getter function for harmony exports
|
40
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
41
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
42
|
+
/******/ Object.defineProperty(exports, name, {
|
43
|
+
/******/ configurable: false,
|
44
|
+
/******/ enumerable: true,
|
45
|
+
/******/ get: getter
|
46
|
+
/******/ });
|
47
|
+
/******/ }
|
48
|
+
/******/ };
|
49
|
+
|
50
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
51
|
+
/******/ __webpack_require__.n = function(module) {
|
52
|
+
/******/ var getter = module && module.__esModule ?
|
53
|
+
/******/ function getDefault() { return module['default']; } :
|
54
|
+
/******/ function getModuleExports() { return module; };
|
55
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
56
|
+
/******/ return getter;
|
57
|
+
/******/ };
|
58
|
+
|
59
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
60
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
61
|
+
|
62
|
+
/******/ // __webpack_public_path__
|
63
|
+
/******/ __webpack_require__.p = "";
|
64
|
+
|
65
|
+
/******/ // Load entry module and return exports
|
66
|
+
/******/ return __webpack_require__(__webpack_require__.s = 7);
|
67
|
+
/******/ })
|
68
|
+
/************************************************************************/
|
69
|
+
/******/ ([
|
70
|
+
/* 0 */
|
71
|
+
/***/ (function(module, exports, __webpack_require__) {
|
72
|
+
|
73
|
+
"use strict";
|
74
|
+
|
75
|
+
|
76
|
+
Object.defineProperty(exports, "__esModule", {
|
77
|
+
value: true
|
78
|
+
});
|
79
|
+
var BrowserAdapter = {
|
80
|
+
// Basic logging
|
81
|
+
log: function log() {
|
82
|
+
var _console;
|
83
|
+
|
84
|
+
(_console = console).log.apply(_console, arguments);
|
85
|
+
},
|
86
|
+
debug: function debug() {
|
87
|
+
var _console2;
|
88
|
+
|
89
|
+
(_console2 = console).debug.apply(_console2, arguments);
|
90
|
+
},
|
91
|
+
info: function info() {
|
92
|
+
var _console3;
|
93
|
+
|
94
|
+
(_console3 = console).info.apply(_console3, arguments);
|
95
|
+
},
|
96
|
+
warn: function warn() {
|
97
|
+
var _console4;
|
98
|
+
|
99
|
+
(_console4 = console).warn.apply(_console4, arguments);
|
100
|
+
},
|
101
|
+
error: function error() {
|
102
|
+
var _console5;
|
103
|
+
|
104
|
+
(_console5 = console).error.apply(_console5, arguments);
|
105
|
+
},
|
106
|
+
|
107
|
+
// Grouping
|
108
|
+
group: function group() {
|
109
|
+
var _console6;
|
110
|
+
|
111
|
+
(_console6 = console).group.apply(_console6, arguments);
|
112
|
+
},
|
113
|
+
groupCollapsed: function groupCollapsed() {
|
114
|
+
var _console7;
|
115
|
+
|
116
|
+
(_console7 = console).groupCollapsed.apply(_console7, arguments);
|
117
|
+
},
|
118
|
+
groupEnd: function groupEnd() {
|
119
|
+
var _console8;
|
120
|
+
|
121
|
+
(_console8 = console).groupEnd.apply(_console8, arguments);
|
122
|
+
},
|
123
|
+
|
124
|
+
// Misc
|
125
|
+
assert: function assert() {
|
126
|
+
var _console9;
|
127
|
+
|
128
|
+
(_console9 = console).assert.apply(_console9, arguments);
|
129
|
+
},
|
130
|
+
count: function count() {
|
131
|
+
var _console10;
|
132
|
+
|
133
|
+
(_console10 = console).count.apply(_console10, arguments);
|
134
|
+
},
|
135
|
+
clear: function clear() {
|
136
|
+
var _console11;
|
137
|
+
|
138
|
+
(_console11 = console).clear.apply(_console11, arguments);
|
139
|
+
},
|
140
|
+
dir: function dir() {
|
141
|
+
var _console12;
|
142
|
+
|
143
|
+
(_console12 = console).dir.apply(_console12, arguments);
|
144
|
+
},
|
145
|
+
dirxml: function dirxml() {
|
146
|
+
var _console13;
|
147
|
+
|
148
|
+
(_console13 = console).dirxml.apply(_console13, arguments);
|
149
|
+
},
|
150
|
+
profile: function profile() {
|
151
|
+
var _console14;
|
152
|
+
|
153
|
+
(_console14 = console).profile.apply(_console14, arguments);
|
154
|
+
},
|
155
|
+
profileEnd: function profileEnd() {
|
156
|
+
var _console15;
|
157
|
+
|
158
|
+
(_console15 = console).profileEnd.apply(_console15, arguments);
|
159
|
+
},
|
160
|
+
time: function time() {
|
161
|
+
var _console16;
|
162
|
+
|
163
|
+
(_console16 = console).time.apply(_console16, arguments);
|
164
|
+
},
|
165
|
+
timeEnd: function timeEnd() {
|
166
|
+
var _console17;
|
167
|
+
|
168
|
+
(_console17 = console).timeEnd.apply(_console17, arguments);
|
169
|
+
},
|
170
|
+
timeStamp: function timeStamp() {
|
171
|
+
var _console18;
|
172
|
+
|
173
|
+
(_console18 = console).timeStamp.apply(_console18, arguments);
|
174
|
+
},
|
175
|
+
trace: function trace() {
|
176
|
+
var _console19;
|
177
|
+
|
178
|
+
(_console19 = console).trace.apply(_console19, arguments);
|
179
|
+
}
|
180
|
+
};
|
181
|
+
|
182
|
+
exports.default = BrowserAdapter;
|
183
|
+
|
184
|
+
/***/ }),
|
185
|
+
/* 1 */
|
186
|
+
/***/ (function(module, exports, __webpack_require__) {
|
187
|
+
|
188
|
+
"use strict";
|
189
|
+
|
190
|
+
|
191
|
+
Object.defineProperty(exports, "__esModule", {
|
192
|
+
value: true
|
193
|
+
});
|
194
|
+
|
195
|
+
var _browserAdapter = __webpack_require__(0);
|
196
|
+
|
197
|
+
var _browserAdapter2 = _interopRequireDefault(_browserAdapter);
|
198
|
+
|
199
|
+
var _formatter = __webpack_require__(2);
|
200
|
+
|
201
|
+
var _formatter2 = _interopRequireDefault(_formatter);
|
202
|
+
|
203
|
+
var _namespaceManager = __webpack_require__(3);
|
204
|
+
|
205
|
+
var _namespaceManager2 = _interopRequireDefault(_namespaceManager);
|
206
|
+
|
207
|
+
var _index = __webpack_require__(5);
|
208
|
+
|
209
|
+
var _index2 = _interopRequireDefault(_index);
|
210
|
+
|
211
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
212
|
+
|
213
|
+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
214
|
+
|
215
|
+
function Logalize() {
|
216
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
217
|
+
args[_key] = arguments[_key];
|
218
|
+
}
|
219
|
+
|
220
|
+
Logalize.print.apply(Logalize, ['log'].concat(args));
|
221
|
+
}
|
222
|
+
|
223
|
+
Object.assign(Logalize, {
|
224
|
+
init: function init() {
|
225
|
+
this.configure();
|
226
|
+
},
|
227
|
+
configure: function configure() {
|
228
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
229
|
+
_ref$enabled = _ref.enabled,
|
230
|
+
enabled = _ref$enabled === undefined ? true : _ref$enabled,
|
231
|
+
_ref$enableFormatting = _ref.enableFormatting,
|
232
|
+
enableFormatting = _ref$enableFormatting === undefined ? true : _ref$enableFormatting,
|
233
|
+
_ref$collapseNamespac = _ref.collapseNamespaces,
|
234
|
+
collapseNamespaces = _ref$collapseNamespac === undefined ? false : _ref$collapseNamespac;
|
235
|
+
|
236
|
+
Object.assign(this, {
|
237
|
+
enabled: enabled,
|
238
|
+
enableFormatting: enableFormatting,
|
239
|
+
collapseNamespaces: collapseNamespaces,
|
240
|
+
formattableMethods: ['log', 'info', 'debug', 'warn', 'error', 'focus']
|
241
|
+
});
|
242
|
+
|
243
|
+
if (this.enableFormatting) {
|
244
|
+
this.appendStylesToDOM();
|
245
|
+
} else {
|
246
|
+
this.removeStylesFromDOM();
|
247
|
+
}
|
248
|
+
|
249
|
+
_namespaceManager2.default.configure({
|
250
|
+
loggingEnabled: this.isEnabled(),
|
251
|
+
collapsed: this.collapseNamespaces
|
252
|
+
});
|
253
|
+
},
|
254
|
+
namespace: function namespace() {
|
255
|
+
var _ref2;
|
256
|
+
|
257
|
+
var returnValue = _namespaceManager2.default.setNamespace.apply(_namespaceManager2.default, arguments);
|
258
|
+
return typeof (_ref2 = arguments.length - 1, arguments.length <= _ref2 ? undefined : arguments[_ref2]) === 'function' ? returnValue : this;
|
259
|
+
},
|
260
|
+
log: function log() {
|
261
|
+
this.print.apply(this, ['log'].concat(Array.prototype.slice.call(arguments)));
|
262
|
+
},
|
263
|
+
debug: function debug() {
|
264
|
+
this.print.apply(this, ['debug'].concat(Array.prototype.slice.call(arguments)));
|
265
|
+
},
|
266
|
+
info: function info() {
|
267
|
+
this.print.apply(this, ['info'].concat(Array.prototype.slice.call(arguments)));
|
268
|
+
},
|
269
|
+
warn: function warn() {
|
270
|
+
this.print.apply(this, ['warn'].concat(Array.prototype.slice.call(arguments)));
|
271
|
+
},
|
272
|
+
error: function error() {
|
273
|
+
this.print.apply(this, ['error'].concat(Array.prototype.slice.call(arguments)));
|
274
|
+
},
|
275
|
+
assert: function assert() {
|
276
|
+
this.print.apply(this, ['assert'].concat(Array.prototype.slice.call(arguments)));
|
277
|
+
},
|
278
|
+
count: function count(label) {
|
279
|
+
this.print('count', label);
|
280
|
+
},
|
281
|
+
dir: function dir(obj) {
|
282
|
+
this.print('dir', obj);
|
283
|
+
},
|
284
|
+
dirxml: function dirxml(obj) {
|
285
|
+
this.print('dirxml', obj);
|
286
|
+
},
|
287
|
+
profile: function profile() {
|
288
|
+
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
289
|
+
args[_key2] = arguments[_key2];
|
290
|
+
}
|
291
|
+
|
292
|
+
var func = args.pop();
|
293
|
+
if (typeof func === 'function') {
|
294
|
+
if (this.isEnabled()) _browserAdapter2.default.profile(args[0]);
|
295
|
+
var returnValue = func();
|
296
|
+
if (this.isEnabled()) this.profileEnd();
|
297
|
+
return returnValue;
|
298
|
+
} else {
|
299
|
+
if (this.isEnabled()) _browserAdapter2.default.profile(args[0]);
|
300
|
+
}
|
301
|
+
},
|
302
|
+
profileEnd: function profileEnd() {
|
303
|
+
if (this.isEnabled()) _browserAdapter2.default.profileEnd();
|
304
|
+
},
|
305
|
+
time: function time() {
|
306
|
+
for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
307
|
+
args[_key3] = arguments[_key3];
|
308
|
+
}
|
309
|
+
|
310
|
+
var func = args.pop();
|
311
|
+
if (typeof func === 'function') {
|
312
|
+
if (this.isEnabled()) _browserAdapter2.default.time(args[0]);
|
313
|
+
var returnValue = func();
|
314
|
+
if (this.isEnabled()) this.timeEnd(args[0]);
|
315
|
+
return returnValue;
|
316
|
+
} else {
|
317
|
+
if (this.isEnabled()) _browserAdapter2.default.time(args[0]);
|
318
|
+
}
|
319
|
+
},
|
320
|
+
timeEnd: function timeEnd(label) {
|
321
|
+
if (this.isEnabled()) _browserAdapter2.default.timeEnd(label);
|
322
|
+
},
|
323
|
+
timeStamp: function timeStamp(label) {
|
324
|
+
if (this.isEnabled()) _browserAdapter2.default.timeStamp(label);
|
325
|
+
},
|
326
|
+
trace: function trace(obj) {
|
327
|
+
this.print('trace', obj);
|
328
|
+
},
|
329
|
+
group: function group() {
|
330
|
+
for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
331
|
+
args[_key4] = arguments[_key4];
|
332
|
+
}
|
333
|
+
|
334
|
+
var func = args.pop();
|
335
|
+
if (typeof func === 'function') {
|
336
|
+
if (this.isEnabled()) _browserAdapter2.default.group.apply(_browserAdapter2.default, _toConsumableArray(args));
|
337
|
+
var returnValue = func();
|
338
|
+
if (this.isEnabled()) this.groupEnd();
|
339
|
+
return returnValue;
|
340
|
+
} else {
|
341
|
+
if (this.isEnabled()) _browserAdapter2.default.group.apply(_browserAdapter2.default, _toConsumableArray(args).concat([func]));
|
342
|
+
}
|
343
|
+
},
|
344
|
+
groupCollapsed: function groupCollapsed() {
|
345
|
+
for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
346
|
+
args[_key5] = arguments[_key5];
|
347
|
+
}
|
348
|
+
|
349
|
+
var func = args.pop();
|
350
|
+
if (typeof func === 'function') {
|
351
|
+
if (this.isEnabled()) _browserAdapter2.default.groupCollapsed.apply(_browserAdapter2.default, _toConsumableArray(args));
|
352
|
+
var returnValue = func();
|
353
|
+
if (this.isEnabled()) this.groupEnd();
|
354
|
+
return returnValue;
|
355
|
+
} else {
|
356
|
+
if (this.isEnabled()) _browserAdapter2.default.groupCollapsed.apply(_browserAdapter2.default, _toConsumableArray(args).concat([func]));
|
357
|
+
}
|
358
|
+
},
|
359
|
+
groupEnd: function groupEnd() {
|
360
|
+
if (this.isEnabled()) _browserAdapter2.default.groupEnd();
|
361
|
+
},
|
362
|
+
print: function print(method) {
|
363
|
+
for (var _len6 = arguments.length, args = Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
|
364
|
+
args[_key6 - 1] = arguments[_key6];
|
365
|
+
}
|
366
|
+
|
367
|
+
if (!this.isEnabled()) return;
|
368
|
+
|
369
|
+
if (this.formattableMethods.indexOf(method) > -1 && this.enableFormatting) {
|
370
|
+
args = _formatter2.default.format(args);
|
371
|
+
}
|
372
|
+
|
373
|
+
_namespaceManager2.default.group();
|
374
|
+
_browserAdapter2.default[method].apply(_browserAdapter2.default, _toConsumableArray(args));
|
375
|
+
},
|
376
|
+
|
377
|
+
|
378
|
+
// Enable / disable
|
379
|
+
|
380
|
+
enable: function enable() {
|
381
|
+
if (localStorage) localStorage.setItem('logalizeEnabled', 'true');
|
382
|
+
_namespaceManager2.default.configure({ loggingEnabled: this.isEnabled() });
|
383
|
+
},
|
384
|
+
disable: function disable() {
|
385
|
+
if (localStorage) localStorage.setItem('logalizeEnabled', 'false');
|
386
|
+
_namespaceManager2.default.configure({ loggingEnabled: this.isEnabled() });
|
387
|
+
},
|
388
|
+
|
389
|
+
|
390
|
+
// Private
|
391
|
+
|
392
|
+
isEnabled: function isEnabled() {
|
393
|
+
if (localStorage && localStorage.logalizeEnabled) {
|
394
|
+
return localStorage.logalizeEnabled !== 'false';
|
395
|
+
} else {
|
396
|
+
return this.enabled;
|
397
|
+
}
|
398
|
+
},
|
399
|
+
performConsoleAction: function performConsoleAction(action, args) {
|
400
|
+
_namespaceManager2.default.clear();
|
401
|
+
return _browserAdapter2.default[action].apply(_browserAdapter2.default, _toConsumableArray(args));
|
402
|
+
},
|
403
|
+
appendStylesToDOM: function appendStylesToDOM() {
|
404
|
+
if (document.getElementById('logalize-stylesheet')) return;
|
405
|
+
var styleEl = document.createElement('style');
|
406
|
+
styleEl.id = 'logalize-stylesheet';
|
407
|
+
styleEl.innerHTML = _index2.default.toString();
|
408
|
+
document.head.insertBefore(styleEl, document.head.firstChild);
|
409
|
+
},
|
410
|
+
removeStylesFromDOM: function removeStylesFromDOM() {
|
411
|
+
var stylesheetEl = document.getElementById('logalize-stylesheet');
|
412
|
+
if (!stylesheetEl) return;
|
413
|
+
stylesheetEl.remove();
|
414
|
+
}
|
415
|
+
});
|
416
|
+
|
417
|
+
exports.default = Logalize;
|
418
|
+
|
419
|
+
/***/ }),
|
420
|
+
/* 2 */
|
421
|
+
/***/ (function(module, exports, __webpack_require__) {
|
422
|
+
|
423
|
+
"use strict";
|
424
|
+
|
425
|
+
|
426
|
+
Object.defineProperty(exports, "__esModule", {
|
427
|
+
value: true
|
428
|
+
});
|
429
|
+
|
430
|
+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
431
|
+
|
432
|
+
var Formatter = {
|
433
|
+
format: function format(args) {
|
434
|
+
var _result2;
|
435
|
+
|
436
|
+
var formattedStrings = [];
|
437
|
+
var styles = [];
|
438
|
+
var formattedArgCount = 0;
|
439
|
+
var result;
|
440
|
+
|
441
|
+
var _iteratorNormalCompletion = true;
|
442
|
+
var _didIteratorError = false;
|
443
|
+
var _iteratorError = undefined;
|
444
|
+
|
445
|
+
try {
|
446
|
+
for (var _iterator = args[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
447
|
+
var arg = _step.value;
|
448
|
+
|
449
|
+
arg = this.formatObject(arg);
|
450
|
+
if (typeof arg === 'undefined' || !arg[1].length) break;
|
451
|
+
formattedStrings.push(arg[0]);
|
452
|
+
styles.push.apply(styles, _toConsumableArray(arg[1]));
|
453
|
+
formattedArgCount += 1;
|
454
|
+
}
|
455
|
+
} catch (err) {
|
456
|
+
_didIteratorError = true;
|
457
|
+
_iteratorError = err;
|
458
|
+
} finally {
|
459
|
+
try {
|
460
|
+
if (!_iteratorNormalCompletion && _iterator.return) {
|
461
|
+
_iterator.return();
|
462
|
+
}
|
463
|
+
} finally {
|
464
|
+
if (_didIteratorError) {
|
465
|
+
throw _iteratorError;
|
466
|
+
}
|
467
|
+
}
|
468
|
+
}
|
469
|
+
|
470
|
+
args.splice(0, formattedArgCount);
|
471
|
+
result = [];
|
472
|
+
if (formattedStrings.length) {
|
473
|
+
var _result;
|
474
|
+
|
475
|
+
result.push(formattedStrings.join(' '));
|
476
|
+
(_result = result).push.apply(_result, styles);
|
477
|
+
}
|
478
|
+
(_result2 = result).push.apply(_result2, _toConsumableArray(args));
|
479
|
+
return result;
|
480
|
+
},
|
481
|
+
formatObject: function formatObject(obj) {
|
482
|
+
if (typeof obj !== 'string') return;
|
483
|
+
return this.formatString(obj);
|
484
|
+
},
|
485
|
+
formatString: function formatString(string) {
|
486
|
+
var styles = [];
|
487
|
+
var classes;
|
488
|
+
|
489
|
+
while (this.canFormat(string)) {
|
490
|
+
var match = this.getRelevantMatch(string);
|
491
|
+
if (typeof match.format.classes === 'string') {
|
492
|
+
classes = match.format.classes;
|
493
|
+
} else {
|
494
|
+
classes = match.format.classes(match.match);
|
495
|
+
}
|
496
|
+
|
497
|
+
string = string.replace(match.format.regex, function (_, m) {
|
498
|
+
return '%c' + m + '%c';
|
499
|
+
});
|
500
|
+
styles.push(this.computeStyle(classes));
|
501
|
+
styles.push(this.computeStyle('default'));
|
502
|
+
}
|
503
|
+
|
504
|
+
return [string, styles];
|
505
|
+
},
|
506
|
+
canFormat: function canFormat(string) {
|
507
|
+
var _iteratorNormalCompletion2 = true;
|
508
|
+
var _didIteratorError2 = false;
|
509
|
+
var _iteratorError2 = undefined;
|
510
|
+
|
511
|
+
try {
|
512
|
+
for (var _iterator2 = this.formats[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
513
|
+
var format = _step2.value;
|
514
|
+
|
515
|
+
if (format.regex.test(string)) return true;
|
516
|
+
}
|
517
|
+
} catch (err) {
|
518
|
+
_didIteratorError2 = true;
|
519
|
+
_iteratorError2 = err;
|
520
|
+
} finally {
|
521
|
+
try {
|
522
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return) {
|
523
|
+
_iterator2.return();
|
524
|
+
}
|
525
|
+
} finally {
|
526
|
+
if (_didIteratorError2) {
|
527
|
+
throw _iteratorError2;
|
528
|
+
}
|
529
|
+
}
|
530
|
+
}
|
531
|
+
|
532
|
+
return false;
|
533
|
+
},
|
534
|
+
getRelevantMatch: function getRelevantMatch(string) {
|
535
|
+
var matches = [];
|
536
|
+
var _iteratorNormalCompletion3 = true;
|
537
|
+
var _didIteratorError3 = false;
|
538
|
+
var _iteratorError3 = undefined;
|
539
|
+
|
540
|
+
try {
|
541
|
+
for (var _iterator3 = this.formats[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
542
|
+
var format = _step3.value;
|
543
|
+
|
544
|
+
if (format.regex.test(string)) {
|
545
|
+
matches.push({ match: string.match(format.regex), format: format });
|
546
|
+
}
|
547
|
+
}
|
548
|
+
} catch (err) {
|
549
|
+
_didIteratorError3 = true;
|
550
|
+
_iteratorError3 = err;
|
551
|
+
} finally {
|
552
|
+
try {
|
553
|
+
if (!_iteratorNormalCompletion3 && _iterator3.return) {
|
554
|
+
_iterator3.return();
|
555
|
+
}
|
556
|
+
} finally {
|
557
|
+
if (_didIteratorError3) {
|
558
|
+
throw _iteratorError3;
|
559
|
+
}
|
560
|
+
}
|
561
|
+
}
|
562
|
+
|
563
|
+
return matches.sort(function (a, b) {
|
564
|
+
return a.match.index - b.match.index;
|
565
|
+
})[0];
|
566
|
+
},
|
567
|
+
computeStyle: function computeStyle(classes) {
|
568
|
+
// Create a temporary div to compute styles
|
569
|
+
var div = document.createElement('div');
|
570
|
+
div.id = 'logalize';
|
571
|
+
div.className = classes;
|
572
|
+
|
573
|
+
// Append the div to the DOM and compute styles
|
574
|
+
document.getElementsByTagName('body')[0].appendChild(div);
|
575
|
+
var computedStyle = getComputedStyle(div);
|
576
|
+
var styles = [];
|
577
|
+
|
578
|
+
var _iteratorNormalCompletion4 = true;
|
579
|
+
var _didIteratorError4 = false;
|
580
|
+
var _iteratorError4 = undefined;
|
581
|
+
|
582
|
+
try {
|
583
|
+
for (var _iterator4 = this.supportedStyles[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
|
584
|
+
var s = _step4.value;
|
585
|
+
|
586
|
+
styles.push(s + ':' + computedStyle.getPropertyValue(s));
|
587
|
+
}
|
588
|
+
} catch (err) {
|
589
|
+
_didIteratorError4 = true;
|
590
|
+
_iteratorError4 = err;
|
591
|
+
} finally {
|
592
|
+
try {
|
593
|
+
if (!_iteratorNormalCompletion4 && _iterator4.return) {
|
594
|
+
_iterator4.return();
|
595
|
+
}
|
596
|
+
} finally {
|
597
|
+
if (_didIteratorError4) {
|
598
|
+
throw _iteratorError4;
|
599
|
+
}
|
600
|
+
}
|
601
|
+
}
|
602
|
+
|
603
|
+
div.remove();
|
604
|
+
|
605
|
+
return styles.join(';');
|
606
|
+
},
|
607
|
+
|
608
|
+
|
609
|
+
/* eslint-disable indent, no-useless-escape */
|
610
|
+
supportedStyles: ['margin', 'color', 'background-color', 'border-radius', 'padding', 'font-weight', 'font-style', 'text-decoration'],
|
611
|
+
|
612
|
+
formats: [{
|
613
|
+
// **bold**
|
614
|
+
regex: /\*\*([^\*]+)\*\*/,
|
615
|
+
classes: 'bold'
|
616
|
+
}, {
|
617
|
+
// *italic*
|
618
|
+
regex: /\*([^\*]+)\*/,
|
619
|
+
classes: 'italic'
|
620
|
+
}, {
|
621
|
+
// ~strikethrough~
|
622
|
+
regex: /~([^~]+)~/,
|
623
|
+
classes: 'strikethrough'
|
624
|
+
}, {
|
625
|
+
// _underline_
|
626
|
+
regex: /_([^_]+)_/,
|
627
|
+
classes: 'underline'
|
628
|
+
}, {
|
629
|
+
// [badge]
|
630
|
+
regex: /\[([^\[\]]+)\](\.[\.\w]+)?/,
|
631
|
+
classes: function badgeClasses(match) {
|
632
|
+
var classes = 'badge';
|
633
|
+
if (match[2]) classes += match[2] && match[2].split('.').join(' ');
|
634
|
+
return classes;
|
635
|
+
}
|
636
|
+
}, {
|
637
|
+
// custom
|
638
|
+
// [my text].class1.class2
|
639
|
+
regex: /\{([^\{\}]+)\}(\.[\.\w]+)/,
|
640
|
+
classes: function classes(match) {
|
641
|
+
return match[2].split('.').join(' ');
|
642
|
+
}
|
643
|
+
}]
|
644
|
+
};
|
645
|
+
|
646
|
+
exports.default = Formatter;
|
647
|
+
|
648
|
+
/***/ }),
|
649
|
+
/* 3 */
|
650
|
+
/***/ (function(module, exports, __webpack_require__) {
|
651
|
+
|
652
|
+
"use strict";
|
653
|
+
|
654
|
+
|
655
|
+
Object.defineProperty(exports, "__esModule", {
|
656
|
+
value: true
|
657
|
+
});
|
658
|
+
|
659
|
+
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
|
660
|
+
|
661
|
+
var _browserAdapter = __webpack_require__(0);
|
662
|
+
|
663
|
+
var _browserAdapter2 = _interopRequireDefault(_browserAdapter);
|
664
|
+
|
665
|
+
var _utils = __webpack_require__(4);
|
666
|
+
|
667
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
668
|
+
|
669
|
+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
670
|
+
|
671
|
+
var NamespaceManager = {
|
672
|
+
clojureStack: [],
|
673
|
+
currentStack: [],
|
674
|
+
previousStack: [],
|
675
|
+
configure: function configure(configObject) {
|
676
|
+
Object.assign(this, configObject);
|
677
|
+
this.clear();
|
678
|
+
this.currentStack = [];
|
679
|
+
},
|
680
|
+
setNamespace: function setNamespace() {
|
681
|
+
var _this = this;
|
682
|
+
|
683
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
684
|
+
args[_key] = arguments[_key];
|
685
|
+
}
|
686
|
+
|
687
|
+
if (typeof args[args.length - 1] === 'function') {
|
688
|
+
var func = args.pop();
|
689
|
+
if (this.loggingEnabled) this.clojureStack.push(args);
|
690
|
+
var returnValue = func();
|
691
|
+
if (this.loggingEnabled) {
|
692
|
+
var currentClojure = this.clojureStack.pop();
|
693
|
+
currentClojure.forEach(function () {
|
694
|
+
_this.previousStack.pop();
|
695
|
+
_browserAdapter2.default.groupEnd();
|
696
|
+
});
|
697
|
+
}
|
698
|
+
return returnValue;
|
699
|
+
} else if (this.loggingEnabled) {
|
700
|
+
this.currentStack.push(args);
|
701
|
+
}
|
702
|
+
},
|
703
|
+
group: function group() {
|
704
|
+
var combinedStack = [];
|
705
|
+
|
706
|
+
var _arr = [].concat(_toConsumableArray(this.clojureStack), _toConsumableArray(this.currentStack));
|
707
|
+
|
708
|
+
for (var _i = 0; _i < _arr.length; _i++) {
|
709
|
+
var n = _arr[_i];combinedStack.push.apply(combinedStack, _toConsumableArray(n));
|
710
|
+
}if (!(0, _utils.compareArrays)(this.previousStack, combinedStack)) {
|
711
|
+
var commonSize = 0;
|
712
|
+
var _iteratorNormalCompletion = true;
|
713
|
+
var _didIteratorError = false;
|
714
|
+
var _iteratorError = undefined;
|
715
|
+
|
716
|
+
try {
|
717
|
+
for (var _iterator = this.previousStack.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
718
|
+
var _ref = _step.value;
|
719
|
+
|
720
|
+
var _ref2 = _slicedToArray(_ref, 2);
|
721
|
+
|
722
|
+
var i = _ref2[0];
|
723
|
+
var val = _ref2[1];
|
724
|
+
|
725
|
+
if (val === combinedStack[i]) {
|
726
|
+
commonSize += 1;
|
727
|
+
} else {
|
728
|
+
break;
|
729
|
+
}
|
730
|
+
}
|
731
|
+
} catch (err) {
|
732
|
+
_didIteratorError = true;
|
733
|
+
_iteratorError = err;
|
734
|
+
} finally {
|
735
|
+
try {
|
736
|
+
if (!_iteratorNormalCompletion && _iterator.return) {
|
737
|
+
_iterator.return();
|
738
|
+
}
|
739
|
+
} finally {
|
740
|
+
if (_didIteratorError) {
|
741
|
+
throw _iteratorError;
|
742
|
+
}
|
743
|
+
}
|
744
|
+
}
|
745
|
+
|
746
|
+
var deleteSize = this.previousStack.length - commonSize;
|
747
|
+
for (var _i2 = 0; _i2 < deleteSize; _i2++) {
|
748
|
+
_browserAdapter2.default.groupEnd();
|
749
|
+
}var toAdd = combinedStack.slice(commonSize);
|
750
|
+
var _iteratorNormalCompletion2 = true;
|
751
|
+
var _didIteratorError2 = false;
|
752
|
+
var _iteratorError2 = undefined;
|
753
|
+
|
754
|
+
try {
|
755
|
+
for (var _iterator2 = toAdd[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
756
|
+
var _n = _step2.value;
|
757
|
+
_browserAdapter2.default[this._groupingMethod()](_n);
|
758
|
+
}
|
759
|
+
} catch (err) {
|
760
|
+
_didIteratorError2 = true;
|
761
|
+
_iteratorError2 = err;
|
762
|
+
} finally {
|
763
|
+
try {
|
764
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return) {
|
765
|
+
_iterator2.return();
|
766
|
+
}
|
767
|
+
} finally {
|
768
|
+
if (_didIteratorError2) {
|
769
|
+
throw _iteratorError2;
|
770
|
+
}
|
771
|
+
}
|
772
|
+
}
|
773
|
+
}
|
774
|
+
this.previousStack = combinedStack;
|
775
|
+
this.currentStack = [];
|
776
|
+
},
|
777
|
+
clear: function clear() {
|
778
|
+
[].concat(_toConsumableArray(this.clojureStack), _toConsumableArray(this.currentStack), _toConsumableArray(this.previousStack)).forEach(function () {
|
779
|
+
return _browserAdapter2.default.groupEnd();
|
780
|
+
});
|
781
|
+
this.previousStack = [];
|
782
|
+
},
|
783
|
+
_groupingMethod: function _groupingMethod() {
|
784
|
+
return this.collapsed ? 'groupCollapsed' : 'group';
|
785
|
+
}
|
786
|
+
};
|
787
|
+
|
788
|
+
exports.default = NamespaceManager;
|
789
|
+
|
790
|
+
/***/ }),
|
791
|
+
/* 4 */
|
792
|
+
/***/ (function(module, exports, __webpack_require__) {
|
793
|
+
|
794
|
+
"use strict";
|
795
|
+
|
796
|
+
|
797
|
+
Object.defineProperty(exports, "__esModule", {
|
798
|
+
value: true
|
799
|
+
});
|
800
|
+
|
801
|
+
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
|
802
|
+
|
803
|
+
exports.compareArrays = compareArrays;
|
804
|
+
|
805
|
+
|
806
|
+
function compareArrays(array1, array2) {
|
807
|
+
if (array1.length !== array2.length) return false;
|
808
|
+
|
809
|
+
var _iteratorNormalCompletion = true;
|
810
|
+
var _didIteratorError = false;
|
811
|
+
var _iteratorError = undefined;
|
812
|
+
|
813
|
+
try {
|
814
|
+
for (var _iterator = array1.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
815
|
+
var _ref = _step.value;
|
816
|
+
|
817
|
+
var _ref2 = _slicedToArray(_ref, 2);
|
818
|
+
|
819
|
+
var i = _ref2[0];
|
820
|
+
var val = _ref2[1];
|
821
|
+
|
822
|
+
if (val instanceof Array && array2[i] instanceof Array) {
|
823
|
+
if (!compareArrays(val, array2[i])) return false;
|
824
|
+
} else if (val !== array2[i]) {
|
825
|
+
return false;
|
826
|
+
}
|
827
|
+
}
|
828
|
+
} catch (err) {
|
829
|
+
_didIteratorError = true;
|
830
|
+
_iteratorError = err;
|
831
|
+
} finally {
|
832
|
+
try {
|
833
|
+
if (!_iteratorNormalCompletion && _iterator.return) {
|
834
|
+
_iterator.return();
|
835
|
+
}
|
836
|
+
} finally {
|
837
|
+
if (_didIteratorError) {
|
838
|
+
throw _iteratorError;
|
839
|
+
}
|
840
|
+
}
|
841
|
+
}
|
842
|
+
|
843
|
+
return true;
|
844
|
+
}
|
845
|
+
|
846
|
+
/***/ }),
|
847
|
+
/* 5 */
|
848
|
+
/***/ (function(module, exports, __webpack_require__) {
|
849
|
+
|
850
|
+
exports = module.exports = __webpack_require__(6)();
|
851
|
+
// imports
|
852
|
+
|
853
|
+
|
854
|
+
// module
|
855
|
+
exports.push([module.i, "#logalize {\n color: black;\n background-color: transparent;\n border-radius: 0;\n padding: 0;\n margin: 0;\n font-weight: normal;\n font-style: normal;\n display: none; }\n #logalize.badge {\n color: white;\n background-color: black;\n border-radius: 3px;\n padding: 2px;\n margin: 0 2px; }\n #logalize.badge.blue {\n color: white;\n background-color: #61afef; }\n #logalize.badge.orange {\n color: white;\n background-color: #d19a66; }\n #logalize.badge.red {\n color: white;\n background-color: #e06c75; }\n #logalize.badge.green {\n color: white;\n background-color: #98c379; }\n #logalize.badge.cyan {\n color: white;\n background-color: #56b6c2; }\n #logalize.badge.purple {\n color: white;\n background-color: #c678dd; }\n #logalize.badge.focus {\n color: #bada55;\n background: #444; }\n #logalize.blue {\n color: #4078f2; }\n #logalize.orange {\n color: #986801; }\n #logalize.red {\n color: #e45649; }\n #logalize.green {\n color: #50a14f; }\n #logalize.cyan {\n color: #0184bc; }\n #logalize.purple {\n color: #a626a4; }\n #logalize.bold {\n font-weight: bold; }\n #logalize.italic {\n font-style: italic; }\n #logalize.strikethrough {\n text-decoration: line-through; }\n #logalize.underline {\n text-decoration: underline; }\n", ""]);
|
856
|
+
|
857
|
+
// exports
|
858
|
+
|
859
|
+
|
860
|
+
/***/ }),
|
861
|
+
/* 6 */
|
862
|
+
/***/ (function(module, exports) {
|
863
|
+
|
864
|
+
/*
|
865
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
866
|
+
Author Tobias Koppers @sokra
|
867
|
+
*/
|
868
|
+
// css base code, injected by the css-loader
|
869
|
+
module.exports = function() {
|
870
|
+
var list = [];
|
871
|
+
|
872
|
+
// return the list of modules as css string
|
873
|
+
list.toString = function toString() {
|
874
|
+
var result = [];
|
875
|
+
for(var i = 0; i < this.length; i++) {
|
876
|
+
var item = this[i];
|
877
|
+
if(item[2]) {
|
878
|
+
result.push("@media " + item[2] + "{" + item[1] + "}");
|
879
|
+
} else {
|
880
|
+
result.push(item[1]);
|
881
|
+
}
|
882
|
+
}
|
883
|
+
return result.join("");
|
884
|
+
};
|
885
|
+
|
886
|
+
// import a list of modules into the list
|
887
|
+
list.i = function(modules, mediaQuery) {
|
888
|
+
if(typeof modules === "string")
|
889
|
+
modules = [[null, modules, ""]];
|
890
|
+
var alreadyImportedModules = {};
|
891
|
+
for(var i = 0; i < this.length; i++) {
|
892
|
+
var id = this[i][0];
|
893
|
+
if(typeof id === "number")
|
894
|
+
alreadyImportedModules[id] = true;
|
895
|
+
}
|
896
|
+
for(i = 0; i < modules.length; i++) {
|
897
|
+
var item = modules[i];
|
898
|
+
// skip already imported module
|
899
|
+
// this implementation is not 100% perfect for weird media query combinations
|
900
|
+
// when a module is imported multiple times with different media queries.
|
901
|
+
// I hope this will never occur (Hey this way we have smaller bundles)
|
902
|
+
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
|
903
|
+
if(mediaQuery && !item[2]) {
|
904
|
+
item[2] = mediaQuery;
|
905
|
+
} else if(mediaQuery) {
|
906
|
+
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
|
907
|
+
}
|
908
|
+
list.push(item);
|
909
|
+
}
|
910
|
+
}
|
911
|
+
};
|
912
|
+
return list;
|
913
|
+
};
|
914
|
+
|
915
|
+
|
916
|
+
/***/ }),
|
917
|
+
/* 7 */
|
918
|
+
/***/ (function(module, exports, __webpack_require__) {
|
919
|
+
|
920
|
+
"use strict";
|
921
|
+
|
922
|
+
|
923
|
+
var _ = __webpack_require__(1);
|
924
|
+
|
925
|
+
var _2 = _interopRequireDefault(_);
|
926
|
+
|
927
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
928
|
+
|
929
|
+
window.logalize = _2.default;
|
930
|
+
window.logalize.init();
|
931
|
+
|
932
|
+
/***/ })
|
933
|
+
/******/ ]);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logalize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Komarov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Logalize is a Javascript wrapper for browser's developer console.
|
14
14
|
email:
|