Property.min.js 3.9 KB

1
  1. MWF.xDesktop.requireApp("process.FormDesigner","Property",null,false);MWF.xApplication.cms.FormDesigner.Property=MWF.CMSFCProperty=new Class({Extends:MWF.FCProperty,loadScriptEditor:function(t,o){t.each(function(e){var i=e.get("title");var n=e.get("name");var s=this.data[n];MWF.require("MWF.widget.ScriptArea",function(){var t=new MWF.widget.ScriptArea(e,{title:i,maxObj:this.designer.formContentNode,onChange:function(){this.data[n]=t.toJson()}.bind(this),onSave:function(){this.designer.saveForm()}.bind(this),style:o||"default",helpStyle:"cms"});t.load(s)}.bind(this))}.bind(this))},getViewList:function(e,t){if(!this.views||t){this.form.designer.actions.listQueryView(this.form.designer.application.id,function(t){this.views=t.data;if(e)e()}.bind(this))}else{if(e)e()}},loadActionArea:function(){var t=this.propertyContent.getElements(".MWFActionArea");t.each(function(e){var i=e.get("name");var n=this.data[i];MWF.xDesktop.requireApp("cms.FormDesigner","widget.ActionsEditor",function(){var t=new MWF.xApplication.cms.FormDesigner.widget.ActionsEditor(e,this.designer,{maxObj:this.propertyNode.parentElement.parentElement.parentElement,onChange:function(){this.data[i]=t.data;this.changeData(i)}.bind(this)});t.load(n)}.bind(this))}.bind(this));var t=this.propertyContent.getElements(".MWFDefaultActionArea");t.each(function(e){var i=e.get("name");var n=this.data[i]||this.module.defaultToolBarsData;MWF.xDesktop.requireApp("cms.FormDesigner","widget.ActionsEditor",function(){var t=new MWF.xApplication.cms.FormDesigner.widget.ActionsEditor(e,this.designer,{maxObj:this.propertyNode.parentElement.parentElement.parentElement,noCreate:true,noDelete:true,noCode:true,onChange:function(){this.data[i]=t.data;this.changeData(i)}.bind(this)});t.load(n)}.bind(this))}.bind(this))},loadEventsEditor:function(){var e=this.propertyContent.getElement(".MWFEventsArea");if(e){var t=e.get("name");var i=this.data[t];MWF.xDesktop.requireApp("cms.FormDesigner","widget.EventsEditor",function(){var t=new MWF.xApplication.cms.FormDesigner.widget.EventsEditor(e,this.designer,{maxObj:this.designer.formContentNode});t.load(i)}.bind(this))}},loadValidation:function(){var t=this.propertyContent.getElements(".MWFValidation");if(t.length){t.each(function(t){var i=t.get("name");MWF.xDesktop.requireApp("cms.FormDesigner","widget.ValidationEditor",function(){var e=new MWF.xApplication.cms.FormDesigner.widget.ValidationEditor(t,this.designer,{onChange:function(){var t=e.getValidationData();this.data[i]=t}.bind(this)});e.load(this.data[i])}.bind(this))}.bind(this))}}});MWF.xApplication.cms.FormDesigner.PropertyMulti=new Class({Extends:MWF.xApplication.cms.FormDesigner.Property,Implements:[Options,Events],initialize:function(t,e,i,n,s){this.setOptions(s);this.modules=e;this.form=t;this.data={};this.htmlPath=this.options.path;this.designer=n;this.maplists={};this.propertyNode=i},load:function(){if(this.fireEvent("queryLoad")){MWF.getRequestText(this.htmlPath,function(t,e){this.htmlString=t;MWF.require("MWF.widget.JsonTemplate",function(){this.fireEvent("postLoad")}.bind(this))}.bind(this))}},show:function(){if(!this.propertyContent){if(this.htmlString){this.JsonTemplate=new MWF.widget.JsonTemplate({},this.htmlString);this.propertyContent=new Element("div",{styles:{overflow:"hidden"}}).inject(this.propertyNode);this.propertyContent.set("html",this.JsonTemplate.load());this.setEditNodeEvent();this.setEditNodeStyles(this.propertyContent);this.loadPropertyTab();this.loadMaplist();this.loadScriptArea();this.loadTreeData();this.loadArrayList()}}else{this.propertyContent.setStyle("display","block")}},hide:function(){if(this.propertyContent)this.propertyContent.destroy()},changeStyle:function(e){this.modules.each(function(t){t.setPropertiesOrStyles(e)}.bind(this))},changeData:function(e,i,n){this.modules.each(function(t){t._setEditStyle(e,i,n)}.bind(this))},changeJsonDate:function(e,i){this.modules.each(function(t){t.json[e]=i}.bind(this))}});