function RadDigitMaskPart(){ } RadDigitMaskPart.prototype=new RadMaskPart(); RadDigitMaskPart.prototype.GetValue=function(){ return this.value.toString(); }; RadDigitMaskPart.prototype.IsCaseSensitive=function(){ return true; }; RadDigitMaskPart.prototype.GetVisValue=function(){ if(this.value.toString()==""){ return this.PromptChar; } return this.value.toString(); }; RadDigitMaskPart.prototype.CanHandle=function(_1,_2){ if(isNaN(parseInt(_1))){ this.controller._OnChunkError(this,this.GetValue(),_1); return false; } return true; }; RadDigitMaskPart.prototype.SetValue=function(_3,_4){ if(_3==""||_3==this.PromptChar||_3==" "){ this.value=""; return true; } if(this.CanHandle(_3,_4)){ this.value=parseInt(_3); } return true; };;function RadEnumerationMaskPart(_1){ this.SetOptions(_1); this.lastOffsetPunched=-1; this.selectedForCompletion=0; this.FlipDirection=0; this.RebuildKeyBuff(); } RadEnumerationMaskPart.prototype=new RadMaskPart(); RadEnumerationMaskPart.prototype.SetOptions=function(_2){ this.length=0; this.Options=_2; this.optionsIndex=[]; for(var i=0;i0){ var _10=this.optionsIndex[_f[this.selectedForCompletion%_f.length]]; this.SetOption(_10); }else{ this.SetNoCompletionValue(); return false; } return true; }; RadEnumerationMaskPart.prototype.GetVisValue=function(){ var v=this.value; while(v.length=this.Options.length){ _12=_12-this.Options.length-1; this.FlipDirection=1; } } }else{ if(_12<0){ _12=this.Options.length+_12; this.FlipDirection=-1; }else{ if(_12>=this.Options.length){ _12=_12-this.Options.length; this.FlipDirection=1; } } } this.selectedIndex=_12; this.value=_12==-1?"":this.Options[_12]; if(typeof (up)!="undefined"){ if(up){ this.controller._OnMoveUp(this,_14,this.value); }else{ this.controller._OnMoveDown(this,_14,this.value); } } this.controller._OnEnumChanged(this,_14,this.value); this.FlipDirection=0; }; RadEnumerationMaskPart.prototype.HandleKey=function(e){ this.controller.CalculateSelection(); var _16=new MaskedEventWrap(e,this.controller.TextBoxElement); if(_16.IsDownArrow()){ this.SetOption(this.selectedIndex+1,false); this.controller._Visualise(); this.controller._FixSelection(_16); return true; }else{ if(_16.IsUpArrow()){ this.SetOption(this.selectedIndex-1,true); this.controller._Visualise(); this.controller._FixSelection(_16); return true; } } }; RadEnumerationMaskPart.prototype.HandleWheel=function(e){ this.controller.CalculateSelection(); var _18=new MaskedEventWrap(e,this.controller.TextBoxElement); this.SetOption(this.selectedIndex-e.wheelDelta/120); this.controller._Visualise(); this.controller._FixSelection(_18); return false; }; function CompletionList(_19,_1a){ this.options=_19; this.blankChar=_1a; } CompletionList.prototype.GetCompletions=function(_1b,_1c){ var _1d=this.options; for(var _1e=0;_1e<=_1c;_1e++){ var _1f=_1b[_1e].toLowerCase(); _1d=this.FilterCompletions(_1d,_1e,_1f); } return _1d; }; CompletionList.prototype.FilterCompletions=function(_20,_21,key){ var _23=[]; for(var _24=0;_24<_20.length;_24++){ var _25=_20[_24]; var _26=_25.charAt(_21).toLowerCase(); if(this.CharacterMatchesCompletion(key,_26)){ _23[_23.length]=_25; } } return _23; }; CompletionList.prototype.CharacterMatchesCompletion=function(_27,_28){ return _27==this.blankChar||_27==" "||_27==_28; };;function RadFreeMaskPart(){ } RadFreeMaskPart.prototype=new RadMaskPart(); RadFreeMaskPart.prototype.IsCaseSensitive=function(){ return true; }; RadFreeMaskPart.prototype.GetVisValue=function(){ if(this.value.toString()==""){ return this.PromptChar; } return this.value; }; RadFreeMaskPart.prototype.SetValue=function(_1,_2){ this.value=_1; return true; };;function RadInputHint(_1,_2){ this.textBox=_1; this.skin=_2; } RadInputHint.prototype.Show=function(_3,_4){ if(_3){ var _5=this.GetRect(this.textBox.TextBoxElement); this.Container=document.createElement("div"); if(_3.ShowHint(this.Container)){ this.Container.className="radHint_"+this.skin; document.body.appendChild(this.Container); this.Container.style.position="absolute"; if(_4){ this.Container.style.left=_4.left+this.BodyScrollWidth()+"px"; this.Container.style.top=_5.Y+_5.Height+"px"; }else{ this.Container.style.left=_5.X+"px"; this.Container.style.top=_5.Y+_5.Height+"px"; } this.CreateOverlay(); this.textBox._OnShowHint(this); }else{ this.Container=null; } } }; RadInputHint.prototype.HideOverlay=function(){ if(this.shim){ this.shim.style.visibility="hidden"; } }; RadInputHint.prototype.CreateOverlay=function(){ if(window.opera){ return; } if(!this.shim){ this.shim=document.createElement("IFRAME"); this.shim.src="javascript:false;"; this.shim.frameBorder=0; this.shim.id=this.Container.parentNode.id+"Overlay"; this.shim.style.position="absolute"; this.shim.style.visibility="hidden"; this.shim.style.border="1px solid red"; this.shim.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"; this.shim.allowTransparency=false; this.Container.parentNode.insertBefore(this.shim,this.Container); } var _6=this.GetRect(this.Container); this.shim.style.cssText=this.Container.style.cssText; this.shim.style.left=_6.X+"px"; this.shim.style.top=_6.Y+"px"; this.shim.style.width=_6.Width+"px"; this.shim.style.height=_6.Height+"px"; this.shim.style.visibility="visible"; }; RadInputHint.prototype.FindScrollPosX=function(_7){ var x=0; var _9=_7; while(_9.parentNode&&_9.parentNode.tagName!="BODY"){ if(typeof (_9.parentNode.scrollLeft)=="number"){ x+=_9.parentNode.scrollLeft; } _9=_9.parentNode; } return x; }; RadInputHint.prototype.FindScrollPosY=function(_a){ var y=0; var _c=_a; while(_c.parentNode&&_c.parentNode.tagName!="BODY"){ if(typeof (_c.parentNode.scrollTop)=="number"){ y+=_c.parentNode.scrollTop; } _c=_c.parentNode; } return y; }; RadInputHint.prototype.BodyScrollWidth=function(){ var _d=0; if(typeof (document.body.scrollLeft)=="number"){ _d+=document.body.scrollLeft; } if(typeof (document.documentElement.scrollLeft)=="number"){ _d+=document.documentElement.scrollLeft; } return _d; }; RadInputHint.prototype.BodyScrollHeight=function(){ var _e=0; if(typeof (document.body.scrollTop)=="number"){ _e+=document.body.scrollTop; } if(typeof (document.documentElement.scrollTop)=="number"){ _e+=document.documentElement.scrollTop; } return _e; }; RadInputHint.prototype.FindScrollPosXOpera=function(_f){ var x=0; var _11=_f; while(_11.offsetParent&&_11.offsetParent.tagName!="BODY"){ if(typeof (_11.offsetParent.scrollLeft)=="number"){ x+=_11.offsetParent.scrollLeft; } _11=_11.offsetParent; } return x; }; RadInputHint.prototype.FindScrollPosYOpera=function(_12){ var y=0; var _14=_12; while(_14.offsetParent&&_14.offsetParent.tagName!="BODY"){ if(typeof (_14.offsetParent.scrollTop)=="number"){ y+=_14.offsetParent.scrollTop; } _14=_14.offsetParent; } return y; }; RadInputHint.prototype.Hide=function(){ if(this.Container){ this.HideOverlay(); this.Container.parentNode.removeChild(this.Container); this.Container=null; } }; RadInputHint.prototype.GetRect=function(_15){ var _16=_15.offsetWidth; var _17=_15.offsetHeight; var x=0; var y=0; var _1a=_15; while(_1a.offsetParent){ x+=_1a.offsetLeft; y+=_1a.offsetTop; _1a=_1a.offsetParent; } var _1b=0; var _1c=0; if(window.opera){ x-=this.FindScrollPosXOpera(_15); y-=this.FindScrollPosYOpera(_15); }else{ x-=this.FindScrollPosX(_15); y-=this.FindScrollPosY(_15); } return {X:x,Y:y,Width:_16,Height:_17}; };;function RadLiteralMaskPart(ch){ this.ch=ch; } RadLiteralMaskPart.prototype=new RadMaskPart(); RadLiteralMaskPart.prototype.GetVisValue=function(){ return this.ch; }; RadLiteralMaskPart.prototype.GetLength=function(){ if(this.controller.mozilla){ return this.ch.length-(this.ch.split("\r\n").length-1); } return this.ch.length; }; RadLiteralMaskPart.prototype.GetValue=function(){ return ""; }; RadLiteralMaskPart.prototype.IsCaseSensitive=function(){ if(this.NextChunk!=null){ return this.NextChunk.IsCaseSensitive(); } }; RadLiteralMaskPart.prototype.SetValue=function(_2,_3){ _3-=this.offset; return _2==this.ch.charAt(_3)||!_2; }; RadLiteralMaskPart.prototype.CanHandle=function(_4,_5){ _5-=this.offset; if(_4==this.ch.charAt(_5)){ return true; } if(!_4){ return true; } if(this.NextChunk!=null){ return this.NextChunk.CanHandle(_4,_5+this.GetLength()); } };;function RadLowerMaskPart(){ } RadLowerMaskPart.prototype=new RadMaskPart(); RadLowerMaskPart.prototype.CanHandle=function(_1,_2){ if(!RadMaskPart.IsAlpha(_1)){ this.controller._OnChunkError(this,this.GetValue(),_1); return false; } return true; }; RadLowerMaskPart.prototype.GetVisValue=function(){ if(this.value.toString()==""){ return this.PromptChar; } return this.value.toString(); }; RadLowerMaskPart.prototype.SetValue=function(_3,_4){ if(_3==""){ this.value=""; return true; } if(RadMaskPart.IsAlpha(_3)){ this.value=_3.toLowerCase(); }else{ this.controller._OnChunkError(this,this.GetValue(),_3); } return true; };;if(typeof (window.RadInputNamespace)=="undefined"){ window.RadInputNamespace=new Object(); } function RadMaskedTextBox(id,_2,_3){ RadTextBox.Extend(this); this.CallBase("DisposeOldInstance",arguments); this.Constructor(id); this.Initialize(_2,_3); } RadMaskedTextBox.prototype={Constructor:function(id){ this.CallBase("Constructor",arguments); },Initialize:function(_5,_6){ this.LoadCongfiguration(_5); this.LoadClientEvents(_5); this.parts=[]; this.partIndex=[]; this.displayPartIndex=[]; this.value=""; this.TextBoxElement.oldValue=this.TextBoxElement.value; this.lastState=null; this.length=0; this.displayLength=0; this.internalValueUpdate=false; this.projectedValue=""; this.Hint=null; this.isTextarea=this.TextBoxElement.tagName.toLowerCase()=="textarea"; this.safari=navigator.userAgent.indexOf("Safari")>-1; this.mozilla=navigator.userAgent.indexOf("Gecko")>-1; this.Hint=new RadInputHint(this,_5.Skin); this.Styles=_6; this.AttachEventHandlers(); this._FixAbsolutePositioning(); this._SetMask(this.InitialMasks); if(this.InitialDisplayMasks.length){ this._SetDisplayMask(this.InitialDisplayMasks); } this.SetValue(this.TextBoxElement.value); this._Visualise(); if(this.FocusOnStartup){ this.Focus(); } this._RecordInitialState(); },AttachEventHandlers:function(){ this.AttachDomEvent(this.TextBoxElement.form,"reset","OnReset"); this.AttachToTextBoxEvent("keydown","TextBoxKeyDownHandler"); this.AttachToTextBoxEvent("keypress","TextBoxKeyPressHandler"); this.AttachToTextBoxEvent("keyup","TextBoxKeyUpHandler"); this.AttachToTextBoxEvent("focus","TextBoxFocusHandler"); this.AttachToTextBoxEvent("blur","TextBoxBlurHandler"); this.AttachToTextBoxEvent("mousedown","TextBoxMouseDownHandler"); this.AttachToTextBoxEvent("mouseover","TextBoxMouseOverHandler"); this.AttachToTextBoxEvent("mouseout","TextBoxMouseOutHandler"); this.AttachToTextBoxEvent("mouseup","TextBoxMouseUpHandler"); if(this._ShouldUseAttachEvent(this.TextBoxElement)){ this.AttachToTextBoxEvent("paste","_onPaste"); this.AttachToTextBoxEvent("propertychange","_onPropertyChange"); this.AttachToTextBoxEvent("mousewheel","_onMouseWheel"); }else{ this.AttachToTextBoxEvent("input","_onInput"); } if(window.opera){ var _7=this; var _8=function(){ return _7._ValueHandler({}); }; setInterval(_8,10); } },SetValue:function(_9){ this.internalValueUpdate=true; this._UpdatePartsInRange(_9,0,this.length); this.internalValueUpdate=false; this._Visualise(); },Enable:function(){ this.TextBoxElement.disabled=""; this.Enabled=true; },Disable:function(){ this.TextBoxElement.disabled="disabled"; this.Enabled=false; },Focus:function(){ this.TextBoxElement.focus(); this.TextBoxElement.selectionStart=this.TextBoxElement.selectionEnd=0; },GetValue:function(){ var _a=[]; for(var i=0;i0||this.TextBoxElement.selectionEnd>0){ _1f(); }else{ setTimeout(_1f,1); } } },_OnMouseWheel:function(e){ if(this.ReadOnly){ return false; } this.CalculateSelection(); var _21=this.partIndex[this.TextBoxElement.selectionStart]; if(_21==null){ return true; } return _21.HandleWheel(e); },UpdateSelectionOnFocus:function(){ switch(this.SelectionOnFocus){ case 0: break; case 1: var _22=0; var i; for(i=0;i0){ this.SetCaretPosition(this.TextBoxElement.value.length); } break; case 3: this.SelectAllText(); break; default: this.SetCaretPosition(0); break; } },TextBoxKeyDownHandler:function(e){ this._FakeOnPropertyChange(); if(this.InSelection(e)){ return true; } var _25=this.partIndex[this.TextBoxElement.selectionStart]; var _26=e.which?e.which:e.keyCode; if(this.ReadOnly&&(_26==46||_26==8||_26==38||_26==40)){ RadControlsNamespace.DomEvent.PreventDefault(e); return false; }else{ if(_26==13){ return true; }else{ if(_25==null&&_26!=8){ return true; }else{ if(_25!=null){ if(_25.HandleKey(e)){ RadControlsNamespace.DomEvent.PreventDefault(e); return false; } } } } } var _27=this.TextBoxElement.selectionEnd; var _28=false; if((_26==46)&&_271){ _48[_48.length-2].NextChunk=_47; } _47.NextChunk=null; var _4b=_47.GetLength(); _47.offset=_49; _49+=_4b; } return _48; },_SetMask:function(_4c){ this.parts=this._CreatePartCollection(_4c,this.PromptChar); for(var i=0;ie.fieldValue.length){ if(e.selectionStart==this.TextBoxElement.value.length){ this.partIndex[this.partIndex.length-1].SetValue("",this.partIndex.length-1); } if(this.lastState.selectionEnd>e.selectionStart){ i=this.lastState.selectionEnd; while(i-->e.selectionStart){ this.partIndex[i].SetValue("",i); } }else{ i=this.lastState.selectionEnd+1; while(i-->e.selectionStart){ this.partIndex[i].SetValue("",i); e.selectionEnd++; } } } var _5a=this.lastState.selectionStart; var _5b=Math.min(e.selectionStart,this.length); var _5c=e.fieldValue.substr(_5a,_5b-_5a); var _5d=this._UpdatePartsInRange(_5c,_5a,_5b); e.selectionEnd+=_5d; this._FixSelection(e); },_SetPartValues:function(_5e,_5f,_60,_61,to){ var _63; var i=0; var j=_61; var _66=0; _60=_60.toString(); while(i-1){ _a=_a.replace(this.PromptChar,_b); } return _a; }; RadNumericRangeMaskPart.prototype.SetValue=function(_c,_d){ if(_c==""){ _c=0; } if(isNaN(parseInt(_c))&&_c!="+"&&_c!="-"){ return true; } _d-=this.offset; var _e=this.InsertAt(_c,_d); _e=this.ReplacePromptChar(_e); if(_e.indexOf("-")!=-1&&_e.indexOf("-")>0){ _e=_e.replace("-","0"); } if(isNaN(parseInt(_e))){ _e=0; } if(this.controller.RoundNumericRanges){ _e=Math.min(this.upperLimit,_e); _e=Math.max(this.lowerLimit,_e); this.setInternalValue(_e); }else{ if(_e<=this.upperLimit&&_e>=this.lowerLimit){ this.setInternalValue(_e); this.GetVisValue(); }else{ return false; } } this.GetVisValue(); return true; }; RadNumericRangeMaskPart.prototype.setInternalValue=function(_f){ var _10=this.value; this.value=_f; this.controller._OnEnumChanged(this,_10,_f); if(_10>_f){ this.controller._OnMoveDown(this,_10,_f); }else{ this.controller._OnMoveUp(this,_10,_f); } this.FlipDirection=0; }; RadNumericRangeMaskPart.prototype.GetVisValue=function(){ var out=""; var _12=Math.abs(this.value).toString(); if(this.leftAlign){ if(this.value<0){ out+=this.PromptChar; } out+=_12; while(out.lengththis.upperLimit){ _16=this.lowerLimit; this.FlipDirection=1; } this.setInternalValue(_16); this.controller._Visualise(); }; RadNumericRangeMaskPart.prototype.MoveDown=function(){ var _17=this.value; _17--; if(_17this.upperLimit){ _19=this.lowerLimit+(_19-this.upperLimit-1); this.FlipDirection=1; } this.setInternalValue(_19); this.controller._Visualise(); this.controller._FixSelection(_1a); return false; };;function RadPasswordMaskPart(){ } RadPasswordMaskPart.prototype=new RadMaskPart(); RadPasswordMaskPart.prototype.IsCaseSensitive=function(){ return true; }; RadPasswordMaskPart.prototype.GetVisValue=function(){ if(this.value.toString()==""){ return this.PromptChar; } return "*"; }; RadPasswordMaskPart.prototype.SetValue=function(_1,_2){ this.value=_1; return true; };;function RadUpperMaskPart(){ } RadUpperMaskPart.prototype=new RadMaskPart(); RadUpperMaskPart.prototype.CanHandle=function(_1,_2){ if(!RadMaskPart.IsAlpha(_1)){ this.controller._OnChunkError(this,this.GetValue(),_1); return false; } return true; }; RadUpperMaskPart.prototype.GetVisValue=function(){ if(this.value.toString()==""){ return this.PromptChar; } return this.value.toString(); }; RadUpperMaskPart.prototype.SetValue=function(_3,_4){ if(_3==""){ this.value=""; return true; } if(RadMaskPart.IsAlpha(_3)){ this.value=_3.toUpperCase(); }else{ this.controller._OnChunkError(this,this.GetValue(),_3); } return true; };;