| 1 |
- MWF.xApplication.process.FormDesigner.widget=MWF.xApplication.process.FormDesigner.widget||{};MWF.require("MWF.widget.ImageClipper",null,false);MWF.xApplication.process.FormDesigner.widget.ImageClipper=new Class({Implements:[Options,Events],Extends:MWF.widget.Common,options:{title:"Select Image",style:"default",width:"92",height:"73"},initialize:function(t,e){debugger;this.setOptions(e);this.app=t;this.path="/x_component_process_FormDesigner/widget/$ImageClipper/";this.cssPath="/x_component_process_FormDesigner/widget/$ImageClipper/"+this.options.style+"/css.wcss";this._loadCss()},load:function(t){this.data=t;var e={};var i=e.width||"770";var s=e.height||"580";i=i.toInt();s=s.toInt();var o=this.app.content.getSize();var n=(o.x-i)/2;var a=(o.y-s)/2;if(n<0)n=0;if(a<0)a=0;if(layout.mobile){n=20;a=0}var p=this;MWF.require("MWF.xDesktop.Dialog",function(){var t=new MWF.xDesktop.Dialog({title:this.options.title||"Select Image",style:e.style||"image",top:a,left:n-20,fromTop:a,fromLeft:n-20,width:i,height:s,html:"<div></div>",maskNode:this.app.content,container:this.app.content,buttonList:[{text:MWF.LP.process.button.ok,action:function(){p.data=p.image.getBase64Image();p.fireEvent("change");this.close()}},{text:MWF.LP.process.button.cancel,action:function(){this.close()}}]});t.show();this.image=new MWF.widget.ImageClipper(t.content.getFirst(),{aspectRatio:this.options.width.toInt()/this.options.height.toInt()});this.image.load(this.data)}.bind(this))}});
|