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.
- var U_Button={};U_Button.F_InitButtonFromId=function(_hMQ1,_hH51){this.F_InitButton(document.getElementById(_hMQ1), _hH51);};U_Button.F_InitButton=function(btn,_hH51){if(!btn){return;}if(!_hH51){_hH51=btn.getAttribute("HAL_buttonClassPrefix");}if(!_hH51&&(btn.className=="clsDotDotDotButton")){_hH51="clsDotDotDotButton";btn._hNF=true;}if(!_hH51&&(btn.className=="clsDlgButtonDropDownArrow")){_hH51="clsDlgButtonDropDownArrow";btn._hV2=true;}btn._hH51=_hH51?_hH51:"clsDlgButton";U_DOM.F_SetFirstClassName(btn, btn._hH51);btn[G_BrowserInfo.M_bIsPointerEnabled?"onpointerover":"onmouseover"]=this._hO91;btn[G_BrowserInfo.M_bIsPointerEnabled?"onpointerout":"onmouseout"]=this._hRG1;btn._h491=true;this._hHD(btn);};U_Button.F_Detach=function(btn){btn[G_BrowserInfo.M_bIsPointerEnabled?"onpointerover":"onmouseover"]=null;btn[G_BrowserInfo.M_bIsPointerEnabled?"onpointerout":"onmouseout"]=null;};U_Button.F_InitButtons=function(el){if(G_HAL.M_oLibraries["hal"]["enableAccessibility"]){var nl=el.getElementsByTagName("BUTTON");var _hBZ1=nl.length;for(var i=0;i<_hBZ1;i++){this._hHD(nl.item(i));}}var nl=el.getElementsByTagName("BUTTON");var _hBZ1=nl.length;for(var i=0;i<_hBZ1;i++){var btn=nl.item(i);if(!btn._h491&&btn.classList.contains( "clsDlgButton" )&&( btn.getAttribute( "HAL_isCoolButton" ) != "true" )&&( btn.getAttribute( "HAL_isFixedWidth" ) != "true" ) ){this.F_InitButton(btn, "");}else if(!btn._h491&&btn.classList.contains("clsDotDotDotButton")){this.F_InitButton(btn, "");}else if(!btn._h491&&btn.classList.contains("clsDlgButtonDropDownArrow")){this.F_InitButton(btn, "");}}};U_Button.F_InitClass=function(btn){if(btn._h491){U_DOM.F_SetFirstClassName(btn, btn._hH51);}};U_Button.F_SetEnabledFromId=function(_hMQ1,_hFU1,_hX52){U_DOM.F_SetButtonEnabled(_hMQ1, _hFU1, _hX52);};U_Button.F_SetEnabled=function(btn,_hFU1,_hX52){U_DOM.F_SetButtonEnabledFromButton(btn, _hFU1, _hX52);};U_Button.F_SetLabel=function(btn,_h052){btn.innerText=_h052;if(G_HAL.M_oLibraries["hal"]["enableAccessibility"]){btn.setAttribute("aria-label", _h052);}};U_Button._hO91=function(e){if(this.contains(e.target)){U_DOM.F_SetFirstClassName(this, this._hH51+"_hover");if(G_HAL.M_oLibraries["hal"]["enableHighContrastMode"]){this.classList.add("clsHighContrastHover");}}};U_Button._hRG1=function(e){if((e.target==this)||!this.contains(e.target)){U_DOM.F_SetFirstClassName(this, this._hH51);if(G_HAL.M_oLibraries["hal"]["enableHighContrastMode"]){this.classList.remove("clsHighContrastHover");}}};U_Button._hHD=function(btn){if(!G_HAL.M_oLibraries["hal"]["enableAccessibility"]){return;}btn.setAttribute( "role", "button" );if(!btn.getAttribute("aria-label")){if(btn.className=="clsDotDotDotButton"||btn.className=="clsDotDotDotPropertyButton"){btn.setAttribute( "aria-label", G_ResManager.F_GetString( "IDS_HAL_AC_DOTDOTDOT" ) );}else if(btn.className=="clsDlgButtonDropDownArrow"){btn.setAttribute( "aria-label", G_ResManager.F_GetString( "IDS_HAL_AC_DROPDOWN" ) );}else if(btn.title){btn.setAttribute("aria-label", btn.title);}}if(btn.getAttribute("aria-label")){var _hZ32=btn.getElementsByTagName("IMG");if(_hZ32.length==1){_hZ32[0].setAttribute( "alt", btn.getAttribute( "aria-label" ) );}}};function C_Button(btn, _h1P1){this._hVE2=btn;btn._hAT1=this;U_Button.F_InitButton(btn);btn.onclick=_h1P1||null;};C_Button.prototype.F_Detach=function(){U_Button.F_Detach(this._hVE2);this._hVE2.onclick=null;this._hVE2.ondblclick=null;this._hVE2._hAT1=this;this._hVE2=null;};C_Button.prototype.F_SetLabel=function(_h052){U_Button.F_SetLabel(this._hVE2, _h052);};C_Button.prototype.F_SetEnabled=function(_hFU1,_hX52){U_Button.F_SetEnabled(this._hVE2, _hFU1, _hX52);};
|