C_PromptControl.js 4.9 KB

123456
  1. // Licensed Materials - Property of IBM
  2. // IBM Cognos Products: cchl
  3. // (C) Copyright IBM Corp. 2003, 2016.
  4. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. function C_PromptControl(_cTM, _cCB1){this._cWM=_cTM;this._cDB1=_cCB1;this._c881="";this._cWC1=true;this._c0P1=false;this._cHX=false;this._cUJ=false;this._c9B;this._c231=null;};C_PromptControl.M_sPromptClass="clsPromptComponent";C_PromptControl.M_sParseErrorClass="clsParseError";C_PromptControl.M_sTouchDevice="clsTouchDevice";C_PromptControl.M_sAttrRole="prole";C_PromptControl.M_sAttrRoleLabel="label";C_PromptControl.M_sAttrRoleInput="input";C_PromptControl.M_sAttrRoleRadio="radio";C_PromptControl.M_sAttrRoleSpacer="spacer";C_PromptControl.M_sAttrRoleAdornmentL="adornmentL";C_PromptControl.M_sAttrRoleAdornmentR="adornmentR";C_PromptControl.M_sAttrRoleControl="controlPanel";C_PromptControl.M_sAttrRoleChoice="choicePanel";C_PromptControl.M_sAttrRoleContainer="container";C_PromptControl.M_sClassPCA="pca";C_PromptControl.M_sClassPTI="pti";C_PromptControl.M_sClassPDTC="pdtc";C_PromptControl.prototype.F_GetParameter=function(){return this._c881;};C_PromptControl.prototype.F_GetNode=function(){return this._cWM;};C_PromptControl.prototype.F_IsInOverallValidState=function(){return this._c9B;};C_PromptControl.prototype._c0D=function(){if(this._cWM.getAttribute("parameter")){this._c881=this._cWM.getAttribute("parameter");}if(this._cWM.getAttribute("required")){this._cWC1=( this._cWM.getAttribute( "required" )=="false"?false:true );}if(this._cWM.getAttribute("range")){this._c0P1=( this._cWM.getAttribute( "range" )=="true"?true:false );}if(this._cWM.getAttribute("multiSelect")){this._cHX=( this._cWM.getAttribute( "multiSelect" )=="true"?true:false );}if(this._cWM.getAttribute("hideAdornments")){this._cUJ=( this._cWM.getAttribute( "hideAdornments" )=="true"?true:false );}};C_PromptControl.prototype._cU5=function(_cNV1){var _cA31=_cNV1.appendChild(document.createElement("img"));_cA31.src=G_HAL.F_GetImageURL("cchl/images/icon_required.gif");_cA31.style.border="0px";_cA31.style.width="10px";_cA31.style.height="10px";return _cA31;};C_PromptControl.prototype._cK7=function(){if(this._cDB1&&this._cDB1.F_PromptControl_OnValidUserInput){this._cDB1.F_PromptControl_OnValidUserInput(this);}};C_PromptControl.prototype._cU4=function(){if(this._cDB1&&this._cDB1.F_PromptControl_OnInvalidUserInput){this._cDB1.F_PromptControl_OnInvalidUserInput(this);}};C_PromptControl.prototype._cU3=function(){if(this._cDB1&&this._cDB1.F_PromptControl_OnValueChange){this._cDB1.F_PromptControl_OnValueChange(this);}};C_PromptControl.prototype.F_PromptControl_OnValueChange=function(){this._cU3();};C_PromptControl.F_AddAriaLabelParm=function(_cTM,_cC81){if(G_HAL.M_oLibraries["hal"]["enableAccessibility"]&&_cC81){_cTM.setAttribute("sAriaLabel", _cC81);}};C_PromptControl.F_AddAriaLabelledByParm=function(_cTM,_c1H){if(G_HAL.M_oLibraries["hal"]["enableAccessibility"]&&_c1H){_cTM.setAttribute("idAriaLabelledBy", _c1H);}};C_PromptControl.prototype._cBE=function(){var _cPD1=["color", "font-family", "font-size", "font-weight", "font-style", "text-decoration"];var _c3M1=(this._cWM.getAttribute("style")||"").split(";");var _cQD1="", _cRD1 = "", _cJN1;for(var _c6U1=0; _c6U1<_c3M1.length; _c6U1++){if(_c3M1[_c6U1]){var _cKP1=_c3M1[_c6U1].split(":");if(_cPD1.indexOf(_cKP1[0])!=-1){_cQD1+= _c3M1[_c6U1]+";";}else{_cRD1+= _c3M1[_c6U1]+";";}}}return [_cQD1, _cRD1];};C_PromptControl.prototype.F_UpdateControlStyle=function(_c8Y,_cDT,_cSD1){var _c4M1={};var _c6U1, _cJN1, _cRL1, _cKP1;var _cET=this._cBE();var _cLP1, _c3M1=[_cDT||"", _c8Y.getAttribute("style")||"", _cSD1?_cET[0]:_cET[1]];for(_cLP1=0; _cLP1<_c3M1.length; _cLP1++){_cJN1=_c3M1[_cLP1];if(_cJN1){_cRL1=_cJN1.split(";");for(_c6U1=0; _c6U1<_cRL1.length; _c6U1++){if(_cRL1[_c6U1]){_cKP1=_cRL1[_c6U1].split(":");if(_cKP1.length===2){_c4M1[_cKP1[0]]=_cKP1[1];}}}}}_cJN1="";for(var _cZR1 in _c4M1){_cJN1 += _cZR1+":" + _c4M1[_cZR1] + ";";}if(_cJN1){_c8Y.setAttribute("style", _cJN1);}};C_PromptControl.prototype.F_GetScriptableParameterValues=function(){var _cB31=[];var a=this.F_GetParameterValues();var _cFK1=a.length;for(var i=0;i<_cFK1;i++){_cB31.push(a[i].F_ToScriptableValue());}return _cB31;};C_PromptControl.prototype.F_GetValues=function(_cC31){if(_cC31){if(this.F_SetAllOptions){this.F_SetAllOptions(_cC31);}}return this.F_GetScriptableParameterValues();};C_PromptControl.prototype.F_AddValues=function(_cRL1){debugger;};C_PromptControl.prototype.F_SetValues=function(_cRL1){this.F_ClearValues();this.F_AddValues(_cRL1);};C_PromptControl.prototype.F_ClearValues=function(){this.F_ClearParameterValues();};C_PromptControl.prototype.F_SetValidator=function(fn){this._c231=fn;};C_PromptControl.prototype.F_IsUsedAsPrompt=function(_cD31){return _cD31?_cD31.classList.contains(C_PromptControl.M_sPromptClass):false;};C_PromptControl.F_IsDirectionRtl=function(_cJV1){return(window.getComputedStyle(_cJV1, null).getPropertyValue("direction").toLowerCase()=="rtl");};