(function(a){function b(){this.isRenderable=!0,this.beforeContent="",this.afterContent="",this.plugins=[]}b.prototype.toString=function(){var a="";this._events!==undefined&&(a='<script type="text/javascript" class="event_hooks">'+JSON.stringify(this._events)+"</script>");if(this.plugins)for(var b=0,c;c=this.plugins[b];b++){var d=c[0]+"Plugin",e=require(__dirname+"/../plugins/"+d+".js");e=new e[d](c[1]),console.log("plugin class",__dirname+"/../plugins/"+d+".js",e),e.process(this)}return a+this.render()},b.prototype.get=function(a){return this[a]},b.prototype._parseAttributes=function(){var a=[];for(var b in this.attributes)a.push(b+'="'+this.attributes[b]+'"');return a.join(" ")},b.prototype.on=function(a,b){return console.log("Creating new event listener ",arguments),this._events||(this._events=[]),this._events.push({event:global.nwt.getClass(this)+":"+a,callback:b.toString()}),this},b.prototype.before=function(a){return this.beforeContent=a,this},b.prototype.after=function(a){return this.afterContent=a,this},b.prototype.plug=function(a,b){return console.log("about to push plugin"),this.plugins.push([a,b]),console.log("Pushing plugin",this.plugins),this},a.NWTHelperInstance=b})(this)
