Ext.namespace("Ext.ux.form");Ext.ux.form.SecurePass=function(b){Ext.ux.form.SecurePass.superclass.constructor.call(this,b)};Ext.extend(Ext.ux.form.SecurePass,Ext.form.TextField,{errors:{PwdEmpty:"Please type a password, and then retype it to confirm.",PwdShort:"Your password must be at least 6 characters long. Please type a different password.",PwdLong:"Your password can't contain more than 16 characters. Please type a different password.",PwdBadChar:"The password contains characters that aren't allowed. Please type a different password.",IDInPwd:"Your password can't include the part of your ID. Please type a different password.",FNInPwd:"Your password can't contain your first name. Please type a different password.",LNInPwd:"Your password can't contain your last name. Please type a different password."},meterLabel:"",pwdStrengths:["WEAK","MEDIUM","STRONG"],fieldsFilter:null,strength:0,_lastPwd:null,kCapitalLetter:0,kSmallLetter:1,kDigit:2,kPunctuation:3,initEvents:function(){Ext.ux.form.SecurePass.superclass.initEvents.call(this);this.el.on("keyup",this.checkStrength,this,{buffer:50})},onRender:function(c,d){Ext.ux.form.SecurePass.superclass.onRender.call(this,c,d);this.wrap=this.el.wrap({cls:"x-form-field-wrap"});this.trigger=this.wrap.createChild({tag:"div",cls:"StrengthMeter "+this.triggerClass});if(this.meterLabel!=""){this.trigger.createChild({tag:"label",html:this.meterLabel})}this.trigger.createChild({tag:"div",cls:"PwdMeterBase",html:'
'});if(this.hideTrigger){this.trigger.setDisplayed(false)}this.setSize(this.width||"",this.height||"")},onDestroy:function(){if(this.trigger){this.trigger.removeAllListeners();this.trigger.remove()}if(this.wrap){this.wrap.remove()}Ext.form.TriggerField.superclass.onDestroy.call(this)},checkStrength:function(){var d=this.el.getValue();if(d==this._lastPwd){return}var c;if(this.ClientSideStrongPassword(d)){c=3}else{if(this.ClientSideMediumPassword(d)){c=2}else{if(this.ClientSideWeakPassword(d)){c=1}else{c=0}}}document.getElementById("PwdMeter").style.width=82*c+"px";if(this.pwdStrengths!=null&&c>0){document.getElementById("PwdMeter").innerHTML=" "+this.pwdStrengths[c-1]}else{document.getElementById("PwdMeter").innerHTML=""}this._lastPwd=d},validateValue:function(value){if(!Ext.form.TextField.superclass.validateValue.call(this,value)){return false}if(value.length==0){this.markInvalid(this.errors.PwdEmpty);return false}if("[\x21-\x7e]*".match(value)){this.markInvalid(this.errors.PwdBadChar);return false}if(value.length<6){this.markInvalid(this.errors.PwdShort);return false}if(value.length>16){this.markInvalid(this.errors.PwdLong);return false}for(var index=0;index="A"&&c<="Z"){return true}break;case this.kSmallLetter:if(c>="a"&&c<="z"){return true}break;case this.kDigit:if(c>="0"&&c<="9"){return true}break;case this.kPunctuation:if("!@#$%^&*()_+-='\";:[{]}|.>,?`~".indexOf(c)>=0){return true}break;default:return false}},IsLongEnough:function(c,d){return !(c==null||isNaN(d)||c.length'+this.nodeToString(this.tree.getRootNode())+""},nodeToString:function(l){if(!this.nodeFilter(l)){return""}var e="/gi,">")}catch(k){}try{m=m.replace(/\"}else{e+=">";for(var p=0;p"}return e}});Ext.tree.JsonTreeSerializer=function(d,c){Ext.tree.JsonTreeSerializer.superclass.constructor.apply(this,arguments)};Ext.extend(Ext.tree.JsonTreeSerializer,Ext.tree.TreeSerializer,{toString:function(){return this.nodeToString(this.tree.getRootNode())},nodeToString:function(k){if(!this.nodeFilter(k)){return""}var j=false,c="{";for(var l in k.attributes){if(this.attributeFilter(l,k.attributes[l])){if(j){c+=","}c+='"'+(this.attributeMap?(this.attributeMap[l]||l):l)+'":"'+k.attributes[l]+'"';j=true}}var m=k.childNodes;var i=m.length;if(i!=0){if(j){c+=","}c+='"children":[';for(var n=0;n0){c+=","}c+=this.nodeToString(m[n])}c+="]"}return c+"}"}});Ext.form.FileUploadField=Ext.extend(Ext.form.TextField,{buttonText:"Browse...",buttonOnly:false,buttonOffset:3,readOnly:true,autoSize:Ext.emptyFn,initComponent:function(){Ext.form.FileUploadField.superclass.initComponent.call(this);this.addEvents("fileselected")},onRender:function(f,e){Ext.form.FileUploadField.superclass.onRender.call(this,f,e);this.wrap=this.el.wrap({cls:"x-form-field-wrap x-form-file-wrap"});this.el.addClass("x-form-file-text");this.el.dom.removeAttribute("name");this.fileInput=this.wrap.createChild({id:this.getFileInputId(),name:this.name||this.getId(),cls:"x-form-file",tag:"input",type:"file",size:1});var d=Ext.applyIf(this.buttonCfg||{},{text:this.buttonText});this.button=new Ext.Button(Ext.apply(d,{renderTo:this.wrap,cls:"x-form-file-btn"+(d.iconCls?" x-btn-icon":"")}));if(this.buttonOnly){this.el.hide();this.wrap.setWidth(this.button.getEl().getWidth())}this.fileInput.on("change",function(){var a=this.fileInput.dom.value;this.setValue(a);this.fireEvent("fileselected",this,a)},this)},getFileInputId:function(){return this.id+"-file"},onResize:function(d,c){Ext.form.FileUploadField.superclass.onResize.call(this,d,c);this.wrap.setWidth(d);if(!this.buttonOnly){var d=this.wrap.getWidth()-this.button.getEl().getWidth()-this.buttonOffset;this.el.setWidth(d)}},preFocus:Ext.emptyFn,getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},alignErrorIcon:function(){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}});Ext.reg("fileuploadfield",Ext.form.FileUploadField);Ext.ns("Ext.ux.form");Ext.ux.form.XCheckbox=Ext.extend(Ext.form.Checkbox,{submitOffValue:"0",submitOnValue:"1",onRender:function(){this.inputValue=this.submitOnValue;Ext.ux.form.XCheckbox.superclass.onRender.apply(this,arguments);this.hiddenField=this.wrap.insertFirst({tag:"input",type:"hidden"});if(this.tooltip){this.imageEl.set({qtip:this.tooltip})}this.updateHidden()},setValue:function(b){b=this.convertValue(b);this.updateHidden(b);Ext.ux.form.XCheckbox.superclass.setValue.apply(this,arguments)},updateHidden:function(b){b=undefined!==b?b:this.checked;b=this.convertValue(b);if(this.hiddenField){this.hiddenField.dom.value=b?this.submitOnValue:this.submitOffValue;this.hiddenField.dom.name=b?"":this.el.dom.name}},convertValue:function(b){return(b===true||b==="true"||b===this.submitOnValue||String(b).toLowerCase()==="on")}});Ext.reg("xcheckbox",Ext.ux.form.XCheckbox);Ext.ux.DDView=function(c){if(!c.itemSelector){var d=c.tpl;if(this.classRe.test(d)){c.tpl=d.replace(this.classRe,"class=$1x-combo-list-item $2$1")}else{c.tpl=d.replace(this.tagRe,'$1 class="x-combo-list-item" $2')}c.itemSelector=".x-combo-list-item"}Ext.ux.DDView.superclass.constructor.call(this,Ext.apply(c,{border:false}))};Ext.extend(Ext.ux.DDView,Ext.DataView,{sortDir:"ASC",isFormField:true,classRe:/class=(['"])(.*)\1/,tagRe:/(<\w*)(.*?>)/,reset:Ext.emptyFn,clearInvalid:Ext.form.Field.prototype.clearInvalid,afterRender:function(){Ext.ux.DDView.superclass.afterRender.call(this);if(this.dragGroup){this.setDraggable(this.dragGroup.split(","))}if(this.dropGroup){this.setDroppable(this.dropGroup.split(","))}if(this.deletable){this.setDeletable()}this.isDirtyFlag=false;this.addEvents("drop")},validate:function(){return true},destroy:function(){this.purgeListeners();this.getEl().removeAllListeners();this.getEl().remove();if(this.dragZone){if(this.dragZone.destroy){this.dragZone.destroy()}}if(this.dropZone){if(this.dropZone.destroy){this.dropZone.destroy()}}},getName:function(){return this.name},setValue:function(d){if(!this.store){throw"DDView.setValue(). DDView must be constructed with a valid Store"}var c={};c[this.store.reader.meta.root]=d?[].concat(d):[];this.store.proxy=new Ext.data.MemoryProxy(c);this.store.load()},getValue:function(){var b="(";this.store.each(function(a){b+=a.id+","});return b.substr(0,b.length-1)+")"},getIds:function(){var c=0,d=new Array(this.store.getCount());this.store.each(function(a){d[c++]=a.id});return d},isDirty:function(){return this.isDirtyFlag},getTargetFromEvent:function(c){var d=c.getTarget();while((d!==null)&&(d.parentNode!=this.el.dom)){d=d.parentNode}if(!d){d=this.el.dom.lastChild||this.el.dom}return d},getDragData:function(i){var j=this.findItemFromChild(i.getTarget());if(j){if(!this.isSelected(j)){delete this.ignoreNextClick;this.onItemClick(j,this.indexOf(j),i);this.ignoreNextClick=true}var e={sourceView:this,viewNodes:[],records:[],copy:this.copy||(this.allowCopy&&i.ctrlKey)};if(this.getSelectionCount()==1){var g=this.getSelectedIndexes()[0];var h=this.getNode(g);e.viewNodes.push(e.ddel=h);e.records.push(this.store.getAt(g));e.repairXY=Ext.fly(h).getXY()}else{e.ddel=document.createElement("div");e.ddel.className="multi-proxy";this.collectSelection(e)}return e}return false},getRepairXY:function(b){return this.dragData.repairXY},collectSelection:function(c){c.repairXY=Ext.fly(this.getSelectedNodes()[0]).getXY();if(this.preserveSelectionOrder===true){Ext.each(this.getSelectedIndexes(),function(f){var a=this.getNode(f);var b=a.cloneNode(true);b.id=Ext.id();c.ddel.appendChild(b);c.records.push(this.store.getAt(f));c.viewNodes.push(a)},this)}else{var d=0;this.store.each(function(b){if(this.isSelected(d)){var a=this.getNode(d);var f=a.cloneNode(true);f.id=Ext.id();c.ddel.appendChild(f);c.records.push(this.store.getAt(d));c.viewNodes.push(a)}d++},this)}},setDraggable:function(b){if(b instanceof Array){Ext.each(b,this.setDraggable,this);return}if(this.dragZone){this.dragZone.addToGroup(b)}else{this.dragZone=new Ext.dd.DragZone(this.getEl(),{containerScroll:true,ddGroup:b});if(!this.multiSelect){this.singleSelect=true}this.dragZone.getDragData=this.getDragData.createDelegate(this);this.dragZone.getRepairXY=this.getRepairXY;this.dragZone.onEndDrag=this.onEndDrag}},setDroppable:function(b){if(b instanceof Array){Ext.each(b,this.setDroppable,this);return}if(this.dropZone){this.dropZone.addToGroup(b)}else{this.dropZone=new Ext.dd.DropZone(this.getEl(),{owningView:this,containerScroll:true,ddGroup:b});this.dropZone.getTargetFromEvent=this.getTargetFromEvent.createDelegate(this);this.dropZone.onNodeEnter=this.onNodeEnter.createDelegate(this);this.dropZone.onNodeOver=this.onNodeOver.createDelegate(this);this.dropZone.onNodeOut=this.onNodeOut.createDelegate(this);this.dropZone.onNodeDrop=this.onNodeDrop.createDelegate(this)}},getDropPoint:function(l,c,n){if(c==this.el.dom){return"above"}var m=Ext.lib.Dom.getY(c),b=m+c.offsetHeight;var e=m+(b-m)/2;var k=Ext.lib.Event.getPageY(l);if(k<=e){return"above"}else{return"below"}},isValidDropPoint:function(d,g,f){if(!f.viewNodes||(f.viewNodes.length!=1)){return true}var h=f.viewNodes[0];if(h==g){return false}if((d=="below")&&(g.nextSibling==h)){return false}if((d=="above")&&(g.previousSibling==h)){return false}return true},onNodeEnter:function(g,f,h,e){if(this.highlightColor&&(e.sourceView!=this)){this.el.highlight(this.highlightColor)}return false},onNodeOver:function(j,i,k,m){var e=this.dropNotAllowed;var l=this.getDropPoint(k,j,i);if(this.isValidDropPoint(l,j,m)){if(this.appendOnly||this.sortField){return"x-tree-drop-ok-below"}if(l){var n;if(l=="above"){e=j.previousSibling?"x-tree-drop-ok-between":"x-tree-drop-ok-above";n="x-view-drag-insert-above"}else{e=j.nextSibling?"x-tree-drop-ok-between":"x-tree-drop-ok-below";n="x-view-drag-insert-below"}if(this.lastInsertClass!=n){Ext.fly(j).replaceClass(this.lastInsertClass,n);this.lastInsertClass=n}}}return e},onNodeOut:function(g,f,h,e){this.removeDropIndicators(g)},onNodeDrop:function(r,i,n,p){if(this.fireEvent("drop",this,r,i,n,p)===false){return false}var e=this.getDropPoint(n,r,i);var q=(this.appendOnly||(r==this.el.dom))?this.store.getCount():r.viewIndex;if(e=="below"){q++}if(p.sourceView==this){if(e=="below"){if(p.viewNodes[0]==r){p.viewNodes.shift()}}else{if(p.viewNodes[p.viewNodes.length-1]==r){p.viewNodes.pop()}}if(!p.viewNodes.length){return false}if(q>this.store.indexOf(p.records[0])){q--}}if(p.node instanceof Ext.tree.TreeNode){var t=p.node.getOwnerTree().recordFromNode(p.node);if(t){p.records=[t]}}if(!p.records){alert("Programming problem. Drag data contained no Records");return false}for(var o=0;o{"+this.displayField+"}";if(!this.store){this.store=new Ext.data.SimpleStore({fields:this.dataFields,data:this.data})}this.view=new Ext.ux.DDView({multiSelect:true,store:this.store,selectedClass:l+"-selected",tpl:k,allowDup:this.allowDup,copy:this.copy,allowTrash:this.allowTrash,dragGroup:this.dragGroup,dropGroup:this.dropGroup,itemSelector:"."+l+"-item",isFormField:false,applyTo:h.body,appendOnly:this.appendOnly,sortField:this.sortField,sortDir:this.sortDir});h.add(this.view);this.view.on("click",this.onViewClick,this);this.view.on("beforeClick",this.onViewBeforeClick,this);this.view.on("dblclick",this.onViewDblClick,this);this.view.on("drop",function(d,a,e,b,c){return this.fireEvent("drop",d,a,e,b,c)},this);this.hiddenName=this.name;var i={tag:"input",type:"hidden",value:"",name:this.name};if(this.isFormField){this.hiddenField=this.el.createChild(i)}else{this.hiddenField=Ext.get(document.body).createChild(i)}h.doLayout()},initValue:Ext.emptyFn,onViewClick:function(i,e,j,h){var g=this.preClickSelections.indexOf(e);if(g!=-1){this.preClickSelections.splice(g,1);this.view.clearSelections(true);this.view.select(this.preClickSelections)}this.fireEvent("change",this,this.getValue(),this.hiddenField.dom.value);this.hiddenField.dom.value=this.getValue();this.fireEvent("click",this,h);this.validate()},onViewBeforeClick:function(h,f,e,g){this.preClickSelections=this.view.getSelectedIndexes();if(this.disabled){return false}},onViewDblClick:function(h,f,e,g){return this.fireEvent("dblclick",h,f,e,g)},getValue:function(f){var g=[];var h=this.view.getSelectedIndexes();if(h.length==0){return""}for(var e=0;ethis.maxLength){this.markInvalid(String.format(this.maxLengthText,this.maxLength));return false}return true}});Ext.reg("multiselect",Ext.ux.Multiselect);Ext.ux.ItemSelector=Ext.extend(Ext.form.Field,{msWidth:200,msHeight:300,hideNavIcons:false,imagePath:"",iconUp:"up2.gif",iconDown:"down2.gif",iconLeft:"left2.gif",iconRight:"right2.gif",iconTop:"top2.gif",iconBottom:"bottom2.gif",drawUpIcon:true,drawDownIcon:true,drawLeftIcon:true,drawRightIcon:true,drawTopIcon:true,drawBotIcon:true,fromStore:null,toStore:null,fromData:null,toData:null,displayField:0,valueField:1,switchToFrom:false,allowDup:false,focusClass:undefined,delimiter:",",readOnly:false,toLegend:null,fromLegend:null,toSortField:null,fromSortField:null,toSortDir:"ASC",fromSortDir:"ASC",toTBar:null,fromTBar:null,bodyStyle:null,border:false,defaultAutoCreate:{tag:"div"},initComponent:function(){Ext.ux.ItemSelector.superclass.initComponent.call(this);this.addEvents({rowdblclick:true,change:true})},onRender:function(m,i){Ext.ux.ItemSelector.superclass.onRender.call(this,m,i);this.fromMultiselect=new Ext.ux.Multiselect({legend:this.fromLegend,delimiter:this.delimiter,allowDup:this.allowDup,copy:this.allowDup,allowTrash:this.allowDup,dragGroup:this.readOnly?null:"drop2-"+this.el.dom.id,dropGroup:this.readOnly?null:"drop1-"+this.el.dom.id,width:this.msWidth,height:this.msHeight,dataFields:this.dataFields,data:this.fromData,displayField:this.displayField,valueField:this.valueField,store:this.fromStore,isFormField:false,tbar:this.fromTBar,appendOnly:true,sortField:this.fromSortField,sortDir:this.fromSortDir});this.fromMultiselect.on("dblclick",this.onRowDblClick,this);if(!this.toStore){this.toStore=new Ext.data.SimpleStore({fields:this.dataFields,data:this.toData})}this.toStore.on("add",this.valueChanged,this);this.toStore.on("remove",this.valueChanged,this);this.toStore.on("load",this.valueChanged,this);this.toMultiselect=new Ext.ux.Multiselect({legend:this.toLegend,delimiter:this.delimiter,allowDup:this.allowDup,dragGroup:this.readOnly?null:"drop1-"+this.el.dom.id,dropGroup:this.readOnly?null:"drop2-"+this.el.dom.id+",drop1-"+this.el.dom.id,width:this.msWidth,height:this.msHeight,displayField:this.displayField,valueField:this.valueField,store:this.toStore,isFormField:false,tbar:this.toTBar,sortField:this.toSortField,sortDir:this.toSortDir});this.toMultiselect.on("dblclick",this.onRowDblClick,this);var j=new Ext.Panel({bodyStyle:this.bodyStyle,border:this.border,layout:"table",layoutConfig:{columns:3}});j.add(this.switchToFrom?this.toMultiselect:this.fromMultiselect);var n=new Ext.Panel({header:false});j.add(n);j.add(this.switchToFrom?this.fromMultiselect:this.toMultiselect);j.render(this.el);n.el.down("."+n.bwrapCls).remove();if(this.imagePath!=""&&this.imagePath.charAt(this.imagePath.length-1)!="/"){this.imagePath+="/"}this.iconUp=this.imagePath+(this.iconUp||"up2.gif");this.iconDown=this.imagePath+(this.iconDown||"down2.gif");this.iconLeft=this.imagePath+(this.iconLeft||"left2.gif");this.iconRight=this.imagePath+(this.iconRight||"right2.gif");this.iconTop=this.imagePath+(this.iconTop||"top2.gif");this.iconBottom=this.imagePath+(this.iconBottom||"bottom2.gif");var k=n.getEl();if(!this.toSortField){this.toTopIcon=k.createChild({tag:"img",src:this.iconTop,style:{cursor:"pointer",margin:"2px"}});k.createChild({tag:"br"});this.upIcon=k.createChild({tag:"img",src:this.iconUp,style:{cursor:"pointer",margin:"2px"}});k.createChild({tag:"br"})}this.addIcon=k.createChild({tag:"img",src:this.switchToFrom?this.iconLeft:this.iconRight,style:{cursor:"pointer",margin:"2px"}});k.createChild({tag:"br"});this.removeIcon=k.createChild({tag:"img",src:this.switchToFrom?this.iconRight:this.iconLeft,style:{cursor:"pointer",margin:"2px"}});k.createChild({tag:"br"});if(!this.toSortField){this.downIcon=k.createChild({tag:"img",src:this.iconDown,style:{cursor:"pointer",margin:"2px"}});k.createChild({tag:"br"});this.toBottomIcon=k.createChild({tag:"img",src:this.iconBottom,style:{cursor:"pointer",margin:"2px"}})}if(!this.readOnly){if(!this.toSortField){this.toTopIcon.on("click",this.toTop,this);this.upIcon.on("click",this.up,this);this.downIcon.on("click",this.down,this);this.toBottomIcon.on("click",this.toBottom,this)}this.addIcon.on("click",this.fromTo,this);this.removeIcon.on("click",this.toFrom,this)}if(!this.drawUpIcon||this.hideNavIcons){this.upIcon.dom.style.display="none"}if(!this.drawDownIcon||this.hideNavIcons){this.downIcon.dom.style.display="none"}if(!this.drawLeftIcon||this.hideNavIcons){this.addIcon.dom.style.display="none"}if(!this.drawRightIcon||this.hideNavIcons){this.removeIcon.dom.style.display="none"}if(!this.drawTopIcon||this.hideNavIcons){this.toTopIcon.dom.style.display="none"}if(!this.drawBotIcon||this.hideNavIcons){this.toBottomIcon.dom.style.display="none"}var h=j.body.first();this.el.setWidth(j.body.first().getWidth());j.body.removeClass();this.hiddenName=this.name;var l={tag:"input",type:"hidden",value:"",name:this.name};this.hiddenField=this.el.createChild(l);this.valueChanged(this.toStore)},initValue:Ext.emptyFn,toTop:function(){var f=this.toMultiselect.view.getSelectedIndexes();var e=[];if(f.length>0){f.sort();for(var d=0;d-1;d--){record=e[d];this.toMultiselect.view.store.remove(record);this.toMultiselect.view.store.insert(0,record);f.push(((e.length-1)-d))}}this.toMultiselect.view.refresh();this.toMultiselect.view.select(f)},toBottom:function(){var f=this.toMultiselect.view.getSelectedIndexes();var e=[];if(f.length>0){f.sort();for(var d=0;d0){for(var e=0;e=0){this.toMultiselect.view.store.remove(f);this.toMultiselect.view.store.insert(h[e]-1,f);g.push(h[e]-1)}}this.toMultiselect.view.refresh();this.toMultiselect.view.select(g)}},down:function(){var f=null;var h=this.toMultiselect.view.getSelectedIndexes();h.sort();h.reverse();var g=[];if(h.length>0){for(var e=0;e0){for(var h=0;h0){for(var d=0;d