I added a mod to add table & border colors and border styles. It was a relatively easy mod, but since I'm not a programmer, I need some guidance.
The changes work fine when creating the table. After saving the document, when I try to edit the table properties, I don't see the OK button. I have attached the editor/dialog/fck_table.html below for reference. I've marked the sections I added.
Help, please.
eztune
approx. line 86
// added from here
// 080726 Set border value
document.getElementById("selborder").value=sBorderStyle;
// 080726 Added background color
if(table.bgColor==undefined) {
document.getElementById('txtBackColor').value = '' ;
} else {
document.getElementById('txtBackColor').value = table.bgColor ;
}
// 080726 Added border color
if(table.borderColor==undefined) {
document.getElementById('txtBorderColor').value = '' ;
} else {
document.getElementById('txtBorderColor').value = table.borderColor ;
}
// to here
added approx. line 143 (after adding previous code)
// added from here
// 080726 Added background color
table.bgColor = document.getElementById('txtBackColor').value ;
// 080726 Added border color
table.borderColor = document.getElementById('txtBorderColor').value ;
// 080726 Added border style
sBorderStyle=document.getElementById("selborder").value;
if (sBorderStyle=='none') {
table.style.border='';
}
else {
table.style.border=sBorderStyle;
}
// to here
added approx. line 203 (after adding previous code)
// added from here
function SelectColor( wich )
{
oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, wich == 'Back' ? SelectBackColor : SelectBorderColor, window ) ;
}
function SelectBackColor( color )
{
if ( color && color.length > 0 )
GetE('txtBackColor').value = color ;
}
function SelectBorderColor( color )
{
if ( color && color.length > 0 )
GetE('txtBorderColor').value = color ;
}
// to here
added approx. line 259 (after adding previous code)
<!-- added from here -->
<tr>
<td><span fckLang="DlgTableBGColor">Background Color</span>:</td>
<td><input id="txtBackColor" type="text" size="10" name="txtBackColor">
<input type="button" fckLang="DlgCellBtnSelect" value="Select..." onClick="SelectColor( 'Back' )"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><span fckLang="DlgTableBorder">Border size</span>:</td>
<td> <INPUT id="txtBorder" type="text" maxLength="2" size="2" value="1" name="txtBorder" onKeyPress="return IsDigit(event);"></td>
</tr>
<tr>
<td>Border Color: </td>
<td>
<input name="txtBorderColor" type="text" id="txtBorderColor" size="10"> <input type="button" fckLang="DlgCellBtnSelect" value="Select..." onClick="SelectColor( 'Border' )">
</td>
</tr>
<tr>
<td>Border Type: </td>
<td>
<select name="selborder" id="selborder">
<option value="none" selected>none</option>
<option value="dotted">dotted</option>
<option value="dashed">dashed</option>
<option value="solid">solid</option>
<option value="double">double</option>
<option value="groove">groove</option>
<option value="ridge">ridge</option>
<option value="inset">inset</option>
<option value="outset">outset</option>
</select>
</td>
</tr>
<!-- to here -->
The changes work fine when creating the table. After saving the document, when I try to edit the table properties, I don't see the OK button. I have attached the editor/dialog/fck_table.html below for reference. I've marked the sections I added.
Help, please.
eztune
approx. line 86
// added from here
// 080726 Set border value
document.getElementById("selborder").value=sBorderStyle;
// 080726 Added background color
if(table.bgColor==undefined) {
document.getElementById('txtBackColor').value = '' ;
} else {
document.getElementById('txtBackColor').value = table.bgColor ;
}
// 080726 Added border color
if(table.borderColor==undefined) {
document.getElementById('txtBorderColor').value = '' ;
} else {
document.getElementById('txtBorderColor').value = table.borderColor ;
}
// to here
added approx. line 143 (after adding previous code)
// added from here
// 080726 Added background color
table.bgColor = document.getElementById('txtBackColor').value ;
// 080726 Added border color
table.borderColor = document.getElementById('txtBorderColor').value ;
// 080726 Added border style
sBorderStyle=document.getElementById("selborder").value;
if (sBorderStyle=='none') {
table.style.border='';
}
else {
table.style.border=sBorderStyle;
}
// to here
added approx. line 203 (after adding previous code)
// added from here
function SelectColor( wich )
{
oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, wich == 'Back' ? SelectBackColor : SelectBorderColor, window ) ;
}
function SelectBackColor( color )
{
if ( color && color.length > 0 )
GetE('txtBackColor').value = color ;
}
function SelectBorderColor( color )
{
if ( color && color.length > 0 )
GetE('txtBorderColor').value = color ;
}
// to here
added approx. line 259 (after adding previous code)
<!-- added from here -->
<tr>
<td><span fckLang="DlgTableBGColor">Background Color</span>:</td>
<td><input id="txtBackColor" type="text" size="10" name="txtBackColor">
<input type="button" fckLang="DlgCellBtnSelect" value="Select..." onClick="SelectColor( 'Back' )"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><span fckLang="DlgTableBorder">Border size</span>:</td>
<td> <INPUT id="txtBorder" type="text" maxLength="2" size="2" value="1" name="txtBorder" onKeyPress="return IsDigit(event);"></td>
</tr>
<tr>
<td>Border Color: </td>
<td>
<input name="txtBorderColor" type="text" id="txtBorderColor" size="10"> <input type="button" fckLang="DlgCellBtnSelect" value="Select..." onClick="SelectColor( 'Border' )">
</td>
</tr>
<tr>
<td>Border Type: </td>
<td>
<select name="selborder" id="selborder">
<option value="none" selected>none</option>
<option value="dotted">dotted</option>
<option value="dashed">dashed</option>
<option value="solid">solid</option>
<option value="double">double</option>
<option value="groove">groove</option>
<option value="ridge">ridge</option>
<option value="inset">inset</option>
<option value="outset">outset</option>
</select>
</td>
</tr>
<!-- to here -->
Re: Table & Border Colors and Border Styles
Window looks like the attached screenshot.
Even though it works like a charm, there is no OK button when editing the table. I need HELP, please!
Attachments: