-
Notifications
You must be signed in to change notification settings - Fork 18
/
addJS.min.js
7 lines (7 loc) · 1.15 KB
/
addJS.min.js
1
2
3
4
5
6
7
/**
addjs
@author []
@fileoverview a javascript combine dev tools
@vserion 0.0.15
**/
!function(a,b){function c(a){return a.test(location.search)}function d(){return c(/debug/)}function e(){return c(/sass/)}function f(){return c(/es6/)}function g(a){var b=r.config,c=d();if(c&&b.debugMap&&b.debugMap[a]){var g=b.debugServer+b.debugMap[a];return g=e()?g+"&sass=1":g,g=f()?g+"&es6=1":g}return a}function h(a){b.write('<script src="'+a+'"></script>')}function i(a){b.write('<link href="'+a+'" rel="stylesheet">')}function j(a){r.config?a(r.config):(h(o+"?t="+q),r.cbs.push(a))}function k(a,b){j(function(c){a=g(a),a=d()?a:a+"?v="+c.version,b(a)})}var l=b.getElementsByTagName("script"),m=l.length,n=l[m-1],o=n.getAttribute("data-config"),p=n.getAttribute("data-config-cache"),q=parseInt(Date.now()/(60*parseInt(p,10)*1e3),10),r={_debug:!1,_configLoaded:!1,cbs:[],css:function(a){k(a,i)},js:function(a){k(a,h)},setConfig:function(a){var b=this;if(!a.version)throw new Error("must have a version");a.debugServer||(a.debugServer="http://127.0.0.1:7575/combine?filename="),this.config=a,this.cbs.forEach(function(a){a.exec||(a(b.config),a.exec=!0)})}};a.addjs=r}(window,document);