Permalink
Browse files

Make build

  • Loading branch information...
1 parent 20a0d8e commit ab3a0a171b5edcba6f4da971dd75f5a49d2ea731 @mixu committed May 30, 2014
Showing with 35 additions and 19 deletions.
  1. +1 −0 Makefile
  2. +34 −19 dist/minilog.js
View
@@ -15,6 +15,7 @@ build:
@echo 'Building dist/minilog.js'
./node_modules/gluejs/bin/gluejs \
--include ./lib/web \
+ --exclude package.json \
$(DEFAULTS) \
--command 'uglifyjs --no-copyright --mangle-toplevel'
View
@@ -1,31 +1,46 @@
-(function(){function require(e,t,n){t||(t=0);var r=require.resolve(e,t),i=require.m[t][r];if(!i)throw new Error('failed to require "'+e+'" from '+n);if(i.c){t=i.c,r=i.m,i=require.m[t][i.m];if(!i)throw new Error('failed to require "'+r+'" from '+t)}return i.exports||(i.exports={},i.call(i.exports,i,i.exports,require.relative(r,t))),i.exports}require.resolve=function(e,t){var n=e,r=e+".js",i=e+"/index.js";return require.m[t][r]&&r||require.m[t][i]&&i||n},require.relative=function(e,t){return function(n){if("."!=n.charAt(0))return require(n,t,e);var r=e.split("/"),i=n.split("/");r.pop();for(var s=0;s<i.length;s++){var o=i[s];".."==o?r.pop():"."!=o&&r.push(o)}return require(r.join("/"),t,e)}};
-require.m = [];
-require.m[0] = {
+(function(){
+var r=function(){var e="function"==typeof require&&require,r=function(i,o,u){o||(o=0);var n=r.resolve(i,o),t=r.m[o][n];if(!t&&e){if(t=e(n))return t}else if(t&&t.c&&(o=t.c,n=t.m,t=r.m[o][t.m],!t))throw new Error('failed to require "'+n+'" from '+o);if(!t)throw new Error('failed to require "'+i+'" from '+u);return t.exports||(t.exports={},t.call(t.exports,t,t.exports,r.relative(n,o))),t.exports};return r.resolve=function(e,n){var i=e,t=e+".js",o=e+"/index.js";return r.m[n][t]&&t?t:r.m[n][o]&&o?o:i},r.relative=function(e,t){return function(n){if("."!=n.charAt(0))return r(n,t,e);var o=e.split("/"),f=n.split("/");o.pop();for(var i=0;i<f.length;i++){var u=f[i];".."==u?o.pop():"."!=u&&o.push(u)}return r(o.join("/"),t,e)}},r}();r.m = [];
+r.m[0] = {
+"microee": {"c":2,"m":"index.js"},
"lib/web/index.js": function(module, exports, require){
-var e=require("../common/minilog.js"),t=e.enable,n=e.disable,r=typeof navigator!="undefined"&&/chrome/i.test(navigator.userAgent),i=require("./console.js");e.defaultBackend=r?i.minilog:i;if(typeof window!="undefined"){try{e.enable(JSON.parse(window.localStorage.minilogSettings))}catch(s){}if(window.location&&window.location.search){var o=RegExp("[?&]minilog=([^&]*)").exec(window.location.search);o&&e.enable(decodeURIComponent(o[1]))}}e.enable=function(){t.call(e,!0);try{window.localStorage.minilogSettings=JSON.stringify(!0)}catch(n){}return this},e.disable=function(){n.call(e);try{delete window.localStorage.minilogSettings}catch(t){}return this},exports=module.exports=e,exports.backends={array:require("./array.js"),browser:e.defaultBackend,localStorage:require("./localstorage.js"),jQuery:require("./jquery_simple.js")};},
+var e=require("../common/minilog.js"),t=e.enable,n=e.disable,r=typeof navigator!="undefined"&&/chrome/i.test(navigator.userAgent),i=require("./console.js");e.defaultBackend=r?i.minilog:i;if(typeof window!="undefined"){try{e.enable(JSON.parse(window.localStorage.minilogSettings))}catch(s){}if(window.location&&window.location.search){var o=RegExp("[?&]minilog=([^&]*)").exec(window.location.search);o&&e.enable(decodeURIComponent(o[1]))}}e.enable=function(){t.call(e,!0);try{window.localStorage.minilogSettings=JSON.stringify(!0)}catch(n){}return this},e.disable=function(){n.call(e);try{delete window.localStorage.minilogSettings}catch(t){}return this},exports=module.exports=e,exports.backends={array:require("./array.js"),browser:e.defaultBackend,localStorage:require("./localstorage.js"),jQuery:require("./jquery_simple.js")};
+},
"lib/web/array.js": function(module, exports, require){
-var e=require("../common/transform.js"),t=[],n=new e;n.write=function(e,n,r){t.push([e,n,r])},n.get=function(){return t},n.empty=function(){t=[]},module.exports=n;},
+var e=require("../common/transform.js"),t=[],n=new e;n.write=function(e,n,r){t.push([e,n,r])},n.get=function(){return t},n.empty=function(){t=[]},module.exports=n;
+},
"lib/web/console.js": function(module, exports, require){
-var e=require("../common/transform.js"),t=/\n+$/,n=new e;n.write=function(e,n,r){var i=r.length-1;if(typeof console=="undefined"||!console.log)return;if(console.log.apply)return console.log.apply(console,[e,n].concat(r));if(JSON&&JSON.stringify){r[i]&&typeof r[i]=="string"&&(r[i]=r[i].replace(t,""));try{for(i=0;i<r.length;i++)r[i]=JSON.stringify(r[i])}catch(s){}console.log(r.join(" "))}},n.formatters=["color","minilog"],n.color=require("./formatters/color.js"),n.minilog=require("./formatters/minilog.js"),module.exports=n;},
+var e=require("../common/transform.js"),t=/\n+$/,n=new e;n.write=function(e,n,r){var i=r.length-1;if(typeof console=="undefined"||!console.log)return;if(console.log.apply)return console.log.apply(console,[e,n].concat(r));if(JSON&&JSON.stringify){r[i]&&typeof r[i]=="string"&&(r[i]=r[i].replace(t,""));try{for(i=0;i<r.length;i++)r[i]=JSON.stringify(r[i])}catch(s){}console.log(r.join(" "))}},n.formatters=["color","minilog"],n.color=require("./formatters/color.js"),n.minilog=require("./formatters/minilog.js"),module.exports=n;
+},
"lib/common/filter.js": function(module, exports, require){
-function n(){this.enabled=!0,this.defaultResult=!0,this.clear()}function r(e,t){return e.n.test?e.n.test(t):e.n==t}var e=require("./transform.js"),t={debug:1,info:2,warn:3,error:4};e.mixin(n),n.prototype.allow=function(e,n){return this._white.push({n:e,l:t[n]}),this},n.prototype.deny=function(e,n){return this._black.push({n:e,l:t[n]}),this},n.prototype.clear=function(){return this._white=[],this._black=[],this},n.prototype.test=function(e,n){var i,s=Math.max(this._white.length,this._black.length);for(i=0;i<s;i++){if(this._white[i]&&r(this._white[i],e)&&t[n]>=this._white[i].l)return!0;if(this._black[i]&&r(this._black[i],e)&&t[n]<this._black[i].l)return!1}return this.defaultResult},n.prototype.write=function(e,t,n){if(!this.enabled||this.test(e,t))return this.emit("item",e,t,n)},module.exports=n;},
+function n(){this.enabled=!0,this.defaultResult=!0,this.clear()}function r(e,t){return e.n.test?e.n.test(t):e.n==t}var e=require("./transform.js"),t={debug:1,info:2,warn:3,error:4};e.mixin(n),n.prototype.allow=function(e,n){return this._white.push({n:e,l:t[n]}),this},n.prototype.deny=function(e,n){return this._black.push({n:e,l:t[n]}),this},n.prototype.clear=function(){return this._white=[],this._black=[],this},n.prototype.test=function(e,n){var i,s=Math.max(this._white.length,this._black.length);for(i=0;i<s;i++){if(this._white[i]&&r(this._white[i],e)&&t[n]>=this._white[i].l)return!0;if(this._black[i]&&r(this._black[i],e)&&t[n]<this._black[i].l)return!1}return this.defaultResult},n.prototype.write=function(e,t,n){if(!this.enabled||this.test(e,t))return this.emit("item",e,t,n)},module.exports=n;
+},
"lib/common/minilog.js": function(module, exports, require){
-var e=require("./transform.js"),t=require("./filter.js"),n=new e,r=Array.prototype.slice;exports=module.exports=function(t){var i=function(){return n.write(t,undefined,r.call(arguments)),i};return i.debug=function(){return n.write(t,"debug",r.call(arguments)),i},i.info=function(){return n.write(t,"info",r.call(arguments)),i},i.warn=function(){return n.write(t,"warn",r.call(arguments)),i},i.error=function(){return n.write(t,"error",r.call(arguments)),i},i.suggest=exports.suggest,i.format=n.format,i},exports.defaultBackend=exports.defaultFormatter=null,exports.pipe=function(e){return n.pipe(e)},exports.end=exports.unpipe=exports.disable=function(e){return n.unpipe(e)},exports.Transform=e,exports.Filter=t,exports.suggest=new t,exports.enable=function(){return exports.defaultFormatter?n.pipe(exports.suggest).pipe(exports.defaultFormatter).pipe(exports.defaultBackend):n.pipe(exports.suggest).pipe(exports.defaultBackend)};},
+var e=require("./transform.js"),t=require("./filter.js"),n=new e,r=Array.prototype.slice;exports=module.exports=function(t){var i=function(){return n.write(t,undefined,r.call(arguments)),i};return i.debug=function(){return n.write(t,"debug",r.call(arguments)),i},i.info=function(){return n.write(t,"info",r.call(arguments)),i},i.warn=function(){return n.write(t,"warn",r.call(arguments)),i},i.error=function(){return n.write(t,"error",r.call(arguments)),i},i.log=i.debug,i.suggest=exports.suggest,i.format=n.format,i},exports.defaultBackend=exports.defaultFormatter=null,exports.pipe=function(e){return n.pipe(e)},exports.end=exports.unpipe=exports.disable=function(e){return n.unpipe(e)},exports.Transform=e,exports.Filter=t,exports.suggest=new t,exports.enable=function(){return exports.defaultFormatter?n.pipe(exports.suggest).pipe(exports.defaultFormatter).pipe(exports.defaultBackend):n.pipe(exports.suggest).pipe(exports.defaultBackend)};
+},
"lib/common/transform.js": function(module, exports, require){
-function t(){}var e=require("microee");e.mixin(t),t.prototype.write=function(e,t,n){this.emit("item",e,t,n)},t.prototype.end=function(){this.emit("end"),this.removeAllListeners()},t.prototype.pipe=function(e){function n(){e.write.apply(e,Array.prototype.slice.call(arguments))}function r(){!e._isStdio&&e.end()}var t=this;return t.emit("unpipe",e),e.emit("pipe",t),t.on("item",n),t.on("end",r),t.when("unpipe",function(i){var o=i===e||typeof i=="undefined";return o&&(t.removeListener("item",n),t.removeListener("end",r),e.emit("unpipe")),o}),e},t.prototype.unpipe=function(e){return this.emit("unpipe",e),this},t.prototype.format=function(e){throw new Error(["Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:","var Minilog = require('minilog');","Minilog"," .pipe(Minilog.backends.console.formatClean)"," .pipe(Minilog.backends.console);"].join("\n"))},t.mixin=function(e){var n=t.prototype,r;for(r in n)n.hasOwnProperty(r)&&(e.prototype[r]=n[r])},module.exports=t;},
+function t(){}var e=require("microee");e.mixin(t),t.prototype.write=function(e,t,n){this.emit("item",e,t,n)},t.prototype.end=function(){this.emit("end"),this.removeAllListeners()},t.prototype.pipe=function(e){function n(){e.write.apply(e,Array.prototype.slice.call(arguments))}function r(){!e._isStdio&&e.end()}var t=this;return t.emit("unpipe",e),e.emit("pipe",t),t.on("item",n),t.on("end",r),t.when("unpipe",function(i){var o=i===e||typeof i=="undefined";return o&&(t.removeListener("item",n),t.removeListener("end",r),e.emit("unpipe")),o}),e},t.prototype.unpipe=function(e){return this.emit("unpipe",e),this},t.prototype.format=function(e){throw new Error(["Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:","var Minilog = require('minilog');","Minilog"," .pipe(Minilog.backends.console.formatClean)"," .pipe(Minilog.backends.console);"].join("\n"))},t.mixin=function(e){var n=t.prototype,r;for(r in n)n.hasOwnProperty(r)&&(e.prototype[r]=n[r])},module.exports=t;
+},
"lib/web/localstorage.js": function(module, exports, require){
-var e=require("../common/transform.js"),t=!1,n=new e;n.write=function(e,n,r){if(typeof window=="undefined"||typeof JSON=="undefined"||!JSON.stringify||!JSON.parse)return;try{t||(t=window.localStorage.minilog?JSON.parse(window.localStorage.minilog):[]),t.push([(new Date).toString(),e,n,r]),window.localStorage.minilog=JSON.stringify(t)}catch(i){}};},
+var e=require("../common/transform.js"),t=!1,n=new e;n.write=function(e,n,r){if(typeof window=="undefined"||typeof JSON=="undefined"||!JSON.stringify||!JSON.parse)return;try{t||(t=window.localStorage.minilog?JSON.parse(window.localStorage.minilog):[]),t.push([(new Date).toString(),e,n,r]),window.localStorage.minilog=JSON.stringify(t)}catch(i){}},module.exports=n;
+},
"lib/web/jquery_simple.js": function(module, exports, require){
-function n(e){this.url=e.url||"",this.cache=[],this.timer=null,this.interval=e.interval||3e4,this.enabled=!0,this.jQuery=window.jQuery}var e=require("../common/transform.js"),t=(new Date).valueOf().toString(36);e.mixin(n),n.prototype.write=function(e,t,n){this.timer||this.init(),this.cache.push([e,t].concat(n))},n.prototype.init=function(){if(!this.enabled||!this.jQuery)return;var e=this;this.timer=setTimeout(function(){var n,r=[];if(e.cache.length==0)return e.init();for(n=0;n<e.cache.length;n++)try{r.push(JSON.stringify(e.cache[n]))}catch(i){}e.jQuery.ajax(e.url+"?client_id="+t,{type:"POST",cache:!1,processData:!1,data:r.join("\n"),contentType:"application/json",timeout:1e4}).success(function(t,n,r){t.interval&&(e.interval=Math.max(1e3,t.interval))}).error(function(){e.interval=3e4}).always(function(){e.init()}),e.cache=[]},this.interval)},n.prototype.end=function(){},n.jQueryWait=function(e){if(typeof window!="undefined"&&(window.jQuery||window.$))return e(window.jQuery||window.$);typeof window!="undefined"&&setTimeout(function(){n.jQueryWait(e)},200)},module.exports=n;},
+function n(e){this.url=e.url||"",this.cache=[],this.timer=null,this.interval=e.interval||3e4,this.enabled=!0,this.jQuery=window.jQuery,this.extras={}}var e=require("../common/transform.js"),t=(new Date).valueOf().toString(36);e.mixin(n),n.prototype.write=function(e,t,n){this.timer||this.init(),this.cache.push([e,t].concat(n))},n.prototype.init=function(){if(!this.enabled||!this.jQuery)return;var e=this;this.timer=setTimeout(function(){var n,r=[],i,s=e.url;if(e.cache.length==0)return e.init();for(n=0;n<e.cache.length;n++)try{r.push(JSON.stringify(e.cache[n]))}catch(o){}e.jQuery.isEmptyObject(e.extras)?(i=r.join("\n"),s=e.url+"?client_id="+t):i=JSON.stringify(e.jQuery.extend({logs:r},e.extras)),e.jQuery.ajax(s,{type:"POST",cache:!1,processData:!1,data:i,contentType:"application/json",timeout:1e4}).success(function(t,n,r){t.interval&&(e.interval=Math.max(1e3,t.interval))}).error(function(){e.interval=3e4}).always(function(){e.init()}),e.cache=[]},this.interval)},n.prototype.end=function(){},n.jQueryWait=function(e){if(typeof window!="undefined"&&(window.jQuery||window.$))return e(window.jQuery||window.$);typeof window!="undefined"&&setTimeout(function(){n.jQueryWait(e)},200)},module.exports=n;
+},
"lib/web/formatters/util.js": function(module, exports, require){
-function t(t,n){return n?"color: #fff; background: "+e[t]+";":"color: "+e[t]+";"}var e={black:"#000",red:"#c23621",green:"#25bc26",yellow:"#bbbb00",blue:"#492ee1",magenta:"#d338d3",cyan:"#33bbc8",gray:"#808080",purple:"#708"};module.exports=t;},
+function t(t,n){return n?"color: #fff; background: "+e[t]+";":"color: "+e[t]+";"}var e={black:"#000",red:"#c23621",green:"#25bc26",yellow:"#bbbb00",blue:"#492ee1",magenta:"#d338d3",cyan:"#33bbc8",gray:"#808080",purple:"#708"};module.exports=t;
+},
"lib/web/formatters/color.js": function(module, exports, require){
-var e=require("../../common/transform.js"),t=require("./util.js"),n={debug:["cyan"],info:["purple"],warn:["yellow",!0],error:["red",!0]},r=new e;r.write=function(e,r,i){var s=console.log;console[r]&&console[r].apply&&(s=console[r],s.apply(console,["%c"+e+" %c"+r,t("gray"),t.apply(t,n[r])].concat(i)))},r.pipe=function(){},module.exports=r;},
+var e=require("../../common/transform.js"),t=require("./util.js"),n={debug:["cyan"],info:["purple"],warn:["yellow",!0],error:["red",!0]},r=new e;r.write=function(e,r,i){var s=console.log;console[r]&&console[r].apply&&(s=console[r],s.apply(console,["%c"+e+" %c"+r,t("gray"),t.apply(t,n[r])].concat(i)))},r.pipe=function(){},module.exports=r;
+},
"lib/web/formatters/minilog.js": function(module, exports, require){
-var e=require("../../common/transform.js"),t=require("./util.js");colors={debug:["gray"],info:["purple"],warn:["yellow",!0],error:["red",!0]},logger=new e,logger.write=function(e,n,r){var i=console.log;n!="debug"&&console[n]&&(i=console[n]);var s=[],o=0;if(n!="info"){for(;o<r.length;o++)if(typeof r[o]!="string")break;i.apply(console,["%c"+e+" "+r.slice(0,o).join(" "),t.apply(t,colors[n])].concat(r.slice(o)))}else i.apply(console,["%c"+e,t.apply(t,colors[n])].concat(r))},logger.pipe=function(){},module.exports=logger;},
-"microee": {"c":1,"m":"index.js"}};
-require.m[1] = {
+var e=require("../../common/transform.js"),t=require("./util.js");colors={debug:["gray"],info:["purple"],warn:["yellow",!0],error:["red",!0]},logger=new e,logger.write=function(e,n,r){var i=console.log;n!="debug"&&console[n]&&(i=console[n]);var s=[],o=0;if(n!="info"){for(;o<r.length;o++)if(typeof r[o]!="string")break;i.apply(console,["%c"+e+" "+r.slice(0,o).join(" "),t.apply(t,colors[n])].concat(r.slice(o)))}else i.apply(console,["%c"+e,t.apply(t,colors[n])].concat(r))},logger.pipe=function(){},module.exports=logger;
+}
+};
+r.m[1] = {
+};
+r.m[2] = {
"index.js": function(module, exports, require){
-function e(){this._events={}}e.prototype={on:function(e,t){this._events||(this._events={});var n=this._events;return(n[e]||(n[e]=[])).push(t),this},removeListener:function(e,t){var n=this._events[e]||[],r;for(r=n.length-1;r>=0&&n[r];r--)(n[r]===t||n[r].cb===t)&&n.splice(r,1)},removeAllListeners:function(e){e?this._events[e]&&(this._events[e]=[]):this._events={}},emit:function(e){this._events||(this._events={});var t=Array.prototype.slice.call(arguments,1),n,r=this._events[e]||[];for(n=r.length-1;n>=0&&r[n];n--)r[n].apply(this,t);return this},when:function(e,t){return this.once(e,t,!0)},once:function(e,t,n){function r(){n||this.removeListener(e,r),t.apply(this,arguments)&&n&&this.removeListener(e,r)}return t?(r.cb=t,this.on(e,r),this):this}},e.mixin=function(t){var n=e.prototype,r;for(r in n)n.hasOwnProperty(r)&&(t.prototype[r]=n[r])},module.exports=e;}};
-Minilog = require('lib/web/index.js');
-}());
+function e(){this._events={}}e.prototype={on:function(e,t){this._events||(this._events={});var n=this._events;return(n[e]||(n[e]=[])).push(t),this},removeListener:function(e,t){var n=this._events[e]||[],r;for(r=n.length-1;r>=0&&n[r];r--)(n[r]===t||n[r].cb===t)&&n.splice(r,1)},removeAllListeners:function(e){e?this._events[e]&&(this._events[e]=[]):this._events={}},emit:function(e){this._events||(this._events={});var t=Array.prototype.slice.call(arguments,1),n,r=this._events[e]||[];for(n=r.length-1;n>=0&&r[n];n--)r[n].apply(this,t);return this},when:function(e,t){return this.once(e,t,!0)},once:function(e,t,n){function r(){n||this.removeListener(e,r),t.apply(this,arguments)&&n&&this.removeListener(e,r)}return t?(r.cb=t,this.on(e,r),this):this}},e.mixin=function(t){var n=e.prototype,r;for(r in n)n.hasOwnProperty(r)&&(t.prototype[r]=n[r])},module.exports=e;
+}
+};
+Minilog = r("lib/web/index.js");}());

0 comments on commit ab3a0a1

Please sign in to comment.