📄 radtabstrip.js
字号:
if (typeof(window.RadTabStripNamespace)=="\165ndefi\x6e\x65d"){window.RadTabStripNamespace=new Object(); } ; RadTabStripNamespace.ItemGroup= function (O,o){ this.Size=0; this.ExpandableSize=0; this.FixedSize=0; this.Items=[]; this.SizeMethod=o; this.SizeProperty=O; };RadTabStripNamespace.ItemGroup.prototype.RegisterItem= function (item,I){var A=item.className.indexOf("\x73eparato\x72")>-1; if (A){I= true; }else {item=item.firstChild; } this.Size+=RadTabStripNamespace.Box[this.SizeMethod](item); if (A || (I && item.firstChild.firstChild.style[this.SizeProperty])){ this.FixedSize+=RadTabStripNamespace.Box[this.SizeMethod](item); return; } this.ExpandableSize+=RadTabStripNamespace.Box[this.SizeMethod](item); this.Items[this.Items.length]=item; };RadTabStripNamespace.Align= function (U,Z,I){ this.Element=U; this.ItemGroups=[]; if (Z=="\x68o\x72\x69zontal"){ this.OuterSizeMethod="\x47etOuterWidt\x68"; this.InnerSizeMethod="\x47\x65tInner\x57\x69dth"; this.SetSizeMethod="\x53etOut\x65\x72Widt\x68"; this.OffsetProperty="\x6f\146f\x73\x65tTop"; this.SizeProperty="width"; }else { this.OuterSizeMethod="\x47etOute\x72\x48eight"; this.InnerSizeMethod="\x47etInnerHeig\x68\x74"; this.SetSizeMethod="\x53\145tO\x75\x74erHei\x67\x68t"; this.OffsetProperty="offsetLeft"; this.SizeProperty="hei\x67\x68t"; } this.SkipFixedSize=I; if (!this.Element.ItemGroups){ this.BuildItemGroups(); this.Element.ItemGroups=this.ItemGroups; }else { this.ItemGroups=this.Element.ItemGroups; }};RadTabStripNamespace.Align.prototype.CreateItemGroup= function (){return new RadTabStripNamespace.ItemGroup(this.SizeProperty,this.OuterSizeMethod); };RadTabStripNamespace.Align.prototype.BuildItemGroups= function (){var z=3; var children=this.Element.childNodes; var W=0; var w=-1; this.ItemGroups[0]=this.CreateItemGroup(); for (var i=0; i<children.length; i++){var item=children[i]; var V=item[this.OffsetProperty]; if (item.nodeType==z){continue; }if (w==-1){w=V; }if (V>w+1){W++; this.ItemGroups[W]=this.CreateItemGroup(); w=V; } this.ItemGroups[W].RegisterItem(item); } this.CalculateItemSizePercentage(); };RadTabStripNamespace.Align.prototype.CalculateItemSizePercentage= function (){for (var j=0; j<this.ItemGroups.length; j++){var v=this.ItemGroups[j]; for (var i=0; i<v.Items.length; i++){var item=v.Items[i]; if (this.SkipFixedSize && item.style[this.SizeProperty]){continue; }var T=RadTabStripNamespace.Box[this.OuterSizeMethod](item); var t=RadTabStripNamespace.Box[this.OuterSizeMethod](item.firstChild.firstChild); if (v.ExpandableSize==0){item.Percentage=0; }else {item.Percentage=T/v.ExpandableSize; }item.PaddingDiff=T-t; }}};RadTabStripNamespace.Align.prototype.InterateOverRows= function (S){var R=RadTabStripNamespace.Box[this.InnerSizeMethod](this.Element); for (var j=0; j<this.ItemGroups.length; j++){S(this.ItemGroups[j],R); }};RadTabStripNamespace.Align.Justify= function (U){var align=new RadTabStripNamespace.Align(U,"hor\x69z\x6f\x6etal", true); var S= function (r,R){for (var i=0; i<r.Items.length; i++){var item=r.Items[i]; var Q=item.Percentage*(R-r.FixedSize)-item.PaddingDiff; var P=item.firstChild.firstChild; RadTabStripNamespace.Box.SetOuterWidth(P,Math.floor(Q)); }} ; align.InterateOverRows(S); };RadTabStripNamespace.Align.Right= function (U){var align=new RadTabStripNamespace.Align(U,"\x68orizontal"); var S= function (r,R){var N=r.Items[0]; N.style.marginLeft=(R-r.Size-1)+"px"; N.style.cssText=N.style.cssText; };align.InterateOverRows(S); };RadTabStripNamespace.Align.Center= function (U){var align=new RadTabStripNamespace.Align(U,"h\x6f\x72\151\x7aontal"); var S= function (r,R){var N=r.Items[0]; var margin=Math.floor((R-r.Size)/2)+"px";N.style.marginLeft=margin; N.style.cssText=N.style.cssText; };align.InterateOverRows(S); };RadTabStripNamespace.Align.VJustify= function (U){var align=new RadTabStripNamespace.Align(U,"\x76er\x74\x69cal", true); var S= function (r,n){for (var i=0; i<r.Items.length; i++){var item=r.Items[i]; var M=item.Percentage*(n-r.FixedSize)-item.PaddingDiff; var P=item.firstChild.firstChild; RadTabStripNamespace.Box.SetOuterHeight(P,Math.floor(M)); }} ; align.InterateOverRows(S); };RadTabStripNamespace.Align.Bottom= function (U){var align=new RadTabStripNamespace.Align(U,"vertical"); var S= function (r,n){var N=r.Items[0]; N.style.marginTop=(n-r.Size-1)+"\x70x"; };align.InterateOverRows(S); };RadTabStripNamespace.Align.Middle= function (U){var align=new RadTabStripNamespace.Align(U,"\x76ertical"); var S= function (r,n){var N=r.Items[0]; var margin=Math.floor((n-r.Size)/2)+"px";N.style.marginTop=margin; };align.InterateOverRows(S); };;if (typeof(window.RadTabStripNamespace)=="\165ndef\x69\x6eed"){window.RadTabStripNamespace=new Object(); } ; RadTabStripNamespace.Box= {GetOuterWidth:function (U){var m=this.GetCurrentStyle(U); return U.offsetWidth+this.GetHorizontalMarginValue(m); } ,GetOuterHeight:function (U){var m=this.GetCurrentStyle(U); return U.offsetHeight+this.GetVerticalMarginValue(m); } ,GetInnerWidth:function (U){var m=this.GetCurrentStyle(U); return U.offsetWidth-this.GetHorizontalPaddingAndBorderValue(m); } ,GetInnerHeight:function (U){var m=this.GetCurrentStyle(U); return U.offsetHeight-this.GetVerticalPaddingAndBorderValue(m); } ,SetOuterWidth:function (U,width){var m=this.GetCurrentStyle(U); width-=this.GetHorizontalMarginValue(m); if (this.IsCompat()){width-=this.GetHorizontalPaddingAndBorderValue(m); }if (width<0){U.style.width="auto"; }else {U.style.width=width+"px"; }} ,SetOuterHeight:function (U,height){var L=height; var m=this.GetCurrentStyle(U); height-=this.GetVerticalMarginValue(m); if (this.IsCompat()){height-=this.GetVerticalPaddingAndBorderValue(m); }U.style.height=height+"\x70\x78"; var l=this.GetOuterHeight(U); if (l!=L){var K=(l-L); var M=(L-K); if (M>0){U.style.height=M+"\x70\x78"; }}} ,SafeParseInt:function (value){var k=parseInt(value); return isNaN(k)?0:k; } ,GetStyleValues:function (style){var value=0; for (var i=1; i<arguments.length; i++){value+=this.SafeParseInt(style[arguments[i]]); }return value; } ,GetHorizontalPaddingAndBorderValue:function (style){return this.GetStyleValues(style,"\x62ord\x65\x72LeftW\x69\x64th","\x70addingLeft","\x70\141\x64\x64ingR\x69\x67ht","bord\x65\x72RightW\x69\x64th"); } ,GetVerticalPaddingAndBorderValue:function (style){return this.GetStyleValues(style,"\x62orderT\x6f\x70Width","\x70addingTop","\x70\x61ddingB\x6f\x74tom","borderBott\x6f\x6dWidt\x68"); } ,GetHorizontalMarginValue:function (style){return this.GetStyleValues(style,"mar\x67\x69nLeft","\x6dargin\x52\x69ght"); } ,GetVerticalMarginValue:function (style){return this.GetStyleValues(style,"\x6darginTop","\x6darginBottom"); } ,GetCurrentStyle:function (U){if (U.currentStyle){return U.currentStyle; }else if (document.defaultView && document.defaultView.getComputedStyle){return document.defaultView.getComputedStyle(U,null); }else {return null; }} ,IsCompat:function (){return RadTabStripNamespace.Browser.IsSafari || RadTabStripNamespace.Browser.IsOpera9 || RadTabStripNamespace.Browser.IsMozilla || document.compatMode=="C\x53\x531Compat"; }};;if (typeof(window.RadTabStripNamespace)=="undefi\x6e\x65\144"){window.RadTabStripNamespace=new Object(); } ; window.RadTabStripNamespace.Browser= {} ; window.RadTabStripNamespace.Browser.Initialize= function (){ this.IsMacIE=(navigator.appName=="\x4d\x69croso\x66\x74 Int\x65\x72n\x65\164 \x45\x78plo\x72\145r") && ((navigator.userAgent.toLowerCase().indexOf("\x6dac")!=-1) || (navigator.appVersion.toLowerCase().indexOf("\x6dac")!=-1)); this.IsSafari=(navigator.userAgent.toLowerCase().indexOf("safa\x72\x69")!=-1); this.IsMozilla=window.netscape && !window.opera; this.IsOpera=window.opera; this.IsOpera9=window.opera && (parseInt(window.opera.version())>8); this.IsIE=!this.IsMacIE && !this.IsMozilla && !this.IsOpera; };RadTabStripNamespace.Browser.Initialize();;if (typeof window.RadControlsNamespace=="undefi\x6e\x65\x64"){window.RadControlsNamespace= {} ; }RadControlsNamespace.EventMixin= {Initialize:function (J){J.H= {} ; J.h= true; J.AttachEvent=this.AttachEvent; J.DetachEvent=this.DetachEvent; J.RaiseEvent=this.RaiseEvent; J.EnableEvents=this.EnableEvents; J.DisableEvents=this.DisableEvents; } ,DisableEvents:function (){ this.h= false; } ,EnableEvents:function (){ this.h= true; } ,AttachEvent:function (G,g){if (!this.H[G]){ this.H[G]=[]; } this.H[G][this.H[G].length]=(RadControlsNamespace.EventMixin.ResolveFunction(g)); } ,DetachEvent:function (G,g){var F=this.H[G]; if (!F){return false; }var f=RadControlsNamespace.EventMixin.ResolveFunction(g); for (var i=0; i<F.length; i++){if (f==F[i]){F.splice(i,1); return true; }}return false; } ,ResolveFunction:function (D){if (typeof(D)=="fu\x6ection"){return D; }else if (typeof(window[D])=="\x66unction"){return window[D]; }else {return new Function("\x76\x61r Sende\x72\x20= a\x72\x67ume\x6e\x74s[\x30\x5d; v\x61\x72\x20Argu\x6d\145\x6ets = \x61rgume\x6e\164s\x5b1];"+D); }} ,RaiseEvent:function (G,d){if (!this.h){return true; }var C= true; if (this[G]){var c=RadControlsNamespace.EventMixin.ResolveFunction(this[G])(this,d); if (typeof(c)=="\x75ndefin\x65\x64"){c= true; }C=C && c; }if (!this.H[G])return C; for (var i=0; i<this.H[G].length; i++){var g=this.H[G][i]; var c=g(this,d); if (typeof(c)=="undefin\x65\x64"){c= true; }C=C && c; }return C; }} ;;var JSON= {copyright: "(c)2005 \x4a\x53ON.or\x67",B: "\x68\x74tp://\x77\x77w.c\x72\x6fck\x66\x6frd.\x63\x6fm/\x4a\x53ON\x2flice\x6e\163\x65.html",o0:function (O0,l0){var a=[]; function e(s){a[a.length]=s; }function i0(x){var I0,i,o1,O0; switch (typeof x){case "\x6f\x62ject":if (x){if (x instanceof Array){e("\x5b"); o1=a.length; for (i=0; i<x.length; i+=1){O0=x[i]; if (typeof O0!="\x75ndefined" && typeof O0!="\x66unction"){if (o1<a.length){e(","); }i0(O0); }}e("\x5d"); return ""; }else if (typeof x.valueOf=="\x66unction"){e("{"); o1=a.length; for (i in x){O0=x[i]; if (l0 && O0==l0[i])continue; if (typeof O0!="\x75\156d\x65\x66ine\x64" && typeof O0!="func\x74i\x6f\x6e" && typeof O0!="\x6f\x62ject" && (!O0 || typeof O0!="o\x62\x6aect" || typeof O0.valueOf=="function")){if (o1<a.length){e("\x2c"); }i0(i); e(":"); i0(O0); }}return e("}"); }}e("null"); return ""; case "\x6eumbe\x72":e(isFinite(x)? +x: "\x6eull"); return ""; case "\x73tring":o1=x.length; e("\042"); for (i=0; i<o1; i+=1){I0=x.charAt(i); if (I0>=" "){if (I0=="\134" || I0=="\042"){e("\x5c"); }e(I0); }else {switch (I0){case "\010":e("\x5cb"); break; case "\014":e("\134\x66"); break; case "\x0a":e("\x5cn"); break; case "\x0d":e("\x5cr"); break; case "\011":e("\x5c\x74"); break; default:I0=I0.charCodeAt(); e("\134\x75\x300"+Math.floor(I0/16).toString(16)+(I0%16).toString(16)); }}}e("\x22"); return ""; case "boolean":e(String(x)); return ""; default:e("nu\x6c\x6c"); return ""; }}i0(O0,0); return a.join(""); } ,O1:function (hash,l1,i1){var a=[]; if (!i1)i1=[]; for (var i=0; i<hash.length; i++){var I1=this.o0(hash[i],i1[i]); if (I1=="{}")continue; a[a.length]="\x22"+hash[i][l1]+"\042:"+I1; }return "\x7b"+a.join(",")+"\x7d"; } ,parse:function (text){return (/^([\x20\x09\x0d\x0a\x2c\x3a\x7b\x7d\x5b\x5d]|\x22(\x5c[\x22\x5c\x2f\x62\x66\x6e\x72\x74\x75]|[^\x00-\x1f\x22\x5c]+)*\x22|\x2d?\d+(\x2e\d*)?([\x65\x45][\x2b-]?\d+)?|\x74\x72\x75\x65|\x66\x61\x6c\x73\x65|\x6e\x75\x6c\x6c)+$/.test(text)) && eval("\x28"+text+")"); }} ;;function RadMultiPage(id,o2){ this.DomElement=document.getElementById(id); this.PageViews=o2; this.HiddenInput=document.getElementById(id+"_Sele\x63t\x65\x64"); this.PageView=null; }RadMultiPage.prototype.GetSelectedIndex= function (){return parseInt(this.HiddenInput.value); } ; RadMultiPage.prototype.GetPageViewDomElement= function (index){return document.getElementById(this.PageViews[index].ClientID); } ; RadMultiPage.prototype.SelectPageById= function (id){if (id=="\x4eull"){return; }var selected=-1; for (var i=0; i<this.PageViews.length; i++){var O2=this.GetPageViewDomElement(i); if (this.PageViews[i].ID==id){if (O2){ this.GetPageViewDomElement(i).style.display="\x62lock"; }selected=i; }else {if (O2){ this.GetPageViewDomElement(i).style.display="n\x6f\x6ee"; }}} this.HiddenInput.value=selected; } ; RadMultiPage.prototype.SelectPageByIndex= function (index){if (index>=this.PageViews.length){return; }for (var i=0; i<this.PageViews.length; i++){var O2=this.GetPageViewDomElement(i); if (O2){O2.style.display=((i==index)?"bloc\x6b": "\x6eone"); }} this.HiddenInput.value=index; } ;;function RadTab(U,l2){ this.Parent=null; this.TabStrip=null; this.SelectedTab=null; this.SelectedIndex=-1; this.Selected= false; this.DomElement=U; this.ScrollChildren= false; this.ScrollPosition=0; this.ScrollButtonsPosition=RadTabStripNamespace.ScrollButtonsPosition.Right; this.PerTabScrolling= false; this.ID=U.id; this.Tabs=[]; this.PageViewID=""; this.PageViewClientID=""; this.Index=-1; this.GlobalIndex=-1; this.CssClass=""; this.SelectedCssClass="\x73\x65\x6cected"; this.DisabledCssClass="disab\x6c\x65d"; this.NavigateAfterClick= false; this.Enabled= true; this.Text=U.firstChild.firstChild.innerHTML; this.ImageDomElement=U.getElementsByTagName("\151\x6d\x67")[0]; this.Value=""; this.ChildStripDomElement=U.parentNode.getElementsByTagName("\x75l")[0]; this.DepthLevel=-1; this.IsBreak= false; } ; RadTab.prototype.Initialize= function (){ this.AttachEventHandlers(); if (this.TabStrip.TabData[this.ID]==null){return; }for (var i2 in this.TabStrip.TabData[this.ID]){ this[i2]=this.TabStrip.TabData[this.ID][i2]; }} ; RadTab.prototype.Dispose= function (){ this.DomElement.detachEvent("o\x6eclick",this.I2); this.DomElement.detachEvent("\x6fnmouse\x6f\x76er",this.o3); this.DomElement.detachEvent("onmouseou\x74",this.O3); if (this.l3){ this.DomElement.detachEvent("onfocu\x73",this.l3); }for (var i in this.DomElement){if (typeof(this.DomElement[i])=="function"){ this.DomElement[i]=null; }}};RadTab.prototype.CancelEvent= function (e){if (e && e.preventDefault){e.preventDefault(); }return false; };RadTab.prototype.AttachEventHandlers= function (){var g=this ; this.I2= function (e){e=e?e:event; var k=g.Click(e); g.DomElement.blur(); g.DomElement.focus(); if (!g.Entered){g.DomElement.blur(); }g.Entered= false; return k; };this.o3= function (e){var a=g.DomElement; var i3=e.relatedTarget?e.relatedTarget:e.fromElement; if (i3 && (i3==a || i3.parentNode==a || i3.parentNode.parentNode==a)){return; }g.TabStrip.RaiseEvent("OnClientM\x6fuseO\x76\x65r", {Tab:g,EventObject:e } ); };this.O3= function (e){var a=g.DomElement; var I3=e.relatedTarget?e.relatedTarget:e.toElement; if (I3 && (I3==a || I3.parentNode==a || I3.parentNode.parentNode==a)){return; }g.TabStrip.RaiseEvent("OnClientMous\x65\117\x75\x74", {Tab:g,EventObject:e } ); };this.DomElement.onkeypress= function (e){e=e?e:event; if (e.keyCode==13){g.Entered= true; }};if (RadTabStripNamespace.Browser.IsSafari){ this.DomElement.onclick=this.I2; this.DomElement.onmouseover=this.o3; this.DomElement.onmouseout=this.O3; }else if (this.DomElement.addEventListener){ this.DomElement.addEventListener("\x63lick",this.I2, false); this.DomElement.addEventListener("\x6douseover",this.o3, false); this.DomElement.addEventListener("mou\x73\x65out",this.O3, false); }else if (this.DomElement.attachEvent){if (this.DomElement.accessKey){ this.l3= function (){if (event.altKey){g.Click(); setTimeout( function (){g.DomElement.focus(); } ,0); }};this.DomElement.attachEvent("\157\x6e\146ocu\x73",this.l3); } this.DomElement.attachEvent("\x6fncli\x63\x6b",this.I2); this.DomElement.attachEvent("\x6fnmouseov\x65\x72",this.o3); this.DomElement.attachEvent("on\x6d\x6fuseout",this.O3); }};RadTab.prototype.Validate= function (){if (!this.TabStrip.CausesValidation){return true; }if (typeof(Page_ClientValidate)!="f\x75\x6ection"){return true; }return Page_ClientValidate(this.TabStrip.ValidationGroup); };RadTab.prototype.Click= function (e){if ((!this.Enabled) || (!this.Validate())){return this.CancelEvent(e); }var C=this.Select(); if ((!C) || (!this.NavigateAfterClick)){return this.CancelEvent(e); }else if (!e || e.srcElement==this.ImageDomElement){var target=this.DomElement.target; if (!target || target=="_self"){location.href=this.DomElement.href; }else if (target=="\x5fbla\x6e\x6b"){window.open(this.DomElement.href); }else {if (top.frames[target]){top.frames[target].src=this.DomElement.href; }}}return true; } ; RadTab.prototype.UnSelect= function (){if (!this.Selected){return; } this.Selected= false; this.ModifyZIndex(-this.MaxZIndex); this.DomElement.className=this.CssClass; this.HideChildren(); if (this.SelectedTab!=null && this.TabStrip.UnSelectChildren){ this.SelectedTab.UnSelect(); } this.Parent.SelectedTab=null; this.Parent.SelectedIndex=-1; this.TabStrip.RecordState(); this.TabStrip.RaiseEvent("O\x6e\103\x6c\x69entT\x61\x62UnS\x65lected", {Tab: this } ); } ; RadTab.prototype.ModifyZIndex= function (zIndex){ this.DomElement.style.zIndex=parseInt(this.DomElement.style.zIndex)+zIndex; this.DomElement.style.cssText=this.DomElement.style.cssText; };RadTab.prototype.Select= function (){if (!this.Enabled){return false; }if (this.Selected && !this.TabStrip.ClickSelectedTab){return false; }var o4=this.Parent.SelectedTab; var d= {Tab: this,PreviousTab:o4 } ; if (!this.TabStrip.RaiseEvent("\x4fnCli\x65\x6etTab\x53\x65lect\x69ng",d)){return false; }if (this.TabStrip.ReorderTabRows){ this.PopRow(); }if (o4){ this.TabStrip.InUpdate= true; this.Parent.SelectedTab.UnSelect(); this.TabStrip.InUpdate= false; } this.Selected= true; this.DomElement.className=this.SelectedCssClass; this.ModifyZIndex(this.MaxZIndex); this.Parent.SelectedTab=this ; this.Parent.SelectedIndex=this.Index; this.TabStrip.SelectPageView(this ); this.ShowChildren(); this.FixFirstTabPosition(); this.TabStrip.RecordState(); this.TabStrip.RaiseEvent("\x4f\x6eClient\x54\x61bSel\x65\x63te\x64",d); return true; } ; RadTab.prototype.FixFirstTabPosition= function (){if (this.Parent.Tabs[0] && this.Parent.Tabs[0].DomElement){ this.Parent.Tabs[0].DomElement.style.cssText=this.Parent.Tabs[0].DomElement.style.cssText; }};RadTab.prototype.SelectParents= function (){var O4=[]; var parent=this ; while (parent!=this.TabStrip){O4[O4.length]=parent; parent=parent.Parent; }var i=O4.length; while (i--){O4[i].Select(); }};RadTab.prototype.IsVisible= function (){var parent=this.Parent; if (parent==this.TabStrip)return true; while (parent!=this.TabStrip){if (!parent.Selected){return false; }parent=parent.Parent; }return true; };RadTab.prototype.ShowChildren= function (){if (!this.ChildStripDomElement)return; if (!this.IsVisible())return; this.ChildStripDomElement.style.display="\x62l\x6f\x63k"; this.TabStrip.ShowLevels(this.DepthLevel); this.TabStrip.ApplyTabBreaks(this.ChildStripDomElement); this.TabStrip.AlignElement(this.ChildStripDomElement); if (this.ScrollChildren){RadTabStripScroll.MakeScrollable(this.ChildStripDomElement,this.TabStrip.IsVertical,this ); }if (this.SelectedTab){ this.SelectedTab.Selected= false; this.SelectedTab.Select(); }};RadTab.prototype.HideChildren= function (){if (!this.ChildStripDomElement)return; this.TabStrip.ShowLevels(this.DepthLevel-1); this.ChildStripDomElement.style.display="n\x6f\x6e\145"; if (this.SelectedTab){ this.SelectedTab.HideChildren(); }};RadTab.prototype.Enable= function (){if (this.Enabled){return; } this.Enabled= true; this.DomElement.className=this.CssClass; this.DomElement.disabled=""; this.TabStrip.RecordState(); this.TabStrip.RaiseEvent("\x4f\x6eClien\x74\x54abE\x6e\x61b\x6c\x65d", {Tab: this } ); };RadTab.prototype.Disable= function (){ this.Enabled= false; this.UnSelect(); this.DomElement.className=this.DisabledCssClass; this.DomElement.disabled="disabled"; this.TabStrip.RecordState(); this.TabStrip.RaiseEvent("OnClien\x74\x54abDi\x73\x61ble\x64", {Tab: this } ); };RadTab.prototype.OnScrollStop= function (){ this.TabStrip.RecordState(); };RadTab.prototype.SetCssClass= function (value){ this.CssClass=value; if (this.Enabled && !this.Selected){ this.DomElement.className=value; }};RadTab.prototype.SetText= function (value){ this.Text=value; var l4=this.DomElement.firstChild.firstChild; var i4=l4.firstChild.nodeType==3?l4.firstChild:l4.childNodes[1]; i4.nodeValue=value; this.TabStrip.RecordState(); };RadTab.prototype.SetDisabledCssClass= function (value){ this.DisabledCssClass=value; if (!this.Enabled){ this.DomElement.className=value; }};RadTab.prototype.SetSelectedCssClass= function (value){ this.SelectedCssClass=value; if (this.Selected){ this.DomElement.className=value; }};RadTab.prototype.PopRow= function (){var I4=this.DomElement.parentNode.offsetTop; var o5=[]; for (var i=0; i<this.Parent.Tabs.length; i++){var O5=this.Parent.Tabs[i].DomElement.parentNode; var l5=O5.offsetTop; var style=RadTabStripNamespace.Box.GetCurrentStyle(this.Parent.Tabs[i].DomElement); if (this.Parent.Tabs[i].IsBreak && this.Parent.Tabs[i].Selected && RadTabStripNamespace.Browser.IsIE){l5-=RadTabStripNamespace.Box.GetStyleValues(style,"m\x61rginTop"); }if (l5==I4){o5[o5.length]=this.Parent.Tabs[i].DomElement.parentNode; }}if (o5.length==this.Parent.Tabs.length){return; }var container=this.DomElement.parentNode.parentNode; for (var i=0; i<o5.length; i++){container.appendChild(o5[i]); }};;if (typeof(window.RadTabStripNamespace)=="undefine\x64"){window.RadTabStripNamespace=new Object(); } ; RadTabStripNamespace.AppendStyleSheet= function (i5,I5,o6){if (!o6){return; }if (!i5){document.write("\x3c"+"link"+" rel=\x27\x73tyle\x73\150\x65\145\x74\x27 t\x79\x70e=\x27\x74ex\x74/css\x27 href\x3d\047"+o6+"\x27\x20/>"); }else {var O6=document.createElement("LI\x4eK"); O6.rel="\x73\x74yleshe\x65\x74"; O6.type="\x74\x65xt/css"; O6.href=o6; document.getElementById(I5+"Styl\x65\x53heetH\x6f\x6cder").appendChild(O6); }} ; RadTabStripNamespace.ScrollButtonsPosition= {Left: 0,Middle: 1,Right: 2 } ; RadTabStripNamespace.TabStripAlign= {Left: 0,Center: 1,Right: 2,Justify: 3 } ; RadTabStripNamespace.GetChildren= function (U,l6){var children=[]; var i6=U.firstChild; l6=l6.toLowerCase(); while (i6){if (i6.nodeType==1 && i6.tagName.toLowerCase()==l6){children[children.length]=i6; }i6=i6.nextSibling; }return children; };function RadTabStrip(I6){ this.Tabs=[]; this.AllTabs=[]; this.DomElement=document.getElementById(I6); this.ChildStripDomElement=this.DomElement.getElementsByTagName("ul")[0]; this.StateField=document.getElementById(I6+"\x5fHidde\x6e"); this.ID=I6; this.SelectedTab=null; this.SelectedIndex=-1; this.IsVertical= false; this.ReverseLevelOrder= false; this.ScrollChildren= false; this.ScrollPosition=0; this.ScrollButtonsPosition=RadTabStripNamespace.ScrollButtonsPosition.Right; this.PerTabScrolling= false; this.MultiPageID=""; this.MultiPageClientID=""; this.CausesValidation= true; this.ValidationGroup=""; this.Enabled= true; this.Direction="l\x74\x72"; this.Align=RadTabStripNamespace.TabStripAlign.Left; this.ReorderTabRows= false; this.UnSelectChildren= false; this.ClickSelectedTab= false; this.OnClientTabSelected=""; this.OnClientTabSelecting=""; this.OnClientMouseOver=""; this.OnClientMouseOut=""; this.OnClientTabUnSelected=""; this.OnClientTabEnabled=""; this.OnClientTabDisabled=""; this.OnClientLoad=""; this.DepthLevel=0; this.MaxLevel=0; this.TabData= {} ; this.LevelWraps=[]; this.LevelWraps[0]=this.ChildStripDomElement.parentNode; this.InPostBack= false; this.InitialAllTabs=[]; RadControlsNamespace.EventMixin.Initialize(this ); this.InUpdate= false; this.Initialized= false; if (window.attachEvent && !window.opera){var o7=this ; var O7= function (){o7.Dispose(); };window.attachEvent("onunload",O7); }}RadTabStrip.prototype.AlignElement= function (l7){if (this.IsVertical){if (this.Align==RadTabStripNamespace.TabStripAlign.Center){RadTabStripNamespace.Align.Middle(l7); }else if (this.Align==RadTabStripNamespace.TabStripAlign.Right){RadTabStripNamespace.Align.Bottom(l7); }else if (this.Align==RadTabStripNamespace.TabStripAlign.Justify){RadTabStripNamespace.Align.VJustify(l7); }}else {if (this.Align==RadTabStripNamespace.TabStripAlign.Center){RadTabStripNamespace.Align.Center(l7); }else if (this.Align==RadTabStripNamespace.TabStripAlign.Right){RadTabStripNamespace.Align.Right(l7); }else if (this.Align==RadTabStripNamespace.TabStripAlign.Justify){RadTabStripNamespace.Align.Justify(l7); }}};RadTabStrip.prototype.FindTabById= function (id){for (var i=0; i<this.AllTabs.length; i++){if (this.AllTabs[i].ID==id){return this.AllTabs[i]; }}return null; } ; RadTabStrip.prototype.FindTabByText= function (text){for (var i=0; i<this.AllTabs.length; i++){if (this.AllTabs[i].Text==text){return this.AllTabs[i]; }}return null; } ; RadTabStrip.prototype.FindTabByValue= function (value){for (var i=0; i<this.AllTabs.length; i++){if (this.AllTabs[i].Value==value){return this.AllTabs[i]; }}return null; } ; RadTabStrip.prototype.FindTabByUrl= function (url){for (var i=0; i<this.AllTabs.length; i++){if (this.AllTabs[i].DomElement.href==url){return this.AllTabs[i]; }}return null; } ; RadTabStrip.prototype.GetAllTabs= function (){return this.AllTabs; } ; RadTabStrip.prototype.i7= function (){return ((!this.IsVertical) && this.ChildStripDomElement.offsetWidth==0) || (this.IsVertical && this.ChildStripDomElement.offsetHeight==0); };RadTabStrip.prototype.ApplyAlign= function (){if (this.i7()){return; } this.AlignElement(this.ChildStripDomElement); var I7=this.SelectedTab; while (I7){if (!I7.ChildStripDomElement){break; } this.AlignElement(I7.ChildStripDomElement); I7=I7.SelectedTab; }};RadTabStrip.prototype.Dispose= function (){for (var i=0; i<this.AllTabs.length; i++){ this.AllTabs[i].Dispose(); }};RadTabStrip.prototype.Initialize= function (o8,O8){ this.LoadConfiguration(o8); this.BuildInitialState(o8); this.TabData=O8; this.DetermineDirection(); this.ApplyRTL(); this.DisableEvents(); this.CreateControlHierarchy(this,this.ChildStripDomElement); if (this.LevelWraps.length==1){ this.ShowLevels(1); } this.ApplySelected(); this.EnableEvents(); this.l8(); this.ApplyTabBreaks(this.ChildStripDomElement); this.ApplyAlign(); this.HandleWindowResize(); this.Initialized= true; this.RaiseEvent("\x4f\x6e\x43lient\x4coad",null); };RadTabStrip.prototype.ApplySelected= function (){for (var i=0; i<this.AllTabs.length; i++){if (this.AllTabs[i].Selected){ this.AllTabs[i].Selected= false; this.AllTabs[i].Select(); }}};RadTabStrip.prototype.l8= function (){var o7=this ; var i8= function (){if (o7.ScrollChildren){RadTabStripScroll.MakeScrollable(o7.ChildStripDomElement,o7.IsVertical,o7); }};if (this.i7()){if (window.addEventListener){window.addEventListener("l\x6fad",i8, false); }else {window.attachEvent("\157\x6e\x6coad",i8); }}else {i8(); }};RadTabStrip.prototype.HandleWindowResize= function (){var o7=this ; var I8= function (){o7.ApplyAlign(); };if (window.addEventListener){window.addEventListener("\162es\x69\x7ae",I8, false); window.addEventListener("\x6coad",I8, false); }else {window.attachEvent("\x6fnresize",I8); window.attachEvent("\x6fnload",I8); }};RadTabStrip.prototype.LoadConfiguration= function (o8){for (var i2 in o8){ this[i2]=o8[i2]; }};RadTabStrip.prototype.BuildInitialState= function (o8){ this.InitialState=new RadTabStrip(this.ID); this.InitialState.Initialized= true; this.InitialState.LoadConfiguration(o8); };RadTabStrip.prototype.ShowLevels= function (o9){var height=0; for (var i=0; i<=this.MaxLevel; i++){var O9=i>o9?"\x6eone": "\x62\x6cock"; if (this.LevelWraps[i].style.display!=O9){ this.LevelWraps[i].style.display=O9; }if (this.LevelWraps[i].style.display=="block"){height+=this.LevelWraps[i].offsetHeight; }}if (!this.IsVertical && RadTabStripNamespace.Browser.IsMozilla){ this.DomElement.style.height=height+"p\x78"; }};RadTabStrip.prototype.DetermineDirection= function (){var el=this.DomElement; while (el.tagName.toLowerCase()!="\x68tml"){if (el.dir){ this.Direction=el.dir.toLowerCase(); return; }el=el.parentNode; } this.Direction="\x6ctr"; };RadTabStrip.prototype.ApplyTabBreaks= function (l9){var i9=l9.getElementsByTagName("li"); for (var i=0; i<i9.length; i++){var li=i9[i]; if (li.className.indexOf("\x62\162\x65\x61k")==-1)continue; var a=li.getElementsByTagName("\x61")[0]; if (this.Direction=="\x72tl" && li.firstChild.tagName.toLowerCase()=="a"){a.style.I9="\x72ight"; a.style.styleFloat="\x72ight"; }}};RadTabStrip.prototype.CreateTab= function (parent,oa,Oa){var la=new RadTab(oa); la.MaxZIndex=Oa; la.DepthLevel=parent.DepthLevel+1; la.Parent=parent; la.TabStrip=this ; la.Index=parent.Tabs.length; la.GlobalIndex=this.AllTabs.length; return la; };RadTabStrip.prototype.CreateTabObject= function (parent,oa,Oa){var la=this.CreateTab(parent,oa,Oa); parent.Tabs[parent.Tabs.length]=la; var ia=this.CreateTab(parent,oa,Oa); ia.Index--; this.AllTabs[this.AllTabs.length]=la; this.InitialAllTabs[this.InitialAllTabs.length]=ia; return la; };RadTabStrip.prototype.CreateLevelWrap= function (Ia){if (this.LevelWraps[Ia])return this.LevelWraps[Ia]; this.LevelWraps[Ia]=document.createElement("div"); this.LevelWraps[Ia].style.display="\142lock"; if (this.ReverseLevelOrder && Ia>0){ this.DomElement.insertBefore(this.LevelWraps[Ia],this.LevelWraps[Ia-1]); }else { this.DomElement.appendChild(this.LevelWraps[Ia]); } this.LevelWraps[Ia].className="\x6cevelwrap\x20leve\x6c"+(Ia+1); if (this.Direction=="rtl"){ this.LevelWraps[Ia].style.I9="right"; this.LevelWraps[Ia].style.styleFloat="right"; }return this.LevelWraps[Ia]; };RadTabStrip.prototype.CreateControlHierarchy= function (ob,Ob){ this.MaxLevel=Math.max(ob.DepthLevel,this.MaxLevel); if (ob.DepthLevel>0){ this.CreateLevelWrap(ob.DepthLevel).appendChild(Ob); }var i9=RadTabStripNamespace.GetChildren(Ob,"\x6c\x69"); for (var i=0; i<i9.length; i++){var li=i9[i]; if (i==0){li.className+="\x20firs\x74"; }var href=li.getElementsByTagName("a")[0]; if (!href){continue; }href.style.zIndex=i9.length-i; var la=this.CreateTabObject(ob,href,i9.length); la.Initialize(); if (la.ChildStripDomElement){ this.CreateControlHierarchy(la,la.ChildStripDomElement); }}if (li){li.className+=" las\x74"; }};RadTabStrip.prototype.SelectPageView= function (la){if (!this.Initialized){return; }if (this.MultiPageClientID=="" || typeof(window[this.MultiPageClientID])=="\x75ndefined"){return; }var lb=window[this.MultiPageClientID]; if (la.PageViewID){lb.SelectPageById(la.PageViewID); }else {lb.SelectPageByIndex(la.GlobalIndex); }};RadTabStrip.prototype.ApplyRTL= function (){if (this.Direction=="\x6ctr")return; this.DomElement.dir="lt\x72"; var i9=this.DomElement.getElementsByTagName("\x6ci"); if (this.IsVertical)return; for (var i=0; i<i9.length; i++){if (i9[i].className.indexOf("break")>-1)continue; i9[i].style.styleFloat="right"; i9[i].style.I9="\x72ight"; }var ib=this.DomElement.getElementsByTagName("u\x6c"); for (var i=0; i<ib.length; i++){ib[i].style["\x63lear"]="right"; }};RadTabStrip.prototype.Enable= function (){ this.Enabled= true; this.InUpdate= true; for (var i=0; i<this.AllTabs.length; i++){ this.AllTabs[i].Enable(); } this.InUpdate= false; this.RecordState(); };RadTabStrip.prototype.Disable= function (){ this.Enabled= false; this.InUpdate= true; for (var i=0; i<this.AllTabs.length; i++){ this.AllTabs[i].Disable(); } this.InUpdate= false; this.RecordState(); };RadTabStrip.prototype.RecordState= function (){if (this.InUpdate){return; }var Ib=JSON.o0(this,this.InitialState); var oc=JSON.O1(this.AllTabs,"\111\x44",this.InitialAllTabs); this.StateField.value="\x7b\042\x53tate\042\x3a"+Ib+",\042\x54\x61bSta\x74\x65\042\x3a"+oc+"}"; };RadTabStrip.prototype.OnScrollStop= function (){ this.RecordState(); };;function RadTabStripScroll(U,Oc,lc){ this.Element=U; this.IsVertical=Oc; this.ScrollOptionsObject=lc; } ; RadTabStripScroll.MakeScrollable= function (U,Oc,lc){var scroll=new RadTabStripScroll(U,Oc,lc); scroll.Initialize(); };RadTabStripScroll.prototype.Initialize= function (){if (this.Element.ic)return; this.Element.ic= true; this.CreateScrollWrap(); this.AttachArrows(); this.CalculateMinMaxPosition(); this.AttachScrollMethods(); } ; RadTabStripScroll.prototype.AttachArrows= function (){var Ic=this.CreateArrow("\x26\x6caquo;",1,"\x6ceftAr\x72\x6fw"); var od=this.CreateArrow("&\x72\x61quo;",-1,"rightA\x72\x72ow"); this.Element.Ic=Ic; this.Element.od=od; if (this.IsVertical){Ic.style.left="\x30px"; od.style.left="0px"; if (this.ScrollOptionsObject.ScrollButtonsPosition==RadTabStripNamespace.ScrollButtonsPosition.Middle){Ic.style.top="\x30\x70x"; od.style.bottom="\x30px"; }else if (this.ScrollOptionsObject.ScrollButtonsPosition==RadTabStripNamespace.ScrollButtonsPosition.Left){Ic.style.top="\x30px"; od.style.top=Ic.offsetHeight+"px"; }else {od.style.bottom="\060\x70x"; Ic.style.bottom=Ic.offsetHeight+"px"; }}else {Ic.style.top="\x30px"; od.style.top="\x30px"; if (this.ScrollOptionsObject.ScrollButtonsPosition==RadTabStripNamespace.ScrollButtonsPosition.Middle){Ic.style.left="0px"; od.style.right="\x30px"; }else if (this.ScrollOptionsObject.ScrollButtonsPosition==RadTabStripNamespace.ScrollButtonsPosition.Left){Ic.style.left="\x30px"; od.style.left=Ic.offsetWidth+"px"; }else {od.style.right="\x30px"; Ic.style.right=od.offsetWidth+"\x70x"; }}};RadTabStripScroll.prototype.CreateArrow= function (Od,ld,oe){var Oe=document.createElement("\x61"); Oe.href="\x23"; Oe.className=oe; Oe.innerHTML="\x26nbsp;"; this.Element.parentNode.appendChild(Oe); Oe.le=this.Element; Oe.ScrollDirection=ld; Oe.onmousedown= function (){ this.le.scroll(this.ScrollDirection); return false; };Oe.onclick= function (){return false; };Oe.onmouseup=Oe.onmouseout= function (){ this.le.stop(); return false; };return Oe; };RadTabStripScroll.prototype.CreateScrollWrap= function (){var ie=document.createElement("div"); var Ie=this.Element.parentNode; ie.appendChild(this.Element); ie.style.position="\x72elati\x76\x65"; ie.style.overflow="\x68idden"; Ie.appendChild(ie); if (this.IsVertical){ie.style.styleFloat="left"; this.Element.style.display="no\x6e\x65"; ie.style.height=ie.parentNode.parentNode.offsetHeight+"\x70x"; this.Element.style.display="\x62\x6cock"; }else {var of=0; for (var i=0; i<this.Element.childNodes.length; i++){var node=this.Element.childNodes[i]; if (!node.tagName)continue; of+=RadTabStripNamespace.Box.GetOuterWidth(node); } this.Element.style.width=of+"px"; }} ; RadTabStripScroll.prototype.CalculateMinMaxPosition= function (){if (this.IsVertical){var scrollHeight=this.Element.parentNode.offsetHeight-this.Element.offsetHeight; if (this.ScrollOptionsObject.ScrollButtonsPosition==RadTabStripNamespace.ScrollButtonsPosition.Middle){ this.Element.Of=this.Element.Ic.offsetHeight; this.Element.If=scrollHeight-this.Element.od.offsetHeight; }else if (this.ScrollOptionsObject.ScrollButtonsPosition==RadTabStripNamespace.ScrollButtonsPosition.Left){ this.Element.Of=this.Element.od.offsetHeight+this.Element.Ic.offsetHeight; this.Element.If=scrollHeight; }else { this.Element.Of=0; this.Element.If=scrollHeight-this.Element.od.offsetHeight-this.Element.Ic.offsetHeight; }}else {var scrollWidth=this.Element.parentNode.offsetWidth-this.Element.offsetWidth; if (this.ScrollOptionsObject.ScrollButtonsPosition==RadTabStripNamespace.ScrollButtonsPosition.Middle){ this.Element.Of=this.Element.Ic.offsetWidth; this.Element.If=scrollWidth-this.Element.od.offsetWidth; }else if (this.ScrollOptionsObject.ScrollButtonsPosition==RadTabStripNamespace.ScrollButtonsPosition.Left){ this.Element.Of=this.Element.od.offsetWidth+this.Element.Ic.offsetWidth; this.Element.If=scrollWidth; }else { this.Element.Of=0; this.Element.If=scrollWidth-this.Element.od.offsetWidth-this.Element.Ic.offsetWidth; }}};RadTabStripScroll.prototype.AttachScrollMethods= function (){ this.Element.og=2; this.Element.ScrollOptionsObject=this.ScrollOptionsObject; var Og=this.ScrollOptionsObject.ScrollPosition+"\x70x"; var i9=this.Element.getElementsByTagName("\x6ci"); var i=0; while (this.ScrollOptionsObject.ScrollPosition<-(this.IsVertical?i9[i].offsetTop:i9[i].offsetLeft)){i++; } this.Element.lg=i; if (this.IsVertical){ this.Element.style.top=Og; }else { this.Element.style.left=Og; } this.Element.direction=0; this.Element.style.position="relati\x76e"; this.Element.IsVertical=this.IsVertical; this.Element.ScrollBy=RadTabStripScroll.ScrollBy; if (this.ScrollOptionsObject.PerTabScrolling){ this.Element.scroll=RadTabStripScroll.StartPerTabScroll; this.Element.stop=RadTabStripScroll.StopPerTabScroll; }else { this.Element.scroll=RadTabStripScroll.StartSmoothScroll; this.Element.stop=RadTabStripScroll.StopSmoothScroll; } this.Element.EvaluateArrowStatus=RadTabStripScroll.EvaluateArrowStatus; this.Element.EvaluateArrowStatus(); } ; RadTabStripScroll.EvaluateArrowStatus= function (){var ig=!(this.ScrollOptionsObject.ScrollPosition>this.If); var Ig=!(this.ScrollOptionsObject.ScrollPosition<this.Of); this.od.disabled=ig; this.Ic.disabled=Ig; if (Ig){if (this.Ic.className!="\154\x65ftArrowD\x69\x73abl\x65\144"){ this.Ic.className="\x6ceftArro\x77\x44isab\x6c\x65d"; }}else {if (this.Ic.className!="leftAr\x72\x6fw"){ this.Ic.className="\x6ceftArrow"; }}if (ig){if (this.od.className!="right\x41\x72rowDi\x73\x61ble\x64"){ this.od.className="rightArr\x6f\x77Disa\x62\x6ced"; }}else {if (this.od.className!="\x72ightArrow"){ this.od.className="r\x69\x67htArrow"; }}};RadTabStripScroll.StartSmoothScroll= function (direction){ this.direction=direction; var U=this ; var Oc=U.IsVertical; var oh= function (){U.ScrollBy(U.direction*U.og,Oc); };oh(); this.Oh=setInterval(oh,10); } ; RadTabStripScroll.StartPerTabScroll= function (direction){var Oc=this.IsVertical; var lh=this.lg-direction; if (lh<0 || lh>this.childNodes.length){return; }var ih=direction==-1?this.lg:lh; this.lg=lh; var i9=this.getElementsByTagName("li"); if (Oc){var Ih=i9[ih].offsetHeight; }else {var Ih=i9[ih].offsetWidth; } this.ScrollBy(Ih*direction,Oc); this.EvaluateArrowStatus(); } ; RadTabStripScroll.ScrollBy= function (oi,Oc){var Oi=this.ScrollOptionsObject.ScrollPosition; Oi+=oi; Oi=Math.min(Oi,this.Of); Oi=Math.max(Oi,this.If); this.EvaluateArrowStatus(); if (Oc){ this.style.top=Oi+"p\x78"; }else { this.style.left=Oi+"\x70\x78"; } this.ScrollOptionsObject.ScrollPosition=Oi; };RadTabStripScroll.StopSmoothScroll= function (direction){if (this.ScrollOptionsObject.OnScrollStop){ this.ScrollOptionsObject.OnScrollStop(); }clearInterval(this.Oh); } ; RadTabStripScroll.StopPerTabScroll= function (direction){if (this.ScrollOptionsObject.OnScrollStop){ this.ScrollOptionsObject.OnScrollStop(); }} ;;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -