text: MWF.require("MWF.widget.Mask",null,!1),MWF.xApplication.cms=MWF.xApplication.cms||{},MWF.xApplication.cms.Index=MWF.xApplication.cms.Index||{},MWF.xApplication.cms.Index.Creater=new Class({Extends:MWF.widget.Common,Implements:[Options,Events],options:{style:"default"},initialize:function(t,e,s,i){this.setOptions(i),this.path="../x_component_cms_Index/$Creater/",this.cssPath="../x_component_cms_Index/$Creater/"+this.options.style+"/css.wcss",this._loadCss(),this.app=t,this.view=s,this.columnData=e,MWF.xDesktop.requireApp("cms.Index","$Creater."+MWF.language,null,!1),this.lp=MWF.xApplication.cms.Index.Creater.lp},load:function(){this.startDocumentAreaNode||this.createStartDocumentArea(),this.startDocumentAreaNode.fade("0.95")},closeStartDocumentArea:function(){this.startDocumentAreaNode&&this.startDocumentAreaNode.fade("out")},createStartDocumentArea:function(){this.createStartDocumentAreaNode(),this.createStartDocumentCloseNode(),this.createStartDocumentScrollNode(),this.columnData?(this.columnData.name||(this.columnData.name=this.columnData.appName),new MWF.xApplication.cms.Index.Creater.Column(this.columnData,this.app,this,this.startDocumentContentNode,!0)):this.listColumns(),this.setResizeStartDocumentAreaHeight(),this.app.addEvent("resize",this.setResizeStartDocumentAreaHeight.bind(this))},createStartDocumentAreaNode:function(){this.startDocumentAreaNode=new Element("div",{styles:this.css.startDocumentAreaNode}).inject(this.app.content),this.startDocumentAreaNode.addEvent("click",function(t){this.closeStartDocumentArea()}.bind(this))},createStartDocumentCloseNode:function(){this.startDocumentTopNode=new Element("div",{styles:this.css.startDocumentTopNode}).inject(this.startDocumentAreaNode),this.startDocumentCloseNode=new Element("div",{styles:this.css.startDocumentCloseNode}).inject(this.startDocumentTopNode),this.startDocumentCloseNode.addEvent("click",function(t){this.closeStartDocumentArea()}.bind(this))},createStartDocumentScrollNode:function(){this.startDocumentScrollNode=new Element("div",{styles:this.css.startDocumentScrollNode}).inject(this.startDocumentAreaNode),MWF.require("MWF.widget.ScrollBar",function(){new MWF.widget.ScrollBar(this.startDocumentScrollNode,{style:"xApp_taskcenter",where:"after",distance:30,friction:4,axis:{x:!1,y:!0}})}.bind(this)),this.startDocumentContentNode=new Element("div",{styles:this.css.startDocumentContentNode}).inject(this.startDocumentScrollNode)},listColumns:function(){this.getAction(function(){this.action.listColumnByPublish(function(t){t.data.each(function(t){t.name||(t.name=t.appName),new MWF.xApplication.cms.Index.Creater.Column(t,this.app,this,this.startDocumentContentNode)}.bind(this))}.bind(this))}.bind(this))},getAction:function(t){this.action||(this.action=MWF.Actions.get("x_cms_assemble_control")),t&&t()},setResizeStartDocumentAreaHeight:function(){var t=this.app.content.getSize();if(this.startDocumentAreaNode){var e=this.startDocumentCloseNode.getSize(),s=t.y-e.y-80,i=t.x-110,n=t.y-60,o=t.x-90;this.startDocumentScrollNode.setStyle("height",s+"px"),this.startDocumentScrollNode.setStyle("width",i+"px"),this.startDocumentAreaNode.setStyle("height",n+"px"),this.startDocumentAreaNode.setStyle("width",o+"px")}}}),MWF.xApplication.cms.Index.Creater.Column=new Class({initialize:function(t,e,s,i,n){this.bgColors=["#30afdc","#e9573e","#8dc153","#9d4a9c","#ab8465","#959801","#434343","#ffb400","#9e7698","#00a489"],this.data=t,this.app=e,this.creater=s,this.container=i,this.css=this.creater.css,this.needGetCategorys=n,this.load()},load:function(){this.node=new Element("div",{styles:this.css.columnNode}).inject(this.container),this.topNode=new Element("div",{styles:this.css.columnTopNode}).inject(this.node);var t=this.iconAreaNode=new Element("div",{styles:this.css.columnIconAreaNode}).inject(this.topNode);this.iconNode=new Element("img",{styles:this.css.columnIconNode}).inject(t);this.data.appIcon?this.iconNode.set("src","data:image/png;base64,"+this.data.appIcon):this.iconNode.set("src",this.creater.path+this.creater.options.style+"/column.png"),this.textNode=new Element("div",{styles:this.css.columnTextNode}).inject(this.topNode),this.textNode.set("text",this.data.name),this.childNode=new Element("div",{styles:this.css.columnChildNode}).inject(this.node),this.loadChild()},loadChild:function(){this.needGetCategorys?this.creater.getAction(function(){this.creater.action.listCategoryByPublisher(this.data.id,function(t){t.data.length?t.data.each(function(t){new MWF.xApplication.cms.Index.Creater.Category(t,this,this.childNode)}.bind(this)):this.node.setStyle("display","none")}.bind(this),null,this.data.id)}.bind(this)):this.data.wrapOutCategoryList&&this.data.wrapOutCategoryList.length?this.data.wrapOutCategoryList.each(function(t){new MWF.xApplication.cms.Index.Creater.Category(t,this,this.childNode)}.bind(this)):this.node.setStyle("display","none")}}),MWF.xApplication.cms.Index.Creater.Category=new Class({initialize:function(t,e,s){this.data=t,this.column=e,this.app=this.column.app,this.creater=this.column.creater,this.container=s,this.css=this.creater.css,this.load()},load:function(){this.data.name||(this.data.name=this.data.categoryName),this.node=new Element("div.categoryItem",{styles:this.css.startCategoryNode}).inject(this.container),this.iconNode=new Element("div",{styles:this.css.categoryIconNode}).inject(this.node),this.textNode=new Element("div",{styles:this.css.categoryTextNode}).inject(this.node),this.textNode.set({text:this.data.categoryName});this.node.addEvents({mouseover:function(t){this.node.setStyles(this.css.startCategoryNode_over)}.bind(this),mouseout:function(t){this.node.setStyles(this.css.startCategoryNode_out)}.bind(this),click:function(t){this.createDocument(t)}.bind(this)})},createDocument:function(){this.creater.closeStartDocumentArea(),this.data.formId&&""!=this.data.formId?MWF.xDesktop.requireApp("cms.Index","Starter",function(){new MWF.xApplication.cms.Index.Starter(this.column.data,this.data,this.app,{onPostPublish:function(){this.creater.view&&this.creater.view.reload()}.bind(this)}).load()}.bind(this)):this.app.notice(this.creater.lp.noFormSelected,"error")}});