123456 |
- // Licensed Materials - Property of IBM
- // IBM Cognos Products: hal
- // (C) Copyright IBM Corp. 2003, 2017.
- // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- function C_Menubar(_hUI1, _hLV1, _hLN1){G_HAL.F_VerifyDependencies("G_MenuManager");this._hVI1=_hUI1;this._hMV1=_hLV1;this._hXN1=_hLN1;var _hWI1=_hUI1.getAttribute("id");if(!_hWI1){_hWI1=U_DOM.F_GetUniqueId("menubar");_hUI1.setAttribute("id", _hWI1);}_hLV1.setAttribute("id", _hWI1);this._h9T=this._hVI1.className;if(!this._hVI1.className){this._hVI1.className="clsMenubar";}this._hVI1.onmousedown=G_MenuManager._h79;this._hVI1.onmouseover=G_MenuManager._h89;this._hVI1.onmouseout=G_MenuManager._hCB;this._hHD();G_MenuManager._h85(_hLV1, this._hVI1, _hLN1, this);G_MenuManager._hXB1(this._hVI1, _hLV1);};C_Menubar.prototype._h5A2=function(){return this._hMV1.getAttribute("id");};C_Menubar.prototype.F_Detach=function(){if(this._hMV1){var _hXI1=this._hMV1.selectNodes(".//menuPopup");for(var i=0;i<_hXI1.length;i++){this.F_DetachMenuPopup(_hXI1.item(i));}G_MenuManager.F_DetachMenuPopupContainer(this._hMV1);this._hMV1.removeAttribute("id");delete this._hMV1;}delete this._hXN1;if(this._hVI1){this._hVI1.className=this._h9T;this._hVI1.onmousedown=null;this._hVI1.onmouseover=null;this._hVI1.onmouseout=null;this._hH();this._hVI1.innerHTML="";delete this._hVI1;}this._h0E();};C_Menubar.prototype.F_DetachMenuPopup=function(_hYI1){G_MenuManager.F_DetachMenuPopup(_hYI1);};C_Menubar.prototype.F_ClearMenuPopup=function(_hYI1){G_MenuManager.F_ClearMenuPopup(_hYI1);};C_Menubar.prototype.F_GetMenuPopup=function(_hJE2){return G_MenuManager.F_GetMenuPopup(_hJE2);};C_Menubar.prototype.F_GetMenuItem=function(_hJE2){return G_MenuManager.F_GetMenuItem(this._hMV1, _hJE2);};C_Menubar.prototype.F_AppendNewMenuPopup=function(_hF51,_hEO1){return G_MenuManager.F_AppendNewMenuPopup(this._hMV1, _hF51, _hEO1);};C_Menubar.prototype.F_DrawMenuPopup=function(_hYI1){return G_MenuManager.F_Draw(_hYI1);};C_Menubar.prototype.F_SetMenuItemLabel=function(_hYB1,_h052,_hSI1){G_MenuManager.F_SetMenuItemLabel(this._hMV1, _hYB1, _h052, _hSI1);};C_Menubar.prototype.F_SetMenuItemTooltip=function(_hYB1,_h3U1){G_MenuManager.F_SetMenuItemTooltip(this._hMV1, _hYB1, _h3U1);};C_Menubar.prototype.F_SetMenuItemDefault=function(_hYB1,_hZI1){G_MenuManager.F_SetMenuItemDefault(this._hMV1, _hYB1, _hZI1);};C_Menubar.prototype.F_SetMenuItemEnabled=function(_hYB1,_hFU1,_h292){G_MenuManager.F_SetMenuItemState(this._hMV1, _hYB1, _hFU1, _h292);};C_Menubar.prototype.F_SetMenuItemDisplay=function(_hYB1,_hNV1){G_MenuManager.F_SetMenuItemDisplay(this._hMV1, _hYB1, _hNV1);};C_Menubar.prototype.F_SetMenuDisplay=function(_h712,_hNV1){var el=document.getElementById(_h712);if(el){el.style.display=_hNV1?"":"none";}};C_Menubar.prototype.F_SetMenuItemChecked=function(_hYB1,_hBV1){G_MenuManager.F_SetMenuItemChecked(this._hMV1, _hYB1, _hBV1);};C_Menubar.prototype.F_SetMenuItemRadioState=function(_hYB1,_hBV1){G_MenuManager.F_SetMenuItemRadioState(this._hMV1, _hYB1, _hBV1);};C_Menubar.prototype.F_EndAsyncLoad=function(_hR31,_h0J1){return G_MenuManager.F_EndAsyncLoad(_hR31, _h0J1);};C_Menubar.prototype.F_HideAllMenuPopups=function(){return G_MenuManager.F_HideAllMenuPopups();};C_Menubar.prototype.F_ShowMenuPopup=function(_hR31,_hB92,_hJC2){var _h4Z=false;return G_MenuManager.F_ShowMenuPopup(_hR31, _hB92, _hJC2, _h4Z);};C_Menubar.prototype._hH=function(_hLC2){if(!G_HAL.M_oLibraries["hal"]["enableAccessibility"]){return;}if(!this._hMG){this._hMG=this._h412.bind(this);}if(_hLC2){U_Accessibility.F_AddFocusAndBlurEventListener(this._hVI1, this._hMG, G_MenuManager._hCB);this._hVI1.onkeydown=G_MenuManager._h3E;}else{U_Accessibility.F_RemoveFocusAndBlurEventListener(this._hVI1, this._hMG, G_MenuManager._hCB);this._hVI1.onkeydown=null;}};C_Menubar.prototype._hHD=function(){if(!G_HAL.M_oLibraries["hal"]["enableAccessibility"]){return;}this._hVI1.setAttribute( "role", "menubar" );this._hH(true);};C_Menubar.prototype._h412=function(e){if(!G_HAL.M_oLibraries["hal"]["enableAccessibility"]){return;}var _h5Z=e.target;if(_h5Z.getAttribute( "role" )=="menuitem" ){if(this._h95){this._h95.setAttribute( "tabIndex", "-1" );}_h5Z.setAttribute( "tabIndex", "0" );this._h95=_h5Z;}G_MenuManager._h89(e);};C_Menubar.prototype._h0E=function(){if(!G_HAL.M_oLibraries["hal"]["enableAccessibility"]){return;}this._h95=null;};C_Menubar.prototype.F_GetMenubarItemToFocus=function(){if(!G_HAL.M_oLibraries["hal"]["enableAccessibility"]){return null;}if(this._h95){return this._h95;}else{var nl=this._hVI1.getElementsByTagName("TD");var _hBZ1=nl.length;for(var i=0;i<_hBZ1;i++){var elTD=nl.item(i);if(elTD.getAttribute( "role" )=="menuitem"&&G_MenuManager.F_IsFocusableMenuBarItem( elTD ) ){return elTD;}}}return null;};
|