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_Border._cQ6=["border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color" ];D_Border.F_GetProperties=function(){return this._cF01;};D_Border.F_GetPropertiesToApply=function(){return this._c3C?U_Object.F_Copy(this._c3C):null;};D_Border._cD4=function(_cI51,_cGN1,_cJ51,_cNA1){var _cOA1=_cI51.appendChild(_cI51.ownerDocument.createElement("listItem"));_cOA1.setAttribute("value", _cGN1);_cOA1.setAttribute( "html", '<table role="presentation" cellpadding="0" cellspacing="1" class="clsDialogText" style="table-layout:fixed"><tr style="vertical-align:middle"><td style="border:1px solid black; width:15px; height:15px; background-color:' + _cGN1 + '"> </td><td style="padding-left:3px" HAL_ids="' + _cJ51 + '"></td></tr></table>' );if(_cNA1){_cOA1.setAttribute( "selected", "true" );}};D_Border._c72=function(_cK51){var d=_cK51.ownerDocument;var _cPA1=_cK51.appendChild(d.createElement("listView"));_cPA1.setAttribute( "allowCtrlDeselect", "false" );_cPA1.setAttribute( "hotTracking", "false" );_cPA1.setAttribute( "classPrefix", "clsListItem_outline" );var _cI51=_cPA1.appendChild(d.createElement("listItems"));var _cOA1=_cI51.appendChild(d.createElement("listItem"));_cOA1.setAttribute( "value", "" );_cOA1.setAttribute( "html", '<div style="background-color:#DDDDDD; padding:2px 5px 2px 5px; text-align:center" HAL_ids="IDS_CCHL_PROPVAL_DEFAULT"></div>' );this._cD4( _cI51, "black", "IDS_HAL_COLOR_BLACK", true );this._cD4( _cI51, "silver", "IDS_HAL_COLOR_SILVER" );this._cD4( _cI51, "gray", "IDS_HAL_COLOR_GRAY" );this._cD4( _cI51, "white", "IDS_HAL_COLOR_WHITE" );this._cD4( _cI51, "maroon", "IDS_HAL_COLOR_MAROON" );this._cD4( _cI51, "red", "IDS_HAL_COLOR_RED" );this._cD4( _cI51, "purple", "IDS_HAL_COLOR_PURPLE" );this._cD4( _cI51, "fuchsia", "IDS_HAL_COLOR_FUCHSIA" );this._cD4( _cI51, "green", "IDS_HAL_COLOR_GREEN" );this._cD4( _cI51, "lime", "IDS_HAL_COLOR_LIME" );this._cD4( _cI51, "olive", "IDS_HAL_COLOR_OLIVE" );this._cD4( _cI51, "yellow", "IDS_HAL_COLOR_YELLOW" );this._cD4( _cI51, "navy", "IDS_HAL_COLOR_NAVY" );this._cD4( _cI51, "blue", "IDS_HAL_COLOR_BLUE" );this._cD4( _cI51, "teal", "IDS_HAL_COLOR_TEAL" );this._cD4( _cI51, "aqua", "IDS_HAL_COLOR_AQUA" );_cOA1=_cI51.appendChild(d.createElement("listItem"));_cOA1.setAttribute( "name", "CustomColor" );this._c4C(_cOA1);return _cPA1;};D_Border._c4C=function(_cOA1){if(this._cXU){var _cHN1=G_ResManager.F_GetOptionalString("IDS_HAL_COLOR_"+this._cXU.toUpperCase());_cOA1.setAttribute( "tooltip", G_ResManager.F_GetString( "IDS_CCHL_COLOR_CUSTOM" ) + ( _cHN1?" - " + _cHN1:" - " + this._cXU ) );}else{_cOA1.setAttribute( "tooltip", G_ResManager.F_GetString( "IDS_CCHL_COLOR_CUSTOM" ) );}_cOA1.setAttribute("value", this._cXU);var _cSL=U_HighContrast.F_GetHighContrastImgIfNecessary("hal/images/dotdotdot.gif");_cOA1.setAttribute( "html", '<table role="presentation" cellpadding="0" cellspacing="1" class="clsDialogText" style="table-layout:fixed;width:100%"><tr style="vertical-align:middle"><td style="border:1px solid black; width:15px; height:15px' + ( this._cXU?( "; background-color:" + this._cXU ):"" ) + '"> </td><td style="padding-left:3px" HAL_ids="IDS_CCHL_COLOR_CUSTOM"></td><td style="width:17px; height:17px"><button class="clsDotDotDotPropertyButton" style="width:17px; vertical-align:middle" hideFocus="true" HAL_idsAriaLabel="IDS_CCHL_AC_COLOR_CUSTOM_DOTDOTDOT" onclick="D_Border.F_ChooseCustomColor()"><img src="' + _cSL + '"/></button></td></tr></table>' );};D_Border._c5C=function(){var _cL51=new C_CSSLength(this._c3C["border-width"]);var txt=this.F_GetDlgItem("txtWidth");txt.value=_cL51.F_GetLocalizedValue();txt.onkeypress=U_DOM.F_NumbersOnlyOnKeyPressHandler;txt.onchange=function(e){ U_DOM.F_NumbersOnlyOnChange(e); D_Border._c3(); };this._cYU.F_SelectByValue(_cL51.F_GetUnit()?_cL51.F_GetUnit():"pt");};D_Border._c3=function(){if(this.F_GetDlgItem("txtWidth").value.length>0){var _cGN1=String.F_ParseDecimal(this.F_GetDlgItem("txtWidth").value).F_ToString();if(_cGN1){this._c3C["border-width"]=_cGN1+this._cYU.F_GetValue();}else{this._c3C["border-width"] = "";}}else{this._cF01["border-width"] = "";}this._c5C();};D_Border.F_Dialog_OnInit=function(){this._c9F=this.F_GetDlgItem("divBorderPreview");if(G_BrowserInfo.M_bIsFirefox){this._c9F.parentNode.style.textAlign="-moz-center";}else if(G_BrowserInfo.M_bIsWebKit){this._c9F.parentNode.style.textAlign="-webkit-center";}this._cZU=U_XML.F_CreateDocument();var _cK51=this._cZU.appendChild(this._cZU.createElement("ListViews"));this._cTL=new C_ListView(this.F_GetDlgItem("divBorderColor"), this._c72(_cK51), this);var _cPA1=U_Border.F_InitBorderStyleListView(G_ResManager.F_GetResource('CCHL_border-style'));_cPA1.selectSingleNode( "listItems/listItem[@value='solid']" ).setAttribute( "selected", "true" );this._cUL=new C_ListView(this.F_GetDlgItem("divBorderStyle"), _cPA1, this);var _cPA1=U_Border.F_InitBorderWidthListView(G_ResManager.F_GetResource('CCHL_border-width'));_cPA1.selectSingleNode( "listItems/listItem[@value='1pt']" ).setAttribute( "selected", "true" );this._cVL=new C_ListView(this.F_GetDlgItem("divBorderWidth"), _cPA1, this);this._c3C={};this._c3C["border-style"] = this._cUL.F_GetSelectedListItem().getAttribute( "value" );this._c3C["border-width"] = this._cVL.F_GetSelectedListItem().getAttribute( "value" );this._c3C["border-color"] = this._cTL.F_GetSelectedListItem().getAttribute( "value" );this._cYU=new C_ComboBox(this.F_GetDlgItem("cboWidthUnit"), null, G_ResManager.F_GetResource('CCHL_CSSLengthUnits'), this);this._cYU.F_SelectByValue("pt");this._c5C();this._cXU="";};D_Border.F_Detach=function(){if(this._cTL){this._cTL.F_Detach();delete this._cTL;}if(this._cUL){this._cUL.F_Detach();delete this._cUL;}if(this._cVL){this._cVL.F_Detach();delete this._cVL;}if(this._cYU){this._cYU.F_Detach();delete this._cYU;}};D_Border.F_OnOK=function(){if(!this._cG01){this._cH3();}this.M_fnSuper_OnOK();};D_Border.F_Dialog_OnBeforeVisible=function(){this.F_GetDlgItem( "divBottom" ).style.display = this._cG01?"":"none";U_Button.F_SetLabel( this.F_GetDlgItem( "btnOK" ), G_ResManager.F_GetString( this._cG01?"IDS_HAL_BTN_OK":"IDS_HAL_BTN_CLOSE" ) );this.F_GetDlgItem( "btnApply" ).style.display = this._cG01?"":"none";this.F_GetDlgItem( "btnCancel" ).style.display = this._cG01?"":"none";this.F_UpdatePreview();if(this._c75){this.F_GetDlgItem("divBorderColor").scrollTop=this._c75;}if(this._c85){this.F_GetDlgItem("divBorderStyle").scrollTop=this._c85;}if(this._c95){this.F_GetDlgItem("divBorderWidth").scrollTop=this._c95;}};D_Border.F_Dialog_OnBeforeHide=function(){this._c75=this.F_GetDlgItem("divBorderColor").scrollTop;this._c85=this.F_GetDlgItem("divBorderStyle").scrollTop;this._c95=this.F_GetDlgItem("divBorderWidth").scrollTop;};D_Border.F_Dialog_OnAfterHide=function(){delete this._cF01;};D_Border._cI3=function(_cWL,_c0V){try{this._c9F.style[_cWL]=this._cF01[_c0V];}catch(e){this._c9F.style[_cWL]="";}};D_Border._c82=function(_cWL){var _c0V=_cWL.toLowerCase();if(this._cF01["border-" + _c0V + "-style"]=="none" ){this._c9F.style["border" + _cWL + "Width"] = "1px";this._c9F.style["border" + _cWL + "Color"] = "silver";this._c9F.style["border" + _cWL + "Style"] = "dotted";}else{this._cI3( "border" + _cWL + "Width", "border-" + _c0V + "-width" );this._cI3( "border" + _cWL + "Color", "border-" + _c0V + "-color" );this._cI3( "border" + _cWL + "Style", "border-" + _c0V + "-style" );}};D_Border.F_UpdatePreview=function(){if(!this._cG01){return;}this._c82("Top");this._c82("Bottom");this._c82("Left");this._c82("Right");var _cTF1="";var a=this._cQ6;for(var i=0;i<a.length;i++){if((i % 3)==0){if(i>0){_cTF1+= "\r\n";}var _cIN1=this._cF01[a[i]];var _cAK1=new C_CSSLength(_cIN1);var _cBK1=(_cAK1.F_GetUnit()?(_cAK1.F_GetLocalizedValue()+_cAK1.F_GetUnitLabel()):"");var _cJN1=this._cF01[a[i+1]];_cJN1=_cJN1?G_ResManager.F_GetOptionalString( "IDS_CCHL_BORDERSTYLE_" + _cJN1.toUpperCase() ):"";var _cHN1=this._cF01[a[i+2]];var _cGN1=_cHN1?G_ResManager.F_GetOptionalString( "IDS_HAL_COLOR_" + _cHN1.toUpperCase() ):"";_cHN1=_cGN1?_cGN1:_cHN1;if(_cIN1||_cJN1||_cHN1){_cTF1 +=(_cBK1?_cBK1:"?" ) + " " + ( _cJN1?_cJN1:"?" ) + " " + ( _cHN1?_cHN1:"?" );}else{_cTF1+= "?";}}}this._c9F.title=_cTF1;};D_Border.F_ChooseCustomColor=function(){D_Color.F_Show(this.F_GetDialogWindow(), false, this._cXU, G_ResManager.F_GetString("IDS_CCHL_TITLE_COLOR_CUST_BORDER"), this, false, true);};D_Border.F_Dialog_OnCommit=function(_cCK1){switch(_cCK1){case D_Color:this._cXU=D_Color.F_GetColor();this._c3C["border-color"]=this._cXU;this._c4C(this.F_GetDlgItem("divBorderColor")._cQA1.F_GetSelectedListItem());this.F_GetDlgItem("divBorderColor")._cQA1.F_Draw();this.F_UpdatePreview();}};D_Border.F_ComboBox_OnChange=function(_cRA1){this._c3();};D_Border.F_ListView_OnItemClick=function(_cQA1,_cOA1,_c1V){switch(_cQA1.F_GetId()){case "D_Border_divBorderStyle":if(_cOA1.getAttribute( "value" )=="none" ){this._c3C["border-width"] = "";this._c5C();var _cQA1=this.F_GetDlgItem("divBorderWidth")._cQA1;_cQA1.F_SelectListItem(C_ListView.F_FindListItemByIndex(_cQA1.F_GetListViewNode(), 0));var _cQA1=this.F_GetDlgItem("divBorderColor")._cQA1;_cQA1.F_SelectListItem(C_ListView.F_FindListItemByIndex(_cQA1.F_GetListViewNode(), 0));}this._cR6="-style";this._c3C["border-style"] = _cOA1.getAttribute( "value" );break;case "D_Border_divBorderWidth":this._cR6="-width";this._c3C["border-width"] = _cOA1.getAttribute( "value" );this._c5C();break;case "D_Border_divBorderColor":this._cR6="-color";this._c3C["border-color"] = _cOA1.getAttribute( "value" );break;}setTimeout("D_Border.F_UpdatePreview()", 0);};D_Border.F_ListView_OnItemDblClick=function(_cQA1,_cOA1){switch(_cQA1.F_GetId()){case "D_Border_divBorderColor":if(_cOA1.getAttribute( "name" )&&( _cOA1.getAttribute( "name" )=="CustomColor" ) ){setTimeout("D_Border.F_ChooseCustomColor()", 0);}break;}};D_Border.F_OnMouseDown=function(e,el){var _cUF1=U_DOM.F_GetRelativeOffset(this._c9F, document.body);var _cUS1=_cUF1.top;var _cIQ1=_cUF1.left;var _cKN1=this._c9F.offsetWidth;var _cDK1=this._c9F.offsetHeight;var _cEK1=_cUS1+_cDK1;var _cLN1=_cIQ1+_cKN1;var _cM51=10;if(Math.F_PointInRect(e.y, e.x, _cUS1-(_cM51 / 2), _cIQ1, _cKN1, _cM51)){this._c9Q(e, "border-top");}else if(Math.F_PointInRect(e.y, e.x, _cEK1-(_cM51 / 2), _cIQ1, _cKN1, _cM51)){this._c9Q(e, "border-bottom");}else if(Math.F_PointInRect(e.y, e.x, _cUS1, _cIQ1-(_cM51 / 2), _cM51, _cDK1)){this._c9Q(e, "border-left");}else if(Math.F_PointInRect(e.y, e.x, _cUS1, _cLN1-(_cM51 / 2), _cM51, _cDK1)){this._c9Q(e, "border-right");}setTimeout("D_Border.F_UpdatePreview()", 0);};D_Border._cH3=function(){if(!U_Border.F_CanSeeDoubleBorder( this._c3C["border-width"], this._c3C["border-style"], this._c3C["border-color"] ) ){F_MsgBoxResLater("IDS_MSG_DOUBLE_BORDERS");}};D_Border._c9Q=function(e,_c0V,_cAF){if(!_cAF){this._cH3();}if(!_c0V){for(var s in this._cF01){this._cF01[s]="";}}else if(e.ctrlKey){var _cQA1=this.F_GetDlgItem("divBorderColor")._cQA1;var _cGN1=this._cF01[_c0V+"-color"];var _cOA1=C_ListView.F_FindListItem(_cQA1.F_GetListViewNode(), "value", _cGN1);if(_cGN1&&!_cOA1){var _cOA1=C_ListView.F_FindListItem( _cQA1.F_GetListViewNode(), "name", "CustomColor" );this._cXU=_cGN1;this._c4C(_cOA1);_cQA1.F_Draw();_cQA1.F_SelectListItem(_cOA1);}else if(_cOA1){_cQA1.F_SelectListItem(_cOA1);}var _cQA1=this.F_GetDlgItem("divBorderStyle")._cQA1;var _cGN1=this._cF01[_c0V+"-style"];var _cOA1=C_ListView.F_FindListItem(_cQA1.F_GetListViewNode(), "value", _cGN1);if(_cOA1){_cQA1.F_SelectListItem(_cOA1);}var _cQA1=this.F_GetDlgItem("divBorderWidth")._cQA1;var _cGN1=this._cF01[_c0V+"-width"];var _cL51=new C_CSSLength(_cGN1);var txt=this.F_GetDlgItem("txtWidth");txt.value=_cL51.F_GetLocalizedValue();this._cYU.F_SelectByValue(_cL51.F_GetUnit()?_cL51.F_GetUnit():"pt");var _cOA1=C_ListView.F_FindListItem(_cQA1.F_GetListViewNode(), "value", _cGN1);if(_cOA1){_cQA1.F_SelectListItem(_cOA1);}}else if(e.shiftKey&&this._cR6){this._cF01[_c0V+this._cR6]=this._c3C["border" + this._cR6];}else{this._cF01[_c0V+"-style"] = this._c3C["border-style"];this._cF01[_c0V+"-width"] = this._c3C["border-width"];this._cF01[_c0V+"-color"] = this._c3C["border-color"];}setTimeout("D_Border.F_UpdatePreview()", 0);};D_Border.F_OnKeyDown=function(e){if(e.ctrlKey){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&&s.match(/^border/)){var o=new C_CSSDefinition(s);var a=this._cQ6;for(var i=0;i<a.length;i++){var _cGN1=o.F_GetProperty(a[i]);this._cF01[a[i]]=_cGN1?_cGN1:"";}this.F_UpdatePreview();}break;}}this.M_fnSuper_OnKeyDown(e);};
|