awv3
Version:
AWV client CAD framework
1 lines • 2.07 kB
JavaScript
;function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}function guid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0,r="x"==t?e:3&e|8;return r.toString(16)})}function url(t){for(var e=window.location.search.substring(1),r=e.split("&"),n=0;n<r.length;n++){var o=r[n].split("=");if(o[0]==t)return o[1]}}function queryDom(t){return("string"==typeof t||t instanceof String)&&(t=document.querySelector(t)),t}function setPrefixedValue(t,e,r,n){var o,i,s,u=["-moz-","-webkit-","-o-","-ms-","-khtml-"];t.style[e]="",s=t.style[e];try{if(t.style[e]=r,t.style[e]!==s)return}catch(a){}for(o=0;o<u.length;++o){i=u[o]+r;try{if(t.style[e]=i,t.style[e]!==s)return}catch(l){}}t.style[e]=n}exports.__esModule=!0,exports.Timestamp=exports.Performance=void 0;var _trunc=require("babel-runtime/core-js/math/trunc"),_trunc2=_interopRequireDefault(_trunc),_classCallCheck2=require("babel-runtime/helpers/classCallCheck"),_classCallCheck3=_interopRequireDefault(_classCallCheck2);exports.guid=guid,exports.url=url,exports.queryDom=queryDom,exports.setPrefixedValue=setPrefixedValue;var Performance=exports.Performance=function(){function t(){(0,_classCallCheck3["default"])(this,t),this.stamp=void 0,this.total=void 0}return t.prototype.begin=function(){return this.stamp=performance.now(),this},t.prototype.end=function(){return this.stamp=performance.now()-this.stamp,(!this.total||this.stamp>this.total)&&(this.total=this.stamp),this},t.prototype.printCurrent=function(){return console.log(this.stamp),this},t.prototype.printTotal=function(){return console.log(this.total),this},t.prototype.clear=function(){return this.total=void 0,this},t}(),Timestamp=exports.Timestamp=function(){function t(t,e){return t=t.toString(),String(e+t).slice(-e.length)}var e=performance.now(),r=Date.now();return{get:function(){var n=performance.now()-e,o=r+n,i=(0,_trunc2["default"])(o/6e4)%60,s=(0,_trunc2["default"])(o/1e3)%60,u=(0,_trunc2["default"])(1e3*o)%1e6,a=t(i,"00")+":"+t(s,"00")+"."+t(u,"000000");return a}}}();