1// Name: Tabs.Tabs.debug.js 2// Assembly: AjaxControlToolkit 3// Version: 4.1.60501.0 4// FileVersion: 4.1.60501 5// (c) 2010 CodePlex Foundation 6 7 8 9/// <reference name="MicrosoftAjax.debug.js" /> 10/// <reference path="../ExtenderBase/BaseScripts.js" /> 11/// <reference path="../Common/Common.js" /> 12/// <reference path="../DynamicPopulate/DynamicPopulateBehavior.js" /> 13 14(function () { 15 var scriptName = "ExtendedTabs"; 16 17 function execute() { 18 19 20 Type.registerNamespace("Sys.Extended.UI"); 21 22 Sys.Extended.UI.TabStripPlacement = function () { } 23 Sys.Extended.UI.TabStripPlacement.prototype = { 24 Top: 0, 25 Bottom: 1, 26 TopRight: 2, 27 BottomRight: 3 28 } 29 Sys.Extended.UI.TabStripPlacement.registerEnum("Sys.Extended.UI.TabStripPlacement", true); 30 31 Sys.Extended.UI.UseVerticalStripPlacement = function () { } 32 Sys.Extended.UI.OnDemand = function () { } 33 34 Sys.Extended.UI.OnDemandMode = function () { } 35 Sys.Extended.UI.OnDemandMode.prototype = { 36 None: 0, 37 Always: 1, 38 Once: 2 39 } 40 Sys.Extended.UI.OnDemandMode.registerEnum("Sys.Extended.UI.OnDemandMode", true); 41 42 Sys.Extended.UI.TabContainer = function (element) { 43 Sys.Extended.UI.TabContainer.initializeBase(this, [element]); 44 this._cachedActiveTabIndex = -1; 45 this._activeTabIndex = -1; 46 this._scrollBars = Sys.Extended.UI.ScrollBars.None; 47 this._tabs = null; 48 this._header = null; 49 this._body = null; 50 this._loaded = false; 51 this._autoPostBackId = null; 52 this._useVerticalStripPlacement = false; 53 this._onDemand = false; 54 this._pageRequestManager = null; 55 this._tabStripPlacement = Sys.Extended.UI.TabStripPlacement.Top; 56 this._app_onload$delegate = Function.createDelegate(this, this._app_onload); 57 } 58 Sys.Extended.UI.TabContainer.prototype = { 59 60 add_activeTabChanged: function (handler) { 61 this.get_events().addHandler("activeTabChanged", handler); 62 }, 63 remove_activeTabChanged: function (handler) { 64 this.get_events().removeHandler("activeTabChanged", handler); 65 }, 66 raiseActiveTabChanged: function () { 67 var eh = this.get_events().getHandler("activeTabChanged"); 68 if (eh) { 69 eh(this, Sys.EventArgs.Empty); 70 } 71 if (this._autoPostBackId) { 72 __doPostBack(this._autoPostBackId, "activeTabChanged:" + this.get_activeTabIndex()); 73 } 74 }, 75 76 get_activeTabIndex: function () { 77 if (this._cachedActiveTabIndex > -1) { 78 return this._cachedActiveTabIndex; 79 } 80 return this._activeTabIndex; 81 }, 82 set_activeTabIndex: function (valuePassed) { 83 var value = valuePassed; 84 if (!this.get_isInitialized()) { 85 this._cachedActiveTabIndex = value; 86 } else { 87 if (value < -1) { 88 throw Error.argumentOutOfRange("value"); 89 } 90 if (value >= this.get_tabs().length) { 91 value = this.get_tabs().length - 1; 92 } 93 if (value != this._activeTabIndex) { 94 if (this._activeTabIndex != -1) { 95 var oldTab = this.get_tabs()[this._activeTabIndex]; 96 /*this._body.style.height = this._body.offsetHeight + "px";*/ 97 oldTab._set_active(false); 98 } 99 100 var changed = (this._activeTabIndex != value); 101 102 this._activeTabIndex = value; 103 104 if (this._activeTabIndex != -1) { 105 this.get_tabs()[this._activeTabIndex]._set_active(true); 106 } 107 /*this._body.style.height = "auto";*/ 108 if (this._loaded && changed) { 109 if (this._onDemand) { 110 var activeTab = this.get_tabs()[this._activeTabIndex]; 111 if (activeTab._onDemandMode != Sys.Extended.UI.OnDemandMode.None) { 112 if ((activeTab._onDemandMode == Sys.Extended.UI.OnDemandMode.Once && activeTab._wasLoaded == false) 113 || activeTab._onDemandMode == Sys.Extended.UI.OnDemandMode.Always) { 114 this._pageRequestManager.beginAsyncPostBack([activeTab._updatePanelID], null, null, false, null); 115 activeTab._wasLoaded = true; 116 } 117 } 118 } 119 this.raiseActiveTabChanged(); 120 } 121 this.raisePropertyChanged("activeTabIndex"); 122 } 123 } 124 }, 125 126 get_tabs: function () { 127 if (this._tabs == null) { 128 this._tabs = []; 129 } 130 return this._tabs; 131 }, 132 133 get_activeTab: function () { 134 if (this._activeTabIndex > -1) { 135 return this.get_tabs()[this._activeTabIndex]; 136 } 137 return null; 138 }, 139 set_activeTab: function (value) { 140 var i = Array.indexOf(this.get_tabs(), value); 141 if (i == -1) { 142 throw Error.argument("value", Sys.Extended.UI.Resources.Tabs_ActiveTabArgumentOutOfRange); 143 } 144 this.set_activeTabIndex(i); 145 }, 146 147 get_autoPostBackId: function () { 148 return this._autoPostBackId; 149 }, 150 set_autoPostBackId: function (value) { 151 this._autoPostBackId = value; 152 }, 153 get_scrollBars: function () { 154 return this._scrollBars; 155 }, 156 set_scrollBars: function (value) { 157 if (this._scrollBars != value) { 158 this._scrollBars = value; 159 this._invalidate(); 160 this.raisePropertyChanged("scrollBars"); 161 } 162 }, 163 164 get_tabStripPlacement: function () { 165 return this._tabStripPlacement; 166 }, 167 set_tabStripPlacement: function (value) { 168 if (this._tabStripPlacement != value) { 169 this._tabStripPlacement = value; 170 this._invalidate(); 171 this.raisePropertyChanged("tabStripPlacement"); 172 } 173 }, 174 175 get_useVerticalStripPlacement: function () { 176 return this._useVerticalStripPlacement; 177 }, 178 set_useVerticalStripPlacement: function (value) { 179 if (this._useVerticalStripPlacement != value) { 180 this._useVerticalStripPlacement = value; 181 this._invalidate(); 182 this.raisePropertyChanged("useVerticalStripPlacement"); 183 } 184 }, 185 186 get_onDemand: function () { 187 return this._onDemand; 188 }, 189 set_onDemand: function (value) { 190 if (this._onDemand != value) { 191 this._onDemand = value; 192 this._invalidate(); 193 this.raisePropertyChanged("onDemand"); 194 } 195 }, 196 197 initialize: function () { 198 Sys.Extended.UI.TabContainer.callBaseMethod(this, "initialize"); 199
200 var elt = this.get_element(); 201 this._header = $get(this.get_id() + "_header"); 202 this._body = $get(this.get_id() + "_body"); 203 204 $common.addCssClasses(elt, [ 205 "ajax__tab_container", 206 "ajax__tab_default" 207 ]); 208 209 this._invalidate(); 210 if (this._onDemand) this._pageRequestManager = Sys.WebForms.PageRequestManager.getInstance(); 211 Sys.Application.add_load(this._app_onload$delegate); 212 }, 213 dispose: function () { 214 $clearHandlers(this.get_element()); 215 Sys.Application.remove_load(this._app_onload$delegate); 216 Sys.Extended.UI.TabContainer.callBaseMethod(this, "dispose"); 217 }, 218 getFirstTab: function (includeDisabled) { 219 var tabs = this.get_tabs(); 220 for (var i = 0; i < tabs.length; i++) { 221 if (includeDisabled || tabs[i].get_enabled()) { 222 return tabs[i]; 223 } 224 } 225 return null; 226 }, 227 getLastTab: function (includeDisabled) { 228 var tabs = this.get_tabs(); 229 for (var i = tabs.length - 1; i >= 0; i--) { 230 if (includeDisabled || tabs[i].get_enabled()) { 231 return tabs[i]; 232 } 233 } 234 return null; 235 }, 236 getNextTab: function (includeDisabled) { 237 var tabs = this.get_tabs(); 238 var active = this.get_activeTabIndex(); 239 for (var i = 1; i < tabs.length; i++) { 240 var tabIndex = (active + i) % tabs.length; 241 var tab = tabs[tabIndex]; 242 if (includeDisabled || tab.get_enabled()) 243 return tab; 244 } 245 return null; 246 }, 247 getPreviousTab: function (includeDisabled) { 248 var tabs = this.get_tabs(); 249 var active = this.get_activeTabIndex(); 250 for (var i = 1; i < tabs.length; i++) { 251 var tabIndex = (tabs.length + (active - i)) % tabs.length; 252 var tab = tabs[tabIndex]; 253 if (includeDisabled || tab.get_enabled()) 254 return tab; 255 } 256 return null; 257 }, 258 getNearestTab: function (includeDisabled) { 259 var prev = this.getPreviousTab(includeDisabled); 260 var next = this.getNextTab(includeDisabled); 261 if (prev && prev.get_tabIndex() < this._activeTabIndex) { 262 return prev; 263 } else if (next && next.get_tabIndex() > this._activeTabIndex) { 264 return next; 265 } 266 return null; 267 }, 268 saveClientState: function () { 269 var tabs = this.get_tabs(); 270 var tabState = []; 271 for (var i = 0; i < tabs.length; i++) { 272 Array.add(tabState, tabs[i].get_enabled()); 273 } 274 var state = { 275 ActiveTabIndex: this._activeTabIndex, 276 TabState: tabState 277 }; 278 return Sys.Serialization.JavaScriptSerializer.serialize(state); 279 }, 280 _invalidate: function () { 281 if (this.get_isInitialized()) {
282 $common.removeCssClasses(this._body, [ 283 "ajax__scroll_horiz", 284 "ajax__scroll_vert", 285 "ajax__scroll_both", 286 "ajax__scroll_auto", 287 "ajax__scroll_none" 288 ]); 289 switch (this._scrollBars) { 290 case Sys.Extended.UI.ScrollBars.Horizontal: 291 Sys.UI.DomElement.addCssClass(this._body, "ajax__scroll_horiz"); 292 break; 293 case Sys.Extended.UI.ScrollBars.Vertical: 294 Sys.UI.DomElement.addCssClass(this._body, "ajax__scroll_vert"); 295 break; 296 case Sys.Extended.UI.ScrollBars.Both: 297 Sys.UI.DomElement.addCssClass(this._body, "ajax__scroll_both"); 298 break; 299 case Sys.Extended.UI.ScrollBars.Auto: 300 Sys.UI.DomElement.addCssClass(this._body, "ajax__scroll_auto"); 301 break; 302 case Sys.Extended.UI.ScrollBars.None: 303 Sys.UI.DomElement.addCssClass(this._body, "ajax__scroll_none"); 304 break; 305 } 306 if (this._useVerticalStripPlacement) { 307 var headBounds = $common.getBounds(this._header); 308 var bodyBounds = $common.getBounds(this._body); 309 var spannerHeight = (bodyBounds.height - headBounds.height - 1) + "px"; 310 $get(this.get_id() + "_headerSpannerHeight").style.height = spannerHeight; 311 312 if (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version < 7) { 313 if (this._tabStripPlacement == Sys.Extended.UI.TabStripPlacement.Top || 314 this._tabStripPlacement == Sys.Extended.UI.TabStripPlacement.Bottom) { 315 var newBounds = { 316 x: headBounds.x + headBounds.width, 317 y: headBounds.y, 318 width: bodyBounds.width, 319 height: bodyBounds.height 320 }; 321 $common.setBounds(this._body, newBounds); 322 } else { 323 var newBounds = { 324 x: bodyBounds.x + bodyBounds.width, 325 y: headBounds.y, 326 width: headBounds.width, 327 height: headBounds.height 328 }; 329 $common.setBounds(this._header, newBounds); 330 $common.setBounds(this._body, bodyBounds); 331 } 332 } 333 } 334 } 335 }, 336 _app_onload: function (sender, e) { 337 if (this._cachedActiveTabIndex != -1) { 338 this.set_activeTabIndex(this._cachedActiveTabIndex); 339 this._cachedActiveTabIndex = -1; 340 341 var activeTab = this.get_tabs()[this._activeTabIndex]; 342 if (activeTab) { 343 activeTab._wasLoaded = true; 344 activeTab._setFocus(activeTab); 345 } 346 } 347 this._loaded = true; 348 } 349 } 350 Sys.Extended.UI.TabContainer.registerClass("Sys.Extended.UI.TabContainer", Sys.Extended.UI.ControlBase); 351 Sys.registerComponent(Sys.Extended.UI.TabContainer, { name: "tabContainer", parameters: [{ name: "activeTabIndex", type: "Number"}] }); 352 353 Sys.Extended.UI.TabPanel = function (element) { 354 Sys.Extended.UI.TabPanel.initializeBase(this, [element]); 355 this._active = false; 356 this._tab = null; 357 this._headerOuter = null; 358 this._headerInner = null; 359 this._header = null; 360 this._owner = null; 361 this._ownerID = null; 362 this._enabled = true; 363 this._tabIndex = -1; 364 this._dynamicContextKey = null; 365 this._dynamicServicePath = null; 366 this._dynamicServiceMethod = null; 367 this._dynamicPopulateBehavior = null; 368 this._scrollBars = Sys.Extended.UI.ScrollBars.None; 369 this._onDemandMode = Sys.Extended.UI.OnDemandMode.Always; 370 this._wasLoaded = false; 371 this._updatePanelID = ""; 372 this._header_onclick$delegate = Function.createDelegate(this, this._header_onclick); 373 this._header_onmouseover$delegate = Function.createDelegate(this, this._header_onmouseover); 374 this._header_onmouseout$delegate = Function.createDelegate(this, this._header_onmouseout); 375 this._header_onmousedown$delegate = Function.createDelegate(this, this._header_onmousedown);
376 this._dynamicPopulate_onpopulated$delegate = Function.createDelegate(this, this._dynamicPopulate_onpopulated); 377 this._oncancel$delegate = Function.createDelegate(this, this._oncancel); 378 this._onkeydown$delegate = Function.createDelegate(this, this._onkeydown); 379 this._disabled_onclick$delegate = Function.createDelegate(this, this._disabled_onclick); 380 } 381 Sys.Extended.UI.TabPanel.prototype = { 382 383 add_click: function (handler) { 384 this.get_events().addHandler("click", handler); 385 }, 386 remove_click: function (handler) { 387 this.get_events().removeHandler("click", handler); 388 }, 389 raiseClick: function () { 390 var eh = this.get_events().getHandler("click"); 391 if (eh) { 392 eh(this, Sys.EventArgs.Empty); 393 } 394 }, 395 396 add_populating: function (handler) { 397 this.get_events().addHandler("populating", handler); 398 }, 399 remove_populating: function (handler) { 400 this.get_events().removeHandler("populating", handler); 401 }, 402 raisePopulating: function () { 403 var eh = this.get_events().getHandler("populating"); 404 if (eh) { 405 eh(this, Sys.EventArgs.Empty); 406 } 407 }, 408 409 add_populated: function (handler) { 410 this.get_events().addHandler("populated", handler); 411 }, 412 remove_populated: function (handler) { 413 this.get_events().removeHandler("populated", handler); 414 }, 415 raisePopulated: function () { 416 var eh = this.get_events().getHandler("populated"); 417 if (eh) { 418 eh(this, Sys.EventArgs.Empty); 419 } 420 }, 421 422 get_headerText: function () { 423 if (this.get_isInitialized()) { 424 return this._header.innerHTML; 425 } 426 return ""; 427 }, 428 set_headerText: function (value) { 429 if (!this.get_isInitialized()) { 430 throw Error.invalidOperation(String.format(Sys.Extended.UI.Resources.Tabs_PropertySetBeforeInitialization, 'headerText')); 431 } 432 if (this.get_headerText() != value) { 433 this._header.innerHTML = value; 434 this.raisePropertyChanged("headerText"); 435 } 436 }, 437 438 get_headerTab: function () { 439 return this._header; 440 }, 441 set_headerTab: function (value) { 442 if (typeof (value) === "string") { 443 value = Sys.get(value); 444 if (!value) { 445 throw new Error.argumentNull("value"); 446 } 447 } 448 if (this._header != value) { 449 if (this.get_isInitialized()) { 450 throw Error.invalidOperation(String.format(Sys.Extended.UI.Resources.Tabs_PropertySetAfterInitialization, 'headerTab')); 451 } 452 this._header = value; 453 this.raisePropertyChanged("value"); 454 } 455 }, 456 457 get_enabled: function () { 458 return this._enabled; 459 }, 460 set_enabled: function (value) { 461 if (value != this._enabled) { 462 this._enabled = value; 463 if (this.get_isInitialized()) { 464 this._makeEnabled(this._enabled); 465 } 466 this.raisePropertyChanged("enabled"); 467 } 468 }, 469 470 get_owner: function () { 471 return this._owner; 472 }, 473 set_owner: function (value) { 474 if (value instanceof Sys.ComponentSet) value = value.get(0); 475 if (this._owner != value) { 476 if (this.get_isInitialized()) {
477 throw Error.invalidOperation(String.format(Sys.Extended.UI.Resources.Tabs_PropertySetAfterInitialization, 'owner')); 478 } 479 this._owner = value; 480 this.raisePropertyChanged("owner"); 481 } 482 }, 483 484 get_ownerID: function () { 485 return this._ownerID; 486 }, 487 set_ownerID: function (value) { 488 this._ownerID = value; 489 }, 490 491 get_scrollBars: function () { 492 return this._scrollBars; 493 }, 494 set_scrollBars: function (value) { 495 if (this._scrollBars != value) { 496 this._scrollBars = value; 497 this.raisePropertyChanged("scrollBars"); 498 } 499 }, 500 501 get_onDemandMode: function () { 502 return this._onDemandMode; 503 }, 504 set_onDemandMode: function (value) { 505 if (this._onDemandMode != value) { 506 this._onDemandMode = value; 507 this.raisePropertyChanged("onDemandMode"); 508 } 509 }, 510 511 get_tabIndex: function () { 512 return this._tabIndex; 513 }, 514 515 get_dynamicContextKey: function () { 516 return this._dynamicContextKey; 517 }, 518 set_dynamicContextKey: function (value) { 519 if (this._dynamicContextKey != value) { 520 this._dynamicContextKey = value; 521 this.raisePropertyChanged('dynamicContextKey'); 522 } 523 }, 524 525 get_dynamicServicePath: function () { 526 return this._dynamicServicePath; 527 }, 528 set_dynamicServicePath: function (value) { 529 if (this._dynamicServicePath != value) { 530 this._dynamicServicePath = value; 531 this.raisePropertyChanged('dynamicServicePath'); 532 } 533 }, 534 535 get_dynamicServiceMethod: function () { 536 return this._dynamicServiceMethod; 537 }, 538 set_dynamicServiceMethod: function (value) { 539 if (this._dynamicServiceMethod != value) { 540 this._dynamicServiceMethod = value; 541 this.raisePropertyChanged('dynamicServiceMethod'); 542 } 543 }, 544 545 _get_active: function () { 546 return this._active; 547 }, 548 _set_active: function (value) { 549 this._active = value; 550 if (value) 551 this._activate(); 552 else 553 this._deactivate(); 554 }, 555 556 get_updatePanelID: function () { 557 return this._updatePanelID; 558 }, 559 set_updatePanelID: function (value) { 560 if (this._updatePanelID != value) { 561 this._updatePanelID = value; 562 this.raisePropertyChanged("updatePanelID"); 563 } 564 }, 565 566 initialize: function () { 567 var owner = this.get_owner(); 568 if (!owner) { 569 owner = $find(this.get_ownerID()); 570 if (owner) { 571 owner.initialize(); 572 this.set_owner(owner); 573 } 574 } 575 576 Sys.Extended.UI.TabPanel.callBaseMethod(this, "initialize"); 577 578 if (!owner) { 579 throw Error.invalidOperation(Sys.Extended.UI.Resources.Tabs_OwnerExpected); 580 } 581 582 this._tabIndex = owner.get_tabs().length; 583 584 Array.add(owner.get_tabs(), this); 585 var tabId = this.get_id() + "_tab"; 586 this._tab = document.getElementById(tabId); 587 var serverRendered = (this._tab != null); 588 589 if (!serverRendered) { 590 this._headerOuterWrapper = document.createElement('span'); 591 this._headerInnerWrapper = document.createElement('span'); 592 this._tab = document.createElement('span'); 593 this._tab.id = tabId; 594 this._header.parentNode.replaceChild(this._tab, this._header); 595 this._tab.appendChild(this._headerOuterWrapper); 596 this._headerOuterWrapper.appendChild(this._headerInnerWrapper); 597 this._headerInnerWrapper.appendChild(this._header); 598 } 599 600 $addHandlers(this._header, { 601 mousedown: this._header_onmousedown$delegate, 602 dragstart: this._oncancel$delegate, 603 selectstart: this._oncancel$delegate, 604 select: this._oncancel$delegate 605 }); 606 if (this._enabled) { 607 this._addHandlersOnEnabled(); 608 } else { 609 Sys.UI.DomElement.addCssClass(this._tab, "ajax__tab_disabled"); 610 } 611 612 if (!serverRendered) { 613 Sys.UI.DomElement.addCssClass(this._headerOuterWrapper, "ajax__tab_outer"); 614 Sys.UI.DomElement.addCssClass(this._headerInnerWrapper, "ajax__tab_inner"); 615 Sys.UI.DomElement.addCssClass(this._header, "ajax__tab_tab"); 616 Sys.UI.DomElement.addCssClass(this.get_element
616(), "ajax__tab_panel"); 617 } 618 }, 619 620 dispose: function () { 621 if (this._dynamicPopulateBehavior) { 622 this._dynamicPopulateBehavior.dispose(); 623 this._dynamicPopulateBehavior = null; 624 } 625 $common.removeHandlers(this._header, { 626 mousedown: this._header_onmousedown$delegate, 627 dragstart: this._oncancel$delegate, 628 selectstart: this._oncancel$delegate, 629 select: this._oncancel$delegate 630 }); 631 if (this._enabled) { 632 this._removeHandlersOnEnabled(); 633 } else { 634 $common.removeHandlers(this._header, { 635 click: this._disabled_onclick 636 }); 637 } 638 Sys.Extended.UI.TabPanel.callBaseMethod(this, "dispose"); 639 }, 640 641 _addHandlersOnEnabled: function () { 642 $addHandlers(this._header, { 643 click: this._header_onclick$delegate, 644 mouseover: this._header_onmouseover$delegate, 645 mouseout: this._header_onmouseout$delegate, 646 keydown: this._onkeydown$delegate 647 }); 648 }, 649 650 _removeHandlersOnEnabled: function () { 651 $common.removeHandlers(this._header, { 652 click: this._header_onclick$delegate, 653 mouseover: this._header_onmouseover$delegate, 654 mouseout: this._header_onmouseout$delegate, 655 keydown: this._onkeydown$delegate 656 }); 657 }, 658 659 populate: function (contextKeyOverride) { 660 if (this._dynamicPopulateBehavior && (this._dynamicPopulateBehavior.get_element() != this.get_element())) { 661 this._dynamicPopulateBehavior.dispose(); 662 this._dynamicPopulateBehavior = null; 663 } 664 if (!this._dynamicPopulateBehavior && this._dynamicServiceMethod) { 665 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()); 666 } 667 if (this._dynamicPopulateBehavior) { 668 this.raisePopulating(); 669 this._dynamicPopulateBehavior.populate(contextKeyOverride ? contextKeyOverride : this._dynamicContextKey); 670 } 671 }, 672 673 _activate: function () { 674 if (this._enabled) { 675 var elt = this.get_element(); 676 $common.setVisible(elt, true); 677 Sys.UI.DomElement.addCssClass(this._tab, "ajax__tab_active"); 678 679 this.populate(); 680 } else if (this._get_active()) { 681 var next = this._owner.getNearestTab(false); 682 if (!!next) { 683 this._owner.set_activeTab(next); 684 } 685 } 686 this._owner.get_element().style.visibility = 'visible'; 687 }, 688 _deactivate: function () { 689 var elt = this.get_element(); 690 $common.setVisible(elt, false); 691 Sys.UI.DomElement.removeCssClass(this._tab, "ajax__tab_active"); 692 }, 693 _show: function () { 694 this._tab.style.display = ''; 695 }, 696 _hide: function () { 697 this._tab.style.display = 'none'; 698 if (this._get_active()) { 699 var next = this._owner.getNearestTab(false); 700 if (!!next) { 701 this._owner.set_activeTab(next); 702 } 703 } 704 this._deactivate(); 705 }, 706 707 _makeEnabled: function (enable) {
708 var hyperlinkId = "__tab_" + this.get_element().id; 709 if (enable) { 710 $common.removeHandlers(this._header, { 711 click: this._disabled_onclick 712 }); 713 this._addHandlersOnEnabled(); 714 Sys.UI.DomElement.removeCssClass($get(hyperlinkId), "ajax__tab_disabled"); 715 } else { 716 this._removeHandlersOnEnabled(); 717 $addHandlers(this._header, { 718 click: this._disabled_onclick 719 }); 720 if (this._get_active()) { 721 var next = this._owner.getNearestTab(false); 722 if (!!next) { 723 this._owner.set_activeTab(next); 724 } 725 } 726 this._deactivate(); 727 Sys.UI.DomElement.addCssClass($get(hyperlinkId), "ajax__tab_disabled"); 728 } 729 }, 730 _setFocus: function (obj) { 731 $get("__tab_" + obj.get_element().id).focus(); 732 }, 733 _header_onclick: function (e) { 734 e.preventDefault(); 735 this.raiseClick(); 736 this.get_owner().set_activeTab(this); 737 this._setFocus(this); 738 }, 739 _header_onmouseover: function (e) { 740 Sys.UI.DomElement.addCssClass(this._tab, "ajax__tab_hover"); 741 }, 742 _header_onmouseout: function (e) { 743 Sys.UI.DomElement.removeCssClass(this._tab, "ajax__tab_hover"); 744 }, 745 _header_onmousedown: function (e) { 746 e.preventDefault(); 747 }, 748 _oncancel: function (e) { 749 e.stopPropagation(); 750 e.preventDefault(); 751 }, 752 _onkeydown: function (e) { 753 var keyCode = ('which' in e) ? e.which : e.keyCode; 754 if ((keyCode == "39" && !this._owner._useVerticalStripPlacement) || (keyCode == "40" && this._owner._useVerticalStripPlacement))//right or down 755 { 756 e.preventDefault(); 757 var next = this._owner.getNextTab(false); 758 if (next) { 759 this._owner.set_activeTab(next); 760 this._setFocus(next); 761 } 762 } 763 else if ((keyCode == "37" && !this._owner._useVerticalStripPlacement) || (keyCode == "38" && this._owner._useVerticalStripPlacement))//left or up 764 { 765 e.preventDefault(); 766 var next = this._owner.getPreviousTab(false); 767 if (next) { 768 this._owner.set_activeTab(next); 769 this._setFocus(next); 770 } 771 } 772 else if (keyCode == "35")//end 773 { 774 e.preventDefault(); 775 var next = this._owner.getLastTab(false); 776 if (next) { 777 this._owner.set_activeTab(next); 778 this._setFocus(next); 779 } 780 } 781 else if (keyCode == "36")//home 782 { 783 e.preventDefault(); 784 var next = this._owner.getFirstTab(false); 785 if (next) { 786 this._owner.set_activeTab(next); 787 this._setFocus(next); 788 } 789 } 790 }, 791 _dynamicPopulate_onpopulated: function (sender, e) { 792 this.raisePopulated(); 793 }, 794 _disabled_onclick: function (e) { 795 e.preventDefault(); 796 } 797 } 798 Sys.Extended.UI.TabPanel.registerClass("Sys.Extended.UI.TabPanel", Sys.UI.Control); 799 Sys.registerComponent(Sys.Extended.UI.TabPanel, { name: "tabPanel", parameters: [{ name: "owner", type: "Sys.Extended.UI.TabContainer" }, { name: "headerTab", type: "String"}] }); 800 } // execute 801 802 if (window.Sys && Sys.loader) { 803 Sys.loader.registerScript(scriptName, ["ExtendedDynamicPopulate"], execute); 804 } 805 else { 806 execute(); 807 } 808 809})();
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.