
banners={};BannersComponent=Class.create();BannersComponent.prototype={initialize:function(app,id,options){this.id=id;this.app=app;this.options=options||{mode:'display'};this.options.template=this.options.template||'banner_render';updaters[this.id+'_update']=new Updater(this.id+'_update',this.app,'AddBanner',this.options);if(this.options.mode=='admin'){$(this.id+'_update_admin').style.display='';ax_forms[this.id+'_form']=new AxForm(this.id+'_form',{updater:this.id+'_update',use_return:true,additional_params:['type='+this.options.type,'tpl='+this.options.template]});if(this.options.orderable){$(this.id+'_listing').style.display='';}
listManagers[this.id+'_listing_content']=new ListManager(this.id+'_listing_content','/sys/components/Banners/index.php',{updater:this.id+'_update',additional_params:['type='+this.options.type,'tpl='+this.options.template]});}},loadListing:function(){var callParams=[];callParams.push('type='+this.options.type);callParams.push('comp_id='+this.id);callParams.push('tpl='+this.options.template);callParams.push('action=listing');updaters[this.id+'_update'].run(callParams,'Update');},loadBanners:function(){var callParams=[];callParams.push('type='+this.options.type);callParams.push('comp_id='+this.id);callParams.push('tpl='+this.options.template);callParams.push('action=display');updaters[this.id+'_update'].run(callParams,'Update');},mediaInsert:function(res){var parts=res.split('|');if(console)console.log("Inserting Media "+parts[1]);var regExp=/\.(\w+)$/;regExp.test(parts[1]);var ext=RegExp.$1;if(console)console.log("EXTENSION: "+ext);var temp={index:parts[0],src:parts[1]};if(console)console.log(this.banners);this.banners.push(temp);this.bannercomp_new_banner_file_id.value=temp.index;},makeSortable:function(){var callParams=[];callParams.push('type='+this.options.type);callParams.push('comp_id='+this.id);listManagers[this.id+'_listing_content'].makeSortable(this.id,'','UpdateOrder',callParams);},disableSorting:function(){listManagers[this.id+'_listing_content'].disableSorting(this.id);}};