123456 |
- // Licensed Materials - Property of IBM
- // IBM Cognos Products: cchl
- // (C) Copyright IBM Corp. 2003, 2016.
- // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- D_Font._cDI=function(e){ U_DOM.F_NumbersOnlyOnChange(e); D_Font.F_UpdateSample(); };D_Font.F_GetProperties=function(){return this._cF01;};D_Font._cR01=function(_cBG1,_cGN1){var _cQA1=this.F_GetDlgItem("div"+_cBG1)._cQA1;var _cOA1=_cGN1?_cQA1.F_FindListItem("value", _cGN1, true):_cGN1;if(_cOA1){_cQA1.F_SelectListItem(_cOA1);}else{_cQA1.F_SelectByIndex(0);}this.F_GetDlgItem( "txt" + _cBG1 ).value = _cGN1?_cGN1:"";};D_Font._cEI=function(_cBG1,_cGN1){var _cQA1=this.F_GetDlgItem("div"+_cBG1)._cQA1;var _cOA1=_cGN1?_cQA1.F_FindListItem("value", _cGN1, true):null;if(_cOA1){_cQA1.F_SelectListItem(_cOA1);}else{_cQA1.F_SelectByIndex(0);}this.F_GetDlgItem( "txt" + _cBG1 ).value = _cGN1?_cGN1:"";};D_Font._cQ2=function(){if(this._cBC){this._cBC.F_Detach();this._cBC=null;}if(!this._cBC){this._cBC=new C_ListView( this.F_GetDlgItem( "divFontFamily" ), G_ResManager.F_GetResource( "CCHL_font-family" ), this );}var _cI51=this._cBC.F_GetListItemsNode();var d=_cI51.ownerDocument;if(this._cH4&&G_BrowserInfo.M_bIsIE){this._cGQ=this.F_CreateSystemFontFamiliesArray();}if(this._cGQ){var _cFK1=this._cGQ.length;for(var i=0;i<_cFK1;i++){var o=this._cGQ[i];var _cOA1=_cI51.appendChild(d.createElement("listItem"));_cOA1.setAttribute("label", o.M_sLabel);_cOA1.setAttribute("value", o.M_sValue);}}this._cBC.F_Draw();};D_Font.F_Dialog_OnInit=function(){this._cQ2();var _cPA1=G_ResManager.F_GetResource('CCHL_font-size');var nl=_cPA1.selectNodes("listItems/listItem[not(@idsLabel)]");var _cFK1=nl.length;for(var i=0;i<_cFK1;i++){var _cOA1=nl.item(i);var _cAK1=new C_CSSLength(_cOA1.getAttribute("value"));_cOA1.setAttribute("label", _cAK1.F_GetDisplayString());}this._cJQ=new C_ListView(this.F_GetDlgItem("divFontSize"), _cPA1, this);this._cFI=new C_ListView(this.F_GetDlgItem("divFontWeight"), G_ResManager.F_GetResource('CCHL_font-weight'), this);this._c1M=new C_ListView(this.F_GetDlgItem("divFontStyle"), G_ResManager.F_GetResource('CCHL_font-style'), this);this._cS01=new C_ComboBox(this.F_GetDlgItem("cboSizeUnit"), null, G_ResManager.F_GetResource('CCHL_CSSLengthUnits'), this);this._cS01.F_SelectByValue("pt");};D_Font.F_Detach=function(){if(this._cBC){this._cBC.F_Detach();delete this._cBC;}if(this._cJQ){this._cJQ.F_Detach();delete this._cJQ;}if(this._cFI){this._cFI.F_Detach();delete this._cFI;}if(this._c1M){this._c1M.F_Detach();delete this._c1M;}if(this._cS01){this._cS01.F_Detach();delete this._cS01;}};D_Font.F_Dialog_OnBeforeVisible=function(){this.F_SetCheckboxEnabled("chkUnderline", this._c061!==false);this.F_SetCheckboxEnabled("chkOverline", this._cYA1!==false);this.F_SetCheckboxEnabled("chkLineThrough", this._cFV!==false);this.F_GetDlgItem( "tdTextDecoration" ).style.display = this._c88?"none":"";this.F_GetDlgItem( "fsPreview" ).style.width = this._c88?"413px":"315px";this.F_GetDlgItem( "divColor" ).style.display = this._c161?"none":"";this._cZA1=this.F_GetDlgItem("divSample");this._cEI( "FontFamily", this._cF01["font-family"] );this._cR01( "FontSize", this._cF01["font-size"] );var _cL51=new C_CSSLength(this._cF01["font-size"]);var txt=this.F_GetDlgItem("txtFontSize");txt.value=_cL51.F_GetLocalizedValue();this._cS01.F_SelectByValue(_cL51.F_GetUnit()?_cL51.F_GetUnit():"pt");if(this._c361&&this._c361.length){var _c0B1=G_ResManager.F_GetResource('CCHL_CSSLengthUnits');var _c461=_c0B1.selectNodes("listItems/*");var _cGI=G_ResManager.F_GetResource('CCHL_CSSLengthUnits').cloneNode(true);U_XML.F_RemoveNodes(_cGI, "listItems/*");var _cI51=_cGI.selectSingleNode("listItems");for(var i=0; i<_c461.length; i++){var _cMQ1=_c461.item(i).getAttribute("value");if(this._c361.indexOf(_cMQ1)!=-1){_cI51.appendChild(_c461.item(i).cloneNode(true));} }this._cS01.F_ReplaceListView(_cGI);}else{this._cS01.F_ReplaceListView(G_ResManager.F_GetResource('CCHL_CSSLengthUnits'));}txt.onkeypress=U_DOM.F_NumbersOnlyOnKeyPressHandler;txt.onchange=this._cDI;this._cR01( "FontWeight", this._cF01["font-weight"] );this._cR01( "FontStyle", this._cF01["font-style"] );var _cHI=this._cF01["text-decoration"];if(_cHI===undefined){U_DOM.F_SetTextEnabled(this.F_GetDlgItem("fsTextDecoration"), false);}_cHI=_cHI?_cHI.toLowerCase():"";this.F_GetDlgItem( "chkUnderline" ).checked = ( _cHI.indexOf( "underline" ) != -1 );this.F_GetDlgItem( "chkOverline" ).checked = ( _cHI.indexOf( "overline" ) != -1 );this.F_GetDlgItem( "chkLineThrough" ).checked = ( _cHI.indexOf( "line-through" ) != -1 );this.F_UpdateSample();this.F_GetDlgItem( "btnApply" ).style.display = this._cCF?"":"none";};D_Font.F_Dialog_OnAfterHide=function(){this._cF01=null;delete this._c061;delete this._cYA1;delete this._cFV;delete this._c88;delete this._c161;delete this._c361;};D_Font.F_UpdateSample=function(){var _cT01=this.F_GetDlgItem("txtFontFamily").value;if(_cT01.search(/[\s\(\)]/)!=-1){if ((_cT01.charAt( 0 )!="'" )||( _cT01.charAt( _cT01.length - 1 ) != "'" ) ){_cT01="'" + _cT01 + "'";}}this._cF01["font-family"]=_cT01;var _c1B1=this.F_GetDlgItem("txtFontSize").value;this._cF01["font-size"] = _c1B1?( new C_Decimal( _c1B1 ) ).F_ToString() + this._cS01.F_GetValue():"";this._cF01["font-weight"] = this.F_GetDlgItem( "txtFontWeight" ).value;this._cF01["font-style"] = this.F_GetDlgItem( "txtFontStyle" ).value;var a=[];if(this.F_GetDlgItem("chkUnderline").checked){a.push("underline");}if(this.F_GetDlgItem("chkOverline").checked){a.push("overline");}if(this.F_GetDlgItem("chkLineThrough").checked){a.push("line-through");}if(this._cF01["text-decoration"]!==undefined){this._cF01["text-decoration"] = a.join( " " );}this._cZA1.innerText=_cT01?_cT01.replace( /['"]/g, "" ):"AaBbCcYyZz";this._cCC( "color", "color", null );U_DOM.F_SetColorButtonColor( this.F_GetDlgItem( "btnColor" ), this._cF01["color"] );this._cCC( "fontFamily", "font-family", "txtFontFamily" );this._cCC( "fontSize", "font-size", "txtFontSize" );this._cCC( "fontWeight", "font-weight" );this._cCC( "fontStyle", "font-style" );this._cCC( "textDecoration", "text-decoration" );};D_Font._cCC=function(_c2M,_cGV,_cBG1){try{var _cGN1=this._cF01[_cGV];this._cZA1.style[_c2M]=_cGN1?_cGN1:"";if(_cBG1){this.F_GetDlgItem(_cBG1).style.color="";}}catch(e){if(_cBG1){this.F_GetDlgItem(_cBG1).style.color="red";this._cZA1.style[_c2M]="";}}};D_Font.F_ChooseColor=function(){if(this._cF01["transparency"]!==undefined){D_Color.F_Show( this.F_GetDialogWindow(), false, this._cF01["color"]?this._cF01["color"]:"", G_ResManager.F_GetString( "IDS_CCHL_TITLE_FONT_COLOR" ), this, false, true, this._cF01["transparency"], true );}else{D_Color.F_Show( this.F_GetDialogWindow(), false, this._cF01["color"]?this._cF01["color"]:"", G_ResManager.F_GetString( "IDS_CCHL_TITLE_FONT_COLOR" ), this, false, false );}};D_Font.F_Dialog_OnCommit=function(_cCK1){switch(_cCK1){case D_Color:this._cF01["color"]=D_Color.F_GetColor();if(this._cF01["transparency"]!==undefined){this._cF01["transparency"]=D_Color.F_GetTransparency();}this.F_UpdateSample();}};D_Font.F_ComboBox_OnChange=function(_cRA1){this.F_UpdateSample();};D_Font.F_ListView_OnItemClick=function(_cQA1,_cOA1,_c1V){var _cGN1=_cOA1.getAttribute("value");if(_cGN1==null){_cGN1=_cOA1.getAttribute("label");}switch(_cQA1.F_GetId()){case "D_Font_divFontFamily":this.F_GetDlgItem("txtFontFamily").value=_cGN1;break;case "D_Font_divFontSize":var _cL51=new C_CSSLength(_cGN1);this.F_GetDlgItem("txtFontSize").value=_cL51.F_GetValue();this._cS01.F_SelectByValue(_cL51.F_GetUnit()?_cL51.F_GetUnit():"pt");break;case "D_Font_divFontWeight":this.F_GetDlgItem("txtFontWeight").value=_cGN1;break;case "D_Font_divFontStyle":this.F_GetDlgItem("txtFontStyle").value=_cGN1;break;}setTimeout("D_Font.F_UpdateSample()", 0);};D_Font.F_OnKeyDown=function(e){if(e.ctrlKey&&( e.target.nodeName!="INPUT" )&&( e.target.type != "text" ) ){switch(e.keyCode){case "C".charCodeAt(0):case "X".charCodeAt(0):var o=new C_CSSDefinition("");o.F_SetProperties(this.F_GetProperties());U_Clipboard.F_SetText(o.toString());break;case "V".charCodeAt(0):var s=U_Clipboard.F_GetText();if(s&&this.M_aSubFontPropertiesNames){var o=new C_CSSDefinition(s);var a=this.M_aSubFontPropertiesNames.concat("color");for(var i=0;i<a.length;i++){var _cGN1=o.F_GetProperty(a[i]);this._cF01[a[i]]=_cGN1?_cGN1:"";}this.F_Dialog_OnBeforeVisible();}break;}}this.M_fnSuper_OnKeyDown(e);};
|