MWF.xApplication.Meeting.ListView = new Class({ Extends: MWF.widget.Common, Implements: [Options, Events], options: { "style": "default", "date": null, "action" : "" }, initialize: function(node, app, options){ this.setOptions(options); this.path = "../x_component_Meeting/$ListView/"; this.cssPath = "../x_component_Meeting/$ListView/"+this.options.style+"/css.wcss"; this._loadCss(); this.app = app; this.container = $(node); this.date = this.options.date || new Date(); this.load(); }, load: function(){ this.node = new Element("div", {"styles": this.css.node}).inject(this.container); this.leftNode = new Element("div", {"styles": this.css.leftNode}).inject(this.node); this.contentAreaNode = new Element("div.contentAreaNode", {"styles": this.css.contentAreaNode}).inject(this.node); this.contentNode = new Element("div.contentNode", {"styles": this.css.contentNode}).inject(this.contentAreaNode); //this.loadSideBar(); this.resetNodeSizeFun = this.resetNodeSize.bind(this); this.app.addEvent("resize", this.resetNodeSizeFun ); this.loadLeftNavi(); this.resetNodeSize(); }, resetNodeSize: function(){ //var size = this.container.getSize(); //if (this.app.meetingConfig.hideMenu=="static"){ // var y = size.y-120; // this.node.setStyle("height", ""+y+"px"); // this.node.setStyle("margin-top", "60px"); //}else{ // var y = size.y-20; // this.node.setStyle("height", ""+y+"px"); //} //if( this.app.inContainer )return; var size = this.container.getSize(); var y = size.y-60; this.node.setStyle("margin-top", "60px"); this.node.setStyle("height", ""+y+"px"); var sideBar = this.app.sideBar ? this.app.sideBar.getSize() : { x : 0, y : 0 }; //var x = size.x - sideBar.x; //this.node.setStyle("width", ""+x+"px"); this.contentAreaNode.setStyle("margin-right",sideBar.x+"px"); }, loadLeftNavi: function(){ var menuNode = new Element("div.menuNode", {"styles": this.css.menuNode, "text": this.app.lp.listNavi.myApply}).inject(this.leftNode); this.loadNaviItem(this.app.lp.listNavi.wait, "toApplyWait"); this.loadNaviItem(this.app.lp.listNavi.processing, "toApplyProcessing"); this.loadNaviItem(this.app.lp.listNavi.completed, "toApplyCompleted"); var menuNode = new Element("div.menuNode", {"styles": this.css.menuNode, "text": this.app.lp.listNavi.myMeeting}).inject(this.leftNode); this.loadNaviItem(this.app.lp.listNavi.wait, "toMeetingWait"); this.loadNaviItem(this.app.lp.listNavi.processing, "toMeetingProcessing"); this.loadNaviItem(this.app.lp.listNavi.completed, "toMeetingCompleted"); this.loadNaviItem(this.app.lp.listNavi.reject, "toMeetingReject"); //var menuNode = new Element("div", {"styles": this.css.menuNode, "text": this.app.lp.listNavi.room}).inject(this.leftNode); }, loadNaviItem: function(text, action){ var itemNode = new Element("div", {"styles": this.css.menuItemNode, "text": text}).inject(this.leftNode); var _self = this; itemNode.addEvents({ "mouseover": function(){if (_self.currentNavi != this) this.setStyles(_self.css.menuItemNode_over);}, "mouseout": function(){if (_self.currentNavi != this) this.setStyles(_self.css.menuItemNode);}, "click": function(){ if (_self.currentNavi){ _self.currentNavi.setStyles(_self.css.menuItemNode); _self.currentNavi.removeClass("mainColor_bg_opacity"); _self.currentNavi.removeClass("mainColor_color"); } _self.currentNavi = this; this.setStyles(_self.css.menuItemNode_current); _self.currentNavi.addClass("mainColor_bg_opacity"); _self.currentNavi.addClass("mainColor_color"); if (_self[action]) _self[action](); } }); itemNode.store("action",action); if( this.options.action == action){ itemNode.click(); }else if( action == "toApplyWait"){ itemNode.click(); } }, toApplyWait: function(){ if (this.currentView) this.currentView.destroy(); this.currentView = new MWF.xApplication.Meeting.ListView.ApplyWait(this); }, toApplyProcessing: function(){ if (this.currentView) this.currentView.destroy(); this.currentView = new MWF.xApplication.Meeting.ListView.ApplyProcessing(this); }, toApplyCompleted: function(){ if (this.currentView) this.currentView.destroy(); this.currentView = new MWF.xApplication.Meeting.ListView.ApplyCompleted(this); }, toMeetingWait: function(){ if (this.currentView) this.currentView.destroy(); this.currentView = new MWF.xApplication.Meeting.ListView.MeetingWait(this); }, toMeetingProcessing: function(){ if (this.currentView) this.currentView.destroy(); this.currentView = new MWF.xApplication.Meeting.ListView.MeetingProcessing(this); }, toMeetingCompleted: function(){ if (this.currentView) this.currentView.destroy(); this.currentView = new MWF.xApplication.Meeting.ListView.MeetingCompleted(this); }, toMeetingReject: function(){ if (this.currentView) this.currentView.destroy(); this.currentView = new MWF.xApplication.Meeting.ListView.MeetingReject(this); }, hide: function(){ var fx = new Fx.Morph(this.node, { "duration": "300", "transition": Fx.Transitions.Expo.easeOut }); fx.start({ "opacity": 0 }).chain(function(){ this.node.setStyle("display", "none"); }.bind(this)); }, show: function(){ this.node.setStyles(this.css.node); if( this.app.inContainer ){ this.node.setStyles({ "opacity": 1, "position": "static", "width": "auto" }); }else{ var fx = new Fx.Morph(this.node, { "duration": "800", "transition": Fx.Transitions.Expo.easeOut }); this.app.fireAppEvent("resize"); fx.start({ "opacity": 1, "left": "0px" }).chain(function(){ this.node.setStyles({ "position": "static", "width": "auto" }); }.bind(this)); } }, reload: function(){ if( this.currentView ){ this.currentView.reload(); }else{ this.app.reload(); } }, recordStatus : function(){ var action = ""; if( this.currentNavi )action = this.currentNavi.retrieve("action"); return { action : action }; }, destroy : function(){ if( this.currentView ){ this.currentView.destroy() } this.app.removeEvent("resize", this.resetNodeSizeFun ); this.node.destroy(); } }); MWF.xApplication.Meeting.ListView.View = new Class({ initialize: function(view, action){ this.view = view; this.css = this.view.css; this.container = this.view.contentNode; this.app = this.view.app; this.items = []; this.load(); }, reload : function(){ this.items = []; this.container.empty(); this.load(); }, load: function(){ this.loadHead(); MWF.require("MWF.widget.Mask", function(){ this.mask = new MWF.widget.Mask({"style": "desktop"}); this.mask.loadNode(this.view.contentAreaNode); }.bind(this)); this.loadList(); }, loadHead: function(){ this.table = new Element("table", { "styles": this.css.listViewTable, "border": "0", "cellPadding": "0", "cellSpacing": "0", "html": "