| 1 |
- MWF.require("MWF.xDesktop.Widget",null,false);MWF.xApplication.Common.Widget=new Class({Extends:MWF.widget.Common,Implements:[Options,Events],options:{style:"default",appName:"Common",name:"Widget",width:"400",height:"400",position:{right:10,bottom:10}},initialize:function(t,i){this.setOptions(i);this.desktop=t;this.path="/x_component_"+this.options.appName.replace(/\./g,"_")+"/$"+this.options.name.replace(/\./g,"/")+"/";this.cssPath=this.path+this.options.style+"/css.wcss";this._loadCss()},fireAppEvent:function(t){this.fireEvent(t);if(this[("on-"+t).camelCase()])this[("on-"+t).camelCase()]()},load:function(t){this.fireAppEvent("queryLoad");this.loadWidget()},loadContent:function(t){if(t)t()},loadWidget:function(){this.fireAppEvent("queryLoadWidget");var t={title:this.options.title,width:this.options.width,height:this.options.height,position:this.options.position,onQueryClose:function(){this.fireAppEvent("rueryClose")}.bind(this),onPostClose:function(){this.desktop.closeWidget(this);this.fireAppEvent("postClose")}.bind(this),onScroll:function(t){this.fireEvent("scroll",[t])}.bind(this),onOpen:function(t){this.openApplication(t)}.bind(this),onDragComplete:function(t,i){this.fireEvent("dragComplete",[t,i])}.bind(this)};this.widget=new MWF.xDesktop.Widget(this.desktop,t);this.fireAppEvent("loadWidget");this.widget.load();this.fireAppEvent("postLoadWidget");this.fireAppEvent("queryLoadContent");this.content=this.widget.contentNode;this.loadContent(function(){this.fireAppEvent("postLoadContent")}.bind(this));this.fireAppEvent("postLoad")},openApplication:function(t){this.desktop.openApplication(t,this.options.appName)},onQueryLoad:function(){},onQueryLoadWidget:function(){},onLoadWidget:function(){},onPostLoadWidget:function(){},onQueryLoadContent:function(){},onPostLoadContent:function(){},onPostLoad:function(){},onQueryClose:function(){},onPostClose:function(){}});
|