-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFrontend.min.js
1 lines (1 loc) · 2.7 KB
/
Frontend.min.js
1
var __hasProp={}.hasOwnProperty,__extends=function(d,b){for(var a in b){if(__hasProp.call(b,a)){d[a]=b[a]}}function c(){this.constructor=d}c.prototype=b.prototype;d.prototype=new c();d.__super__=b.prototype;return d};(function(e,f,b){var a,c;c=(function(){function d(){var g;this.$=e;this._registry={};this.options={debug:false};this.Abstract=g=(function(){function h(){var l,k,i,j;this.className=this.constructor.name;if(!this._exposed){this._exposed=[]}if(this._exposed.length>0){j=this._exposed;for(k=0,i=j.length;k<i;k++){l=j[k];this.exposeMethod(l)}}}h.prototype.setElement=function(i){return this.element=i};h.prototype.init=function(){};h.prototype.load=function(){};h.prototype.ready=function(){this.bindings();return e(b).load(this.proxy(this.load))};h.prototype.bindings=function(){};h.prototype.isRunnable=function(){return true};h.prototype.isInitialized=function(){return !!this.initialized};h.prototype.reinit=function(){return this.ready()};h.prototype.proxy=function(i){return e.proxy(i,this)};h.prototype.exposeMethod=function(j,i){if(i==null){i=false}if(!(this.className in b)){b[this.className]={}}if(b[this.className].hasOwnProperty(j)&&!i){d.log("method "+j+" already exposed")}return b[this.className][j]=this[j]};return h})()}d.prototype.register=function(h,i,g){if(h in this._registry){this.log("key ["+h+"] already present in _registry: ",this._registry[h]);return false}return this._registry[h]={object:i,selector:g}};d.prototype.unregister=function(h){var g;g=false;if(h in this._registry){g=this._registry[h].object}delete this._registry[h];return g};d.prototype.registry=function(g){if(!g in this._registry){this.log("key ["+g+"] not found in _registry");return false}return this._registry[g].object};d.prototype.init=function(){var g;g=this;e.each(g._registry,function(i,h){if(typeof h.object==="function"&&typeof h.object!=="object"){if(typeof h.selector==="string"){e(h.selector).each(function(j){g.register(i+"_"+j,new h.object);return g.registry(i+"_"+j).setElement(this)});return g.unregister(i)}}});return e.each(g._registry,function(i,h){if("ready" in h.object&&typeof h.object.ready==="function"){if(h.object.isRunnable()){h.object.ready();return g._registry[i].object.initialized=true}}})};d.prototype.trigger=function(g,i,h){i=(i===undefined?b:i);return e(i).trigger(g,h)};d.prototype.log=function(){if(this.options&&this.options.debug){return b.console&&console.log.call(console,arguments)}};return d})();b.Frontend=new c;a=(function(g){__extends(d,g);function d(){return d.__super__.constructor.apply(this,arguments)}d.prototype.log=function(){return console.log(this)};return d})(b.Frontend.Abstract);b.Frontend.register("config",new a);return e(f).ready(function(){return b.Frontend.init()})})(jQuery,document,window);