1// (c) 2010 CodePlex Foundation 2(function(){function n(){Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.TabStripPlacement=function(){};Sys.Extended.UI.TabStripPlacement.prototype={Top:0,Bottom:1,TopRight:2,BottomRight:3};Sys.Extended.UI.TabStripPlacement.registerEnum("Sys.Extended.UI.TabStripPlacement",!0);Sys.Extended.UI.UseVerticalStripPlacement=function(){};Sys.Extended.UI.OnDemand=function(){};Sys.Extended.UI.OnDemandMode=function(){};Sys.Extended.UI.OnDemandMode.prototype={None:0,Always:1,Once:2};Sys.Extended.UI.OnDemandMode.registerEnum("Sys.Extended.UI.OnDemandMode",!0);Sys.Extended.UI.TabContainer=function(n){Sys.Extended.UI.TabContainer.initializeBase(this,[n]);this._cachedActiveTabIndex=-1;this._activeTabIndex=-1;this._scrollBars=Sys.Extended.UI.ScrollBars.None;this._tabs=null;this._header=null;this._body=null;this._loaded=!1;this._autoPostBackId=null;this._useVerticalStripPlacement=!1;this._onDemand=!1;this._pageRequestManager=null;this._tabStripPlacement=Sys.Extended.UI.TabStripPlacement.Top;this._app_onload$delegate=Function.createDelegate(this,this._app_onload)};Sys.Extended.UI.TabContainer.prototype={add_activeTabChanged:function(n){this.get_events().addHandler("activeTabChanged",n)},remove_activeTabChanged:function(n){this.get_events().removeHandler("activeTabChanged",n)},raiseActiveTabChanged:function(){var n=this.get_events().getHandler("activeTabChanged");n&&n(this,Sys.EventArgs.Empty);this._autoPostBackId&&__doPostBack(this._autoPostBackId,"activeTabChanged:"+this.get_activeTabIndex())},get_activeTabIndex:function(){return this._cachedActiveTabIndex>-1?this._cachedActiveTabIndex:this._activeTabIndex},set_activeTabIndex:function(n){var t=n,r,u,i;if(this.get_isInitialized()){if(t<-1)throw Error.argumentOutOfRange("value");t>=this.get_tabs().length&&(t=this.get_tabs().length-1);t!=this._activeTabIndex&&(this._activeTabIndex!=-1&&(r=this.get_tabs()[this._activeTabIndex],r._set_active(!1)),u=this._activeTabIndex!=t,this._activeTabIndex=t,this._activeTabIndex!=-1&&this.get_tabs()[this._activeTabIndex]._set_active(!0),this._loaded&&u&&(this._onDemand&&(i=this.get_tabs()[this._activeTabIndex],i._onDemandMode!=Sys.Extended.UI.OnDemandMode.None&&(i._onDemandMode==Sys.Extended.UI.OnDemandMode.Once&&i._wasLoadedOnce==!1||i._onDemandMode==Sys.Extended.UI.OnDemandMode.Always)&&(this._pageRequestManager.beginAsyncPostBack([i._updatePanelID],null,null,!1,null),i.set_wasLoadedOnce(!0))),this.raiseActiveTabChanged()),this.raisePropertyChanged("activeTabIndex"))}else this._cachedActiveTabIndex=t},get_tabs:function(){return this._tabs==null&&(this._tabs=[]),this._tabs},get_activeTab:function(){return this._activeTabIndex>-1?this.get_tabs()[this._activeTabIndex]:null},set_activeTab:function(n){var t=Array.indexOf(this.get_tabs(),n);if(t==-1)throw Error.argument("value",Sys.Extended.UI.Resources.Tabs_ActiveTabArgumentOutOfRange);this.set_activeTabIndex(t)},get_autoPostBackId:function(){return this._autoPostBackId},set_autoPostBackId:function(n){this._autoPostBackId=n},get_scrollBars:function(){return this._scrollBars},set_scrollBars:function(n){this._scrollBars!=n&&(this._scrollBars=n,this._invalidate(),this.raisePropertyChanged("scrollBars"))},get_tabStripPlacement:function(){return this._tabStripPlacement},set_tabStripPlacement:function(n){this._tabStripPlacement!=n&&(this._tabStripPlacement=n,this._invalidate(),this.raisePropertyChanged("tabStripPlacement"))},get_useVerticalStripPlacement:function(){return this._useVerticalStripPlacement},set_useVerticalStripPlacement:function(n){this._useVerticalStripPlacement!=n&&(this._useVerticalStripPlacement=n,this._invalidate(),this.raisePropertyChanged("useVerticalStripPlacement"))},get_onDemand:function(){return this._onDemand},set_onDemand:function(n){this._onDemand!=n&&(this._onDemand=n,this._invalidate(),this.raisePropertyChanged("onDemand"))},initialize:function(){Sys.Extended.UI.TabContainer.callBaseMethod(this,"initialize");var n=this.get_element();this._header=$get(this.get_id()+"_header");this._body=$get(this.get_id()+"_body");$common.addCssClasses(n,["ajax__tab_container","ajax__tab_default"]);this._invalidate();this._onDemand&&(this._pageRequestManager=Sys.WebForms.PageRequestManager.getInstance());Sys.Application.add_load(this._app_onload$delegate)}
2,dispose:function(){$clearHandlers(this.get_element());Sys.Application.remove_load(this._app_onload$delegate);Sys.Extended.UI.TabContainer.callBaseMethod(this,"dispose")},getFirstTab:function(n){for(var i=this.get_tabs(),t=0;t<i.length;t++)if(n||i[t].get_enabled())return i[t];return null},getLastTab:function(n){for(var i=this.get_tabs(),t=i.length-1;t>=0;t--)if(n||i[t].get_enabled())return i[t];return null},getNextTab:function(n){for(var i=this.get_tabs(),f=this.get_activeTabIndex(),u,r,t=1;t<i.length;t++)if(u=(f+t)%i.length,r=i[u],n||r.get_enabled())return r;return null},getPreviousTab:function(n){for(var t=this.get_tabs(),f=this.get_activeTabIndex(),u,r,i=1;i<t.length;i++)if(u=(t.length+(f-i))%t.length,r=t[u],n||r.get_enabled())return r;return null},getNearestTab:function(n){var t=this.getPreviousTab(n),i=this.getNextTab(n);return t&&t.get_tabIndex()<this._activeTabIndex?t:i&&i.get_tabIndex()>this._activeTabIndex?i:null},saveClientState:function(){for(var t=this.get_tabs(),i=[],r=[],u,n=0;n<t.length;n++)Array.add(i,t[n].get_enabled()),Array.add(r,t[n].get_wasLoadedOnce());return u={ActiveTabIndex:this._activeTabIndex,TabEnabledState:i,TabWasLoadedOnceState:r},Sys.Serialization.JavaScriptSerializer.serialize(u)},_invalidate:function(){var i;
2if(this.get_isInitialized()){$common.removeCssClasses(this._body,["ajax__scroll_horiz","ajax__scroll_vert","ajax__scroll_both","ajax__scroll_auto","ajax__scroll_none"]);switch(this._scrollBars){case Sys.Extended.UI.ScrollBars.Horizontal:Sys.UI.DomElement.addCssClass(this._body,"ajax__scroll_horiz");break;case Sys.Extended.UI.ScrollBars.Vertical:Sys.UI.DomElement.addCssClass(this._body,"ajax__scroll_vert");break;case Sys.Extended.UI.ScrollBars.Both:Sys.UI.DomElement.addCssClass(this._body,"ajax__scroll_both");break;case Sys.Extended.UI.ScrollBars.Auto:Sys.UI.DomElement.addCssClass(this._body,"ajax__scroll_auto");break;case Sys.Extended.UI.ScrollBars.None:Sys.UI.DomElement.addCssClass(this._body,"ajax__scroll_none")}if(this._useVerticalStripPlacement){var n=$common.getBounds(this._header),t=$common.getBounds(this._body),r=t.height-n.height-1+"px";$get(this.get_id()+"_headerSpannerHeight").style.height=r;Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version<7&&(this._tabStripPlacement==Sys.Extended.UI.TabStripPlacement.Top||this._tabStripPlacement==Sys.Extended.UI.TabStripPlacement.Bottom?(i={x:n.x+n.width,y:n.y,width:t.width,height:t.height},$common.setBounds(this._body,i)):(i={x:t.x+t.width,y:n.y,width:n.width,height:n.height},$common.setBounds(this._header,i),$common.setBounds(this._body,t)))}}},_app_onload:function(){if(this._cachedActiveTabIndex!=-1){this.set_activeTabIndex(this._cachedActiveTabIndex);this._cachedActiveTabIndex=-1;var n=this.get_tabs()[this._activeTabIndex];n&&(n.set_wasLoadedOnce(!0),n._setFocus(n))}this._loaded=!0}};Sys.Extended.UI.TabContainer.registerClass("Sys.Extended.UI.TabContainer",Sys.Extended.UI.ControlBase);Sys.registerComponent(Sys.Extended.UI.TabContainer,{name:"tabContainer",parameters:[{name:"activeTabIndex",type:"Number"}]});Sys.Extended.UI.TabPanel=function(n){Sys.Extended.UI.TabPanel.initializeBase(this,[n]);this._active=!1;this._tab=null;this._headerOuter=null;this._headerInner=null;this._header=null;this._owner=null;this._ownerID=null;this._enabled=!0;this._tabIndex=-1;this._dynamicContextKey=null;this._dynamicServicePath=null;this._dynamicServiceMethod=null;this._dynamicPopulateBehavior=null;this._scrollBars=Sys.Extended.UI.ScrollBars.None;this._onDemandMode=Sys.Extended.UI.OnDemandMode.Always;this._wasLoadedOnce=!1;this._updatePanelID="";this.isAttachedDisabledEvents=!1;this.isAttachedEnabledEvents=!1;this._header_onclick$delegate=Function.createDelegate(this,this._header_onclick);this._header_onmouseover$delegate=Function.createDelegate(this,this._header_onmouseover);this._header_onmouseout$delegate=Function.createDelegate(this,this._header_onmouseout);this._header_onmousedown$delegate=Function.createDelegate(this,this._header_onmousedown);this._dynamicPopulate_onpopulated$delegate=Function.createDelegate(this,this._dynamicPopulate_onpopulated);this._oncancel$delegate=Function.createDelegate(this,this._oncancel);this._onkeydown$delegate=Function.createDelegate(this,this._onkeydown);this._disabled_onclick$delegate=Function.createDelegate(this,this._disabled_onclick)};Sys.Extended.UI.TabPanel.prototype={add_click:function(n){this.get_events().addHandler("click",n)},remove_click:function(n){this.get_events().removeHandler("click",n)},raiseClick:function(){var n=this.get_events().getHandler("click");n&&n(this,Sys.EventArgs.Empty)},add_populating:function(n){this.get_events().addHandler("populating",n)},remove_populating:function(n){this.get_events().removeHandler("populating",n)},raisePopulating:function(){var n=this.get_events().getHandler("populating");n&&n(this,Sys.EventArgs.Empty)},add_populated:function(n){this.get_events().addHandler("populated",n)},remove_populated:function(n){this.get_events().removeHandler("populated",n)},raisePopulated:function(){var n=this.get_events().getHandler("populated");n&&n(this,Sys.EventArgs.Empty)},get_headerText:function(){return this.get_isInitialized()?this._header.innerHTML:""},set_headerText:function(n){if(!this.get_isInitialized())throw Error.invalidOperation(String.format(Sys.Extended.UI.Resources.Tabs_PropertySetBeforeInitialization,"headerText"));this.get_headerText()!=n&&(this._header.innerHTML=n,this.raisePropertyChanged("headerText"))},get_headerTab:function(){return this._header},set_headerTab:function(n){if(typeof n=="string"&&(n=Sys.get(n),!n))throw new Error.argumentNull("value");if(this._header!=n){if(this.get_isInitialized())throw Error.invali
2dOperation(String.format(Sys.Extended.UI.Resources.Tabs_PropertySetAfterInitialization,"headerTab"));this._header=n;this.raisePropertyChanged("value")}},get_enabled:function(){return this._enabled},set_enabled:function(n){n!=this._enabled&&(this._enabled=n,this.get_isInitialized()&&this._makeEnabled(this._enabled),this.raisePropertyChanged("enabled"))},get_owner:function(){return this._owner},set_owner:function(n){if(n instanceof Sys.ComponentSet&&(n=n.get(0)),this._owner!=n){if(this.get_isInitialized())throw Error.invalidOperation(String.format(Sys.Extended.UI.Resources.Tabs_PropertySetAfterInitialization,"owner"));this._owner=n;this.raisePropertyChanged("owner")}},get_ownerID:function(){return this._ownerID},set_ownerID:function(n){this._ownerID=n},get_scrollBars:function(){return this._scrollBars},set_scrollBars:function(n){this._scrollBars!=n&&(this._scrollBars=n,this.raisePropertyChanged("scrollBars"))},get_onDemandMode:function(){return this._onDemandMode},set_onDemandMode:function(n){this._onDemandMode!=n&&(this._onDemandMode=n,this.raisePropertyChanged("onDemandMode"))},get_tabIndex:function(){return this._tabIndex},get_dynamicContextKey:function(){return this._dynamicContextKey},set_dynamicContextKey:function(n){this._dynamicContextKey!=n&&(this._dynamicContextKey=n,this.raisePropertyChanged("dynamicContextKey"))},get_dynamicServicePath:function(){return this._dynamicServicePath},set_dynamicServicePath:function(n){this._dynamicServicePath!=n&&(this._dynamicServicePath=n,this.raisePropertyChanged("dynamicServicePath"))},get_dynamicServiceMethod:function(){return this._dynamicServiceMethod},set_dynamicServiceMethod:function(n){this._dynamicServiceMethod!=n&&(this._dynamicServiceMethod=n,this.raisePropertyChanged("dynamicServiceMethod"))},_get_active:function(){return this._active},_set_active:function(n){this._active=n;n?this._activate():this._deactivate()},get_updatePanelID:function(){return this._updatePanelID},set_updatePanelID:function(n){this._updatePanelID!=n&&(this._updatePanelID=n,this.raisePropertyChanged("updatePanelID"))},get_wasLoadedOnce:function(){return this._wasLoadedOnce},set_wasLoadedOnce:function(n){n!=this._wasLoadedOnce&&(this._wasLoadedOnce=n,this.raisePropertyChanged("wasLoadedOnce"))},initialize:function(){var n=this.get_owner(),t,i;if(n||(n=$find(this.get_ownerID()),n&&(n.initialize(),this.set_owner(n))),Sys.Extended.UI.TabPanel.callBaseMethod(this,"initialize"),!n)throw Error.invalidOperation(Sys.Extended.UI.Resources.Tabs_OwnerExpected);this._tabIndex=n.get_tabs().length;Array.add(n.get_tabs(),this);t=this.get_id()+"_tab";this._tab=document.getElementById(t);i=this._tab!=null;i||(this._headerOuterWrapper=document.createElement("span"),this._headerInnerWrapper=document.createElement("span"),this._tab=document.createElement("span"),this._tab.id=t,this._header.parentNode.replaceChild(this._tab,this._header),this._tab.appendChild(this._headerOuterWrapper),this._headerOuterWrapper.appendChild(this._headerInnerWrapper),this._headerInnerWrapper.appendChild(this._header));$addHandlers(this._header,{mousedown:this._header_onmousedown$delegate,dragstart:this._oncancel$delegate,selectstart:this._oncancel$delegate,select:this._oncancel$delegate});this._enabled?this._addHandlersOnEnabled():Sys.UI.DomElement.addCssClass(this._tab,"ajax__tab_disabled");i||(Sys.UI.DomElement.addCssClass(this._headerOuterWrapper,"ajax__tab_outer"),Sys.UI.DomElement.addCssClass(this._headerInnerWrapper,"ajax__tab_inner"),Sys.UI.DomElement.addCssClass(this._header,"ajax__tab_tab"),Sys.UI.DomElement.addCssClass(this.get_element(),"ajax__tab_panel"))},dispose:function(){this._dynamicPopulateBehavior&&(this._dynamicPopulateBehavior.dispose(),this._dynamicPopulateBehavior=null);$common.removeHandlers(this._header,{mousedown:this._header_onmousedown$delegate,dragstart:this._oncancel$delegate,selectstart:this._oncancel$delegate,select:this._oncancel$delegate});this._enabled?this._isAttachedEnabledEvents&&this._removeHandlersOnEnabled():this._isAttachedDisabledEvents&&$common.removeHandlers(this._header,{click:this._disabled_onclick});Sys.Extended.UI.TabPanel.callBaseMethod(this,"dispose")},_addHandlersOnEnabled:function(){$addHandlers(this._header,{click:this._header_onclick$delegate,mouseover:this._header_onmouseover$delegate,mouseout:this._header_onmouseout$delegate,keydown:this._onkeydown$delegate})},_removeHandlersOnEnabled:function(){$common.removeHandlers(this._header,{click:this._header_onclick$delegate,mouseover:this._header_onmouseover$delegate,mouseout:this._header_onmouseout$delegate,keydown:this._onkeydown$delegate})},populate:function(n){this._dynamicPopulateBehavior&&this._dynamicPopulateBehavior.get_element
2()!=this.get_element()&&(this._dynamicPopulateBehavior.dispose(),this._dynamicPopulateBehavior=null);!this._dynamicPopulateBehavior&&this._dynamicServiceMethod&&(this._dynamicPopulateBehavior=$create(Sys.Extended.UI.DynamicPopulateBehavior,{ContextKey:this._dynamicContextKey,ServicePath:this._dynamicServicePath,ServiceMethod:this._dynamicServiceMethod},{populated:this._dynamicPopulate_onpopulated$delegate},null,this.get_element()));this._dynamicPopulateBehavior&&(this.raisePopulating(),this._dynamicPopulateBehavior.populate(n?n:this._dynamicContextKey))},_activate:function(){var t,n;this._enabled?(t=this.get_element(),$common.setVisible(t,!0),Sys.UI.DomElement.addCssClass(this._tab,"ajax__tab_active"),this.populate()):this._get_active()&&(n=this._owner.getNearestTab(!1),!n||this._owner.set_activeTab(n));this._owner.get_element().style.visibility="visible"},_deactivate:function(){var n=this.get_element();$common.setVisible(n,!1);Sys.UI.DomElement.removeCssClass(this._tab,"ajax__tab_active")},_show:function(){this._tab.style.display=""},_hide:function(){if(this._tab.style.display="none",this._get_active()){var n=this._owner.getNearestTab(!1);!n||this._owner.set_activeTab(n)}this._deactivate()},_makeEnabled:function(n){var i="__tab_"+this.get_element().id,t;n?(this.isAttachedDisabledEvents&&($common.removeHandlers(this._header,{click:this._disabled_onclick}),this._isAttachedDisabledEvents=!1),this._addHandlersOnEnabled(),this._isAttachedEnabledEvents=!0,Sys.UI.DomElement.removeCssClass($get(i),"ajax__tab_disabled")):(this._isAttachedEnabledEvents&&(this._removeHandlersOnEnabled(),this._isAttachedEnabledEvents=!1),$addHandlers(this._header,{click:this._disabled_onclick}),this.isAttachedDisabledEvents=!0,this._get_active()&&(t=this._owner.getNearestTab(!1),!t||this._owner.set_activeTab(t)),this._deactivate(),Sys.UI.DomElement.addCssClass($get(i),"ajax__tab_disabled"))},_setFocus:function(n){$get("__tab_"+n.get_element().id).focus()},_header_onclick:function(n){n.preventDefault();this.raiseClick();this.get_owner().set_activeTab(this);this._setFocus(this)},_header_onmouseover:function(){Sys.UI.DomElement.addCssClass(this._tab,"ajax__tab_hover")},_header_onmouseout:function(){Sys.UI.DomElement.removeCssClass(this._tab,"ajax__tab_hover")},_header_onmousedown:function(n){n.preventDefault()},_oncancel:function(n){n.stopPropagation();n.preventDefault()},_onkeydown:function(n){var i="which"in n?n.which:n.keyCode,t;i=="39"&&!this._owner._useVerticalStripPlacement||i=="40"&&this._owner._useVerticalStripPlacement?(n.preventDefault(),t=this._owner.getNextTab(!1),t&&(this._owner.set_activeTab(t),this._setFocus(t))):i=="37"&&!this._owner._useVerticalStripPlacement||i=="38"&&this._owner._useVerticalStripPlacement?(n.preventDefault(),t=this._owner.getPreviousTab(!1),t&&(this._owner.set_activeTab(t),this._setFocus(t))):i=="35"?(n.preventDefault(),t=this._owner.getLastTab(!1),t&&(this._owner.set_activeTab(t),this._setFocus(t))):i=="36"&&(n.preventDefault(),t=this._owner.getFirstTab(!1),t&&(this._owner.set_activeTab(t),this._setFocus(t)))},_dynamicPopulate_onpopulated:function(){this.raisePopulated()},_disabled_onclick:function(n){n.preventDefault()}};Sys.Extended.UI.TabPanel.registerClass("Sys.Extended.UI.TabPanel",Sys.UI.Control);Sys.registerComponent(Sys.Extended.UI.TabPanel,{name:"tabPanel",parameters:[{name:"owner",type:"Sys.Extended.UI.TabContainer"},{name:"headerTab",type:"String"}]})}window.Sys&&Sys.loader?Sys.loader.registerScript("ExtendedTabs",["ExtendedDynamicPopulate"],n):n()})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.