YAHOO.CONTROLLER.BaseController=function(node){this.node=node;this.input;this.response;this.elattr;this.validationCode;this.isOptional;};YAHOO.CONTROLLER.BaseController.prototype.init=function(){};YAHOO.CONTROLLER.BaseController.prototype.hookAfterInit=function(){};YAHOO.CONTROLLER.BaseController.prototype.hookBeforeSubmit=function(){if(this.validationCode==-1&&this.elattr.required){this.validationCode=-2;} this.responseAction();};YAHOO.CONTROLLER.BaseController.prototype.validate=function(){return-1;};YAHOO.CONTROLLER.BaseController.prototype.isValid=function(){if(this.validationCode==undefined)return true;if(this.validationCode===-1){return(this.isOptional==="true"||this.isOptional==="1");} else{return(this.validationCode===0||this.validationCode===true);}};YAHOO.CONTROLLER.BaseController.prototype.getResponse=function(input_id){YAHOO.log("BaseController getResponse "+input_id,"info");try{return YAHOO.util.Dom.get("response_"+input_id);} catch(e){YAHOO.log("BaseController "+e,"error");return null;}};YAHOO.CONTROLLER.BaseController.prototype.getAttribute=function(){YAHOO.log("BaseController getAttribute ","info");YAHOO.log("BaseController getAttribute "+this.node.value,"info");if(!YAHOO.lang.isObject(this.elattr)){this.elattr=new Object();if(this.node){attrStr=this.node.getAttribute("elattr");if(YAHOO.lang.isString(attrStr)){attrArr=attrStr.split(",");if(YAHOO.lang.isArray(attrArr)){for(i=0;i2) if(xy[1]>this.y){this.input.rows+=1 this.y=xy[1];}else{this.input.rows-=1 this.y=xy[1];}};YAHOO.CONTROLLER.TextareaController.prototype.doValidate=function(){this.validationCode=Validation.validateTextarea(this.input.value,this.elattr);this.responseAction();};YAHOO.CONTROLLER.TextareaController.prototype.setRemaining=function(remaining){this.rem.innerHTML=remaining;};YAHOO.CONTROLLER.TextareaController.prototype.responseAction=function(){switch(this.validation){case true:Response.clear(this.response);break;case false:Response.set(this.response,"error","email ongeldig");break;case-1:default:Response.clear(this.response);}};YAHOO.CONTROLLER.DatePickerController=function(node,owner){this.node=node;this.owner=owner;this.test="hi there";};YAHOO.CONTROLLER.DatePickerController.prototype.init=function(){this.id=this.node.id;if(this.node){YAHOO.util.Event.addListener(this.id,"click",this.show,this,true);}};YAHOO.CONTROLLER.DatePickerController.prototype.create=function(){if(!this.panel){this.panel=new YAHOO.widget.Calendar("calendar_"+this.id,this.owner.input.id+"_datepickerCalendar",{title:"Choose a date:",close:true});selectEvent=this.selectDate;this.panel.cfg.setProperty("selected","4/10/2007",false);this.panel.cfg.setProperty("HIDE_BLANK_WEEKS",true);this.panel.cfg.setProperty("HIDE_BLANK_WEEKS",true);if(this.owner.elattr.range){arr=this.owner.elattr.range.split(":");mindate=arr[0];maxdate=arr[1];this.panel.cfg.setProperty("mindate",mindate);this.panel.cfg.setProperty("maxdate",maxdate);}} if(YAHOO.PANEL.active){YAHOO.PANEL.active.hide();}};YAHOO.CONTROLLER.DatePickerController.prototype.selectEvent=function(type,args,obj){var dates=args[0];var date=dates[0];var year=date[0],month=date[1],day=date[2];this.owner.setCalendarDate(day+"-"+month+"-"+year);YAHOO.PANEL.active.hide();this.panel=null;};YAHOO.CONTROLLER.DatePickerController.prototype.show=function(){this.create();if(this.owner.input.value){enteredDate=this.owner.input.value;isValid=YAHOO.VAL.Validate.isDate(enteredDate.toStructuredDate());if(isValid!=0||!isNaN(isValid)){readable=enteredDate.toStructuredDate().toReadableDate("%n%/%j%/%Y%");readableMonth=enteredDate.toStructuredDate().toReadableDate("%n%/%Y%");this.panel.cfg.setProperty("pagedate",readableMonth);this.panel.select(readable);}} try{this.panel.render();this.panel.selectEvent.subscribe(this.selectEvent,this,true);this.panel.show();YAHOO.PANEL.active=this.panel;YAHOO.util.Event.addListener(document,"keyup",this.hide,this,true);} catch(err){YAHOO.log("datepicker rendering error "+err,"error");}};YAHOO.CONTROLLER.DatePickerController.prototype.addListener=function(e){YAHOO.util.Event.addListener(document,"click",this.hide,this,true);};YAHOO.CONTROLLER.DatePickerController.prototype.removeListener=function(e){alert('hide listener');YAHOO.util.Event.removeListener(document,"click",this.hide);};YAHOO.CONTROLLER.DatePickerController.prototype.hide=function(e){if(e.type=="keyup"){if(YAHOO.util.Event.getCharCode(e)==27){if(this.panel)this.panel.hide();} else{return;}}};YAHOO.CONTROLLER.TransferlistObjectController=function(owner){this.owner=owner;this.originalId;this.pickContainerId;this.selectedContainerId;this.selectButtonId;this.deSelectButtonId;this.cloneContainerId;this.pickListArray;this.selectedListArray;this.init();} YAHOO.CONTROLLER.TransferlistObjectController.prototype.init=function(){this.originalId=this.owner.input.id;this.pickContainerId="pick_"+this.originalId;this.selectedContainerId="select_"+this.originalId;this.selectOneButtonId="selectOne_"+this.originalId;this.deSelectOneButtonId="deSelectOne_"+this.originalId;this.selectAllButtonId="selectAll_"+this.originalId;this.deSelectAllButtonId="deSelectAll_"+this.originalId;this.cloneContainerId="cloneContainer_"+this.originalId;this.pickListArray=new Array();this.selectedListArray=new Array();div=document.createElement("DIV");YAHOO.util.Dom.setStyle(div,'display','none');div.setAttribute("id",this.cloneContainerId);copy=this.owner.input.cloneNode(true);div.appendChild(copy);this.owner.node.parentNode.appendChild(div);this.copySelectedOptions(this.owner.input,copy);replacingNode=this.makeList();replaced=this.owner.node.parentNode.replaceChild(replacingNode,this.owner.node);this.original=document.getElementById(this.originalId);this.picker=document.getElementById(this.pickContainerId);this.selector=document.getElementById(this.selectedContainerId);if(replaced){this.fill();YAHOO.util.Event.on(this.picker,"dblclick",this.selectOne,this,true);YAHOO.util.Event.on(this.selector,"dblclick",this.deSelectOne,this,true);YAHOO.util.Event.on(this.selectOneButtonId,"click",this.selectOne,this,true);YAHOO.util.Event.on(this.deSelectOneButtonId,"click",this.deSelectOne,this,true);YAHOO.util.Event.on(this.selectAllButtonId,"click",this.selectAll,this,true);YAHOO.util.Event.on(this.deSelectAllButtonId,"click",this.deSelectAll,this,true);YAHOO.util.Event.on(this.pickContainerId,"click",this.checkButtons,this,true);YAHOO.util.Event.on(this.selectedContainerId,"click",this.checkButtons,this,true);}} YAHOO.CONTROLLER.TransferlistObjectController.prototype.fill=function(){this.emptyBoxes();arr=this.original.options;for(i=0;i>');butAll.appendChild(butAlltext);butL=document.createElement('BUTTON');butL.setAttribute('id',this.selectOneButtonId);butL.setAttribute('title',LOCALIZE.messages.TRANSFER_SELECTONE);butL.setAttribute('type','button');butLtext=document.createTextNode('>');butL.appendChild(butLtext);butR=document.createElement('BUTTON');butR.setAttribute('id',this.deSelectOneButtonId);butR.setAttribute('type','button');butR.setAttribute('title',LOCALIZE.messages.TRANSFER_DESELECTONE);butRtext=document.createTextNode('<');butR.appendChild(butRtext);butNone=document.createElement('BUTTON');butNone.setAttribute('id',this.deSelectAllButtonId);butNone.setAttribute('type','button');butNone.setAttribute('title',LOCALIZE.messages.TRANSFER_DESELECTALL);butNonetext=document.createTextNode('<<');butNone.appendChild(butNonetext);buttonSpan.appendChild(butAll);buttonSpan.appendChild(butL);buttonSpan.appendChild(butR);buttonSpan.appendChild(butNone);divC.appendChild(buttonSpan);labelR=document.createElement('LABEL');YAHOO.util.Dom.addClass(labelR,'hidden');labelR.setAttribute('for',this.selectedContainerId);labelRtext=document.createTextNode('label right');labelR.appendChild(labelRtext);divC.appendChild(labelR);selectR=document.createElement('SELECT');selectR.setAttribute('name',this.selectedContainerId);selectR.setAttribute('id',this.selectedContainerId);selectR.setAttribute('title','transferSelectedList');selectR.setAttribute('multiple','multiple');YAHOO.util.Dom.addClass(selectR,'fileselect');YAHOO.util.Dom.addClass(selectR,'leftFloat');divC.appendChild(selectR);return fieldset;};YAHOO.CONTROLLER.TransferlistController=function(node){this.node=node;this.label;} YAHOO.CONTROLLER.TransferlistController.prototype=new YAHOO.CONTROLLER.BaseController();YAHOO.lang.extend(YAHOO.CONTROLLER.TransferlistController,YAHOO.CONTROLLER.BaseController);YAHOO.CONTROLLER.TransferlistController.prototype.init=function(){if(this.node){this.input=YAHOO.util.Dom.getElementsByClassName("fileselect","select",this.node)[0];this.label=YAHOO.util.Dom.getElementsBy(function(el){return(el.getAttribute("for"));},"label",this.node)[0];this.getAttribute();this.response=this.getResponse(this.input.id);if(this.input){this.createTransferList();} else YAHOO.log("create transferlist: no input","error");}} YAHOO.CONTROLLER.TransferlistController.prototype.createTransferList=function(){this.list=new YAHOO.CONTROLLER.TransferlistObjectController(this);} YAHOO.CONTROLLER.TransferlistController.prototype.hookAfterInit=function(){} YAHOO.CONTROLLER.TransferlistController.prototype.validate=function(){} YAHOO.CONTROLLER.TransferlistController.prototype.responseAction=function(){switch(this.validationCode){case true:Response.clear(this.response);break;case false:Response.set(this.response,"error",LOCALIZE.messages.TRANSFER_INVALID);break;case-2:Response.set(this.response,"error",LOCALIZE.messages.TRANSFER_MANDATORY);break;case-1:break;default:Response.clear(this.response);}};