_lce.js 12 KB

123456
  1. // Licensed Materials - Property of IBM
  2. // IBM Cognos Products: rs
  3. // (C) Copyright IBM Corp. 2003, 2022.
  4. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. var _lce=new _lcm("_lce");_lce._jgn=function(_8rm){this._0jm=_8rm;this._vba=null;this._6ue=true;this._4le();};_lce._src=function(){this._v3i=new _jgk(this._2oh("cboDirection"), _frh._53g("Direction"), null, this);this._3sk=new _pgk(this._2oh("divPattern"), _frh._53g("Pattern"), this);this._s2n=new _lfn(this._2oh("deckMain"));this._wgd="black";this._pv7="black";this._cfa="white";this._ov7="black";this._mv7="white";this._y7a=["#333399", "#CC9933", "#993333", "#CCCC00", "#336633", "#6699CC", "#FF0033", "#FF6633", "#CC0099", "#66CC00", "#0033FF", "#6666FF", "#9900FF", "#339966", "#FFCC00", "#6633CC", "#999999"];};_lce._fdm=function(){if(this._v3i){this._v3i._fdm();delete this._v3i;}if(this._3sk){this._3sk._fdm();delete this._3sk;}if(this._s2n){this._s2n._fdm();delete this._s2n;}};_lce._5z2=function(){this._prb=_frh._53g("NamedChartPalettes").selectSingleNode( "*" );this._oze=new _ozf();this._y2n=new _pgk(this._2oh("divList"), _frh._53g("ChartPalette"), this);this._3k7(this._0jm?this._0jm.selectSingleNode("chartPalette"):this._vba);this._jse();this._u0a();this._y2n._gwc(0);};_lce._o46=function(){this._y2n._fdm();delete this._y2n;delete this._0jm;delete this._vba;delete this._phn;delete this._oze;delete this._prb;if(this._hfd){this._hfd._fdm();delete this._hfd;}};_lce._bgn=function(){if(this._6ue){_erh._ybb();_8qn._cqh(this._0jm, "chartPaletteRef");_8qn._cqh(this._0jm, "chartPalette");if(!this._nr8()){var _33m=_erh._h56(this._0jm, "chartPalette");this._2o8(_33m);}_erh._iee();}else{this._phn(this._72d());}this._3le();};_lce._pe4=function(_a6k,_mzj,_zdf){if(_a6k._ezm()=="_lce_divList"){this._xth(_mzj.getAttribute("type"));this._jse();this._ys7=_mzj;}else if(_a6k._ezm()=="_lce_divPattern"){var _dvd=this._y2n._885();_dvd.setAttribute("patternType", _mzj.getAttribute("value"));this._86a(_dvd);this._u0a();}};_lce._oi2=function(_a6k,_mzj){if(_mzj.getAttribute("type")=="color"){setTimeout("_lce._y0g('COLOR')", 0);}};_lce._g67=function(_35k,_a58){if(_35k._ezm()=="_lce_cboDirection"){var _dvd=this._y2n._885();_dvd.setAttribute("direction", _a58.getAttribute("value"));this._86a(_dvd);this._u0a();}};_lce._y0g=function(_pvm){this._jv7=_pvm;var _y1k=this._y2n._885();_8fm._jgn( "cchl/dialogs/_1zm", this._xp9(), false, _y1k.getAttribute(_pvm), _frh._c6j( "IDS_LBL_" + _pvm ), this );};_lce._io9=function(_e5m){switch(_e5m._b2g()){case "_1zm":var _y1k=this._y2n._885();var _pvm=_e5m._6ik();if(_pvm==""){switch(this._jv7){case "COLOR":_pvm=this._wgd;break;case "TOCOLOR":_pvm=this._cfa;break;case "FROMCOLOR":_pvm=this._pv7;break;case "FORECOLOR":_pvm=this._ov7;break;case "BACKCOLOR":_pvm=this._mv7;break;}}_y1k.setAttribute(this._jv7, _pvm);this._86a(_y1k);this._jse();this._u0a();}};_lce._0qh=function(){var _ymn=_0jl._47b("_lce_btnNew", false);if(!this._hfd){this._hfd=new _3ce(this._53g("MenuPopupSetChartPalette"), this);}this._hfd._pxc("mnuPalettePopup", _ymn.left, _ymn.top);};_lce._1qh=function(_rxi){var _ini=this._y2n._5g8();var _a58=this._y2n._885();var _mzj=_ini.insertBefore(_ini.ownerDocument.createElement("listItem"), _a58?_a58.nextSibling:null);_mzj.setAttribute("type", _rxi);switch(_rxi){case "color":_mzj.setAttribute("COLOR", this._wgd);_mzj.setAttribute("selected", "true");break;case "gradient":_mzj.setAttribute("FROMCOLOR", this._pv7);_mzj.setAttribute("TOCOLOR", this._cfa);_mzj.setAttribute("direction", "left");_mzj.setAttribute("selected", "true");break;case "pattern":_mzj.setAttribute("FORECOLOR", this._ov7);_mzj.setAttribute("BACKCOLOR", this._mv7);_mzj.setAttribute("patternType", "horizontal");_mzj.setAttribute("selected", "true");}this._86a(_mzj);this._xth(_mzj.getAttribute("type"));this._jse();this._u0a();this._y2n._uab(_mzj);};_lce._ovc=function(){var _y1k=this._y2n._885();if(_y1k){if(_y1k.nextSibling){_y1k.nextSibling.setAttribute("selected","true");}else if(_y1k.previousSibling){_y1k.previousSibling.setAttribute("selected","true");}_y1k.parentNode.removeChild(_y1k);var _mzj=this._y2n._885();if(_mzj){this._xth(_mzj.getAttribute("type"));}this._jse();this._u0a();}};_lce._d7j=function(){var _y1k=this._y2n._885();var _72m=_y1k.previousSibling;_y1k.parentNode.insertBefore(_y1k.parentNode.removeChild(_y1k), _72m);this._u0a();this._8lb();this._y2n._6sc(_y1k);};_lce._q4g=function(){var _y1k=this._y2n._885();var _72m=_y1k.nextSibling;_y1k.parentNode.insertBefore(_y1k.parentNode.removeChild(_y1k), _72m.nextSibling);this._u0a();this._8lb();this._y2n._6sc(_y1k);};_lce._a7j=function(e){if(e.ctrlKey){switch(e.keyCode){case "X".charCodeAt(0):this._mhe();break;case "C".charCodeAt(0):this._nvc();break;case "V".charCodeAt(0):this._z9b();break;}}else if(e.keyCode==_4qn._qrh){this._ovc();}this._1f7(e);};_lce._72d=function(){var n=_erh._cnh("chartPalette");this._2o8(n);return n;};_lce._nvc=function(){var n=this._72d();_dth._2k2(n);_4aj._3bb([n]);};_lce._mhe=function(){this._nvc();this._y2n._bzm();this._jse();this._u0a();};_lce._z9b=function(){var _rlm=_4aj._z6b();if(_rlm&&_rlm[0]&&_rlm[0].nodeName=="chartPalette"){this._ml5(_rlm[0]);}};_lce._0a5=function(){if(!this._324){var _yua=this._prb.selectNodes("namedChartPalette[chartPalette][not(.//*[starts-with(local-name(), 'v2_')])]");var _ozj=_frh._53g("EmptyList");_ozj.setAttribute("smallIconWidth", "48px");var _ini=_ozj.selectSingleNode("listItems");var d=_ozj.ownerDocument;for(var i=0; i<_yua.length; i++){var n=_yua.item(i);var _mzj=_ini.appendChild(d.createElement("listItem"));_mzj.setAttribute( "value", n.getAttribute( "id" ) );_8qn._9rc(_mzj, n, "idsLabel");_8qn._9rc(_mzj, n, "label");_8qn._9rc(_mzj, n, "idsTooltip");_8qn._9rc(_mzj, n, "tooltip");_8qn._9rc(_mzj, n, "smallIcon");}this._324=_ozj;}_u0n._2a6(this, this._2oh("btnNamed"), "chartPalette", null, this._324, NaN, this._2oh("divList").offsetWidth * 1.7);};_lce._xm=function(_xgc,_5en,_uxm){var _uvd=this._prb.selectSingleNode("namedChartPalette[@id=" + _cgm._zxc( _uxm ) + "]/chartPalette");this._ml5(_uvd);};_lce._3wc=function(e){if(e.keyCode==_4qn._qrh){e.stopPropagation();}};_lce._5ab=function(e){switch(e.keyCode){case _4qn._x8j:_4qn._w0g(e);this._2oh("btnOK").focus();break;default:_4qn._yo3(e, false, 'decimal');}};_lce._86a=function(_mzj){var _b6e="width: 100%";switch(_mzj.getAttribute("type")){case "color":var _pvm=_mzj.getAttribute("COLOR");if(!_pvm){_pvm="transparent";}_mzj.setAttribute( "html", '<table role="presentation" cellpadding="0" cellspacing="2" class="clsDialogText" style="table-layout:fixed;' + _b6e + '"><tr><td style="border:1px solid var(--text-03); height:17px; background-color:' + _pvm + '">&nbsp;</td></tr></table>' );break;case "gradient":var _byi=_mzj.getAttribute("FROMCOLOR");var _6hl=_mzj.getAttribute("TOCOLOR");if(_byi&&_6hl){var _5dn=this._oze._dq9(_byi, _6hl, _mzj.getAttribute("direction"));_mzj.setAttribute("html", _5dn);}else{var _pvm="transparent";if(_byi){_pvm=_byi;}else if(_6hl){_pvm=_6hl;}_mzj.setAttribute( "html", '<table role="presentation" cellpadding="0" cellspacing="2" class="clsDialogText" style="table-layout:fixed;' + _b6e + '"><tr><td style="border:1px solid var(--text-03); height:17px; background-color:' + _pvm + '">&nbsp;</td></tr></table>' );}break;case "pattern":var _7yi=_mzj.getAttribute("FORECOLOR");if(!_7yi){_7yi="transparent";}var _2wi=_mzj.getAttribute("BACKCOLOR");if(!_2wi){_2wi="transparent";}_mzj.setAttribute( "html", '<div style="height:16px; background-image:' + _q0d._ub4( _mzj.getAttribute( "patternType"), _7yi, _2wi ) + '"></div>' );break;}this._vp4(_mzj);};_lce._jse=function(){var _y1k=this._y2n._885();if(_y1k){this._2oh("rightside").style.visibility = "inherit";switch(_y1k.getAttribute("type")){case "color":_u0n._2b5(this._2oh("btnColor"), _y1k.getAttribute("COLOR"));break;case "gradient":_u0n._2b5(this._2oh("btnToColor"), _y1k.getAttribute("TOCOLOR"));_u0n._2b5(this._2oh("btnFromColor"), _y1k.getAttribute("FROMCOLOR"));this._v3i._hwc(_y1k.getAttribute("direction"));break;case "pattern":_u0n._2b5(this._2oh("btnForeColor"), _y1k.getAttribute("FORECOLOR"));_u0n._2b5(this._2oh("btnBackColor"), _y1k.getAttribute("BACKCOLOR"));this._3sk._hwc(_y1k.getAttribute("patternType"));this._v0a();}}else{if(this._2oh("rightside")){this._2oh("rightside").style.visibility = "hidden";}}this._8lb();};_lce._8lb=function(){var _y1k=this._y2n._885();this._pj8("btnDelete", _y1k);this._pj8("btnUp", _y1k&&_y1k.previousSibling);this._pj8("btnDown", _y1k&&_y1k.nextSibling);};_lce._xth=function(_ncn){switch(_ncn){case "gradient":this._s2n._ujk(0);break;case "pattern":this._s2n._ujk(1);break;case "color":this._s2n._ujk(2);break;}};_lce._nr8=function(){var _0f9=this._y2n._tfe();if(_0f9.length==this._y7a.length){for(var i=0; i<this._y7a.length; i++){if (_0f9.item( i ).getAttribute("type") != "color"||!_0f9.item( i ).getAttribute("COLOR")||_0f9.item( i ).getAttribute("COLOR") != this._y7a[i]){return false;}}return true;}return false;};_lce._v0a=function(){var _y1k=this._y2n._885();var _7yi=_y1k.getAttribute("FORECOLOR");var _2wi=_y1k.getAttribute("BACKCOLOR");var _m9h=this._3sk._tfe();for(var i=0; i<_m9h.length; i++){var _mzj=_m9h.item(i);_mzj.setAttribute( "html", '<div style="height:16px; width:100%; background-image:' + _q0d._ub4( _mzj.getAttribute( "value" ), _7yi, _2wi ) + '"></div>' );}this._3sk._wfn();};_lce._u0a=function(){this._y2n._wfn();this._oze._3fm();};_lce._2o8=function(_33m){var _0f9=this._y2n._tfe();for(var i=0; i<_0f9.length; i++){var _l6l=_0f9.item(i);switch(_l6l.getAttribute("type")){case "color":var _crm=_erh._u0g(_33m, "chartColor");if(_l6l.getAttribute("COLOR")){_crm.setAttribute("value", _l6l.getAttribute("COLOR"));}else{_crm.setAttribute("value", this._wgd);}break;case "gradient":var _syj=_erh._u0g(_33m, "chartGradient");_syj.setAttribute("direction", _l6l.getAttribute("direction"));if(_l6l.getAttribute("FROMCOLOR")){_syj.setAttribute("fromColor", _l6l.getAttribute("FROMCOLOR"));}else{_syj.setAttribute("fromColor", this._pv7);}if(_l6l.getAttribute("TOCOLOR")){_syj.setAttribute("toColor", _l6l.getAttribute("TOCOLOR"));}else{_syj.setAttribute("toColor", this._cfa);}break;case "pattern":var _n6l=_erh._u0g(_33m, "chartPattern");_n6l.setAttribute("patternType", _l6l.getAttribute("patternType"));if(_l6l.getAttribute("FORECOLOR")){_n6l.setAttribute("foregroundColor", _l6l.getAttribute("FORECOLOR"));}else{_n6l.setAttribute("foregroundColor", this._ov7);}if(_l6l.getAttribute("BACKCOLOR")){_n6l.setAttribute("backgroundColor", _l6l.getAttribute("BACKCOLOR"));}else{_n6l.setAttribute("backgroundColor", this._mv7);}}}if(_33m.selectNodes("*").length==0&&_33m.parentNode){_33m.parentNode.removeChild(_33m);}};_lce._ml5=function(_l6l){this._3k7(_l6l);this._jse();this._u0a();this._y2n._gwc(0);};_lce._3k7=function(_l6l){this._y2n._bzm();var _v9f=true;if(_l6l){var _n3k=_l6l.selectNodes("*");for(var i=0;i<_n3k.length;++i){_v9f=false;var _v1m=_n3k.item(i);var _mzj=this._y2n._767();switch(_v1m.nodeName){case "chartColor":_mzj.setAttribute("type", "color");_mzj.setAttribute("COLOR", _v1m.getAttribute("value"));break;case "chartGradient":_mzj.setAttribute("type", "gradient");_mzj.setAttribute("direction", _v1m.getAttribute("direction"));_mzj.setAttribute("FROMCOLOR", _v1m.getAttribute("fromColor"));_mzj.setAttribute("TOCOLOR", _v1m.getAttribute("toColor"));break;case "chartPattern":_mzj.setAttribute("type", "pattern");_mzj.setAttribute("patternType", _v1m.getAttribute("patternType"));_mzj.setAttribute("FORECOLOR", _v1m.getAttribute("foregroundColor"));_mzj.setAttribute("BACKCOLOR", _v1m.getAttribute("backgroundColor"));}this._86a(_mzj);}}if(_v9f){for(var i=0;i<this._y7a.length;i++){var _mzj=this._y2n._767();_mzj.setAttribute("type", "color");_mzj.setAttribute("COLOR", this._y7a[i]);this._86a(_mzj);}}};_lce._aw1=function(_ebl,_5en,_mzj){var _uxm=_ebl.value;var _uyl=_cgm._6qh(_uxm);if(isNaN(_uyl)){_67j("IDS_HAL_ERR_INVALID_NUMBER");_ebl.value=_8gm._fd7(_mzj.getAttribute(_5en));return false;}if(_uyl<0||_uyl>100){_67j("IDS_ERR_BAD_PERCENT");_ebl.value=_8gm._fd7(_mzj.getAttribute(_5en));return false;}_ebl.value=_8gm._fd7(_uyl);_mzj.setAttribute(_5en, _uyl.toString());return true;};_lce._vp4=function(_mzj){if(!_zpn._qsh["hal"]["enableAccessibility"]){return;}var _yvi;switch(_mzj.getAttribute("type")){case "color":_yvi=_4qn._087(_mzj.getAttribute("COLOR"));break;case "gradient":_yvi=_u0n._z41(_mzj);break;case "pattern":_yvi=_u0n._7e1(_mzj);break;}if(_yvi){_mzj.setAttribute("sAriaLabel", _yvi);}};