Zor
12-28-2002, 05:41 PM
Ok, i try to explain to problem.
I have an IFRAME named "iEdit" and I have a div-field named="palette" which is hidden first. It is generated by PHP and shows a palette. After clicking on the TextColorButton I make the div-field visible.
IFRAME:
<iframe name="iEdit" style="width:500px; height:300px"></iframe>
div-Field:
<div z-Index=5 id="palette" style="position:absolute; visibility:hidden; width:0px; height:0px; top: 20px; left: 160px;">
<table border="0" cellpadding="5" cellspacing="5" bgcolor="#D6D3CE">
<tr>
<?php
$hex = array(0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F");
$i=0;
$j=0;
$k=0;
foreach ($hex as $val1)
foreach ($hex as $val2)
foreach ($hex as $val3)
if (eregi("[00|44|88|BB|FF]", $val1))
if (eregi("[00|44|88|BB|FF]", $val2))
if (eregi("[00|44|88|BB|FF]", $val3)) {
if ($i%8==0)
echo "</tr><tr>";
$color = "$val1$val1$val2$val2$val3$val3";
echo "<td bgcolor=\"$color\" style=\"width:10; height:10\" onclick=\"doTextColor('$color')\"></td>";
$i++;
}
?>
</tr>
</table>
</div>
Function to make it visible:
function ShowColorPalette() {
document.all.palette.style.visibility = 'visible';
}
I see my palette. When I click on a Color-Button the following function will be called:
function doTextColor(farbe) {
iEdit.document.execCommand('ForeColor', false, 'farbe');
}
Could it be that my IFRAME-Field has no selection after popping up the palette-div-field? How can I fix it? Please help me it confuses me. There has to be a solution...
Oh and by the way, the value farbe does exist in doTextColor. I already tested it with an alert-box. So how da ....... can i change the Text- or Backgroundcolor with the help of this cool palette-window. I dont want to make a prompt-field, because the editor has to be as easy as it can be...
I have an IFRAME named "iEdit" and I have a div-field named="palette" which is hidden first. It is generated by PHP and shows a palette. After clicking on the TextColorButton I make the div-field visible.
IFRAME:
<iframe name="iEdit" style="width:500px; height:300px"></iframe>
div-Field:
<div z-Index=5 id="palette" style="position:absolute; visibility:hidden; width:0px; height:0px; top: 20px; left: 160px;">
<table border="0" cellpadding="5" cellspacing="5" bgcolor="#D6D3CE">
<tr>
<?php
$hex = array(0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F");
$i=0;
$j=0;
$k=0;
foreach ($hex as $val1)
foreach ($hex as $val2)
foreach ($hex as $val3)
if (eregi("[00|44|88|BB|FF]", $val1))
if (eregi("[00|44|88|BB|FF]", $val2))
if (eregi("[00|44|88|BB|FF]", $val3)) {
if ($i%8==0)
echo "</tr><tr>";
$color = "$val1$val1$val2$val2$val3$val3";
echo "<td bgcolor=\"$color\" style=\"width:10; height:10\" onclick=\"doTextColor('$color')\"></td>";
$i++;
}
?>
</tr>
</table>
</div>
Function to make it visible:
function ShowColorPalette() {
document.all.palette.style.visibility = 'visible';
}
I see my palette. When I click on a Color-Button the following function will be called:
function doTextColor(farbe) {
iEdit.document.execCommand('ForeColor', false, 'farbe');
}
Could it be that my IFRAME-Field has no selection after popping up the palette-div-field? How can I fix it? Please help me it confuses me. There has to be a solution...
Oh and by the way, the value farbe does exist in doTextColor. I already tested it with an alert-box. So how da ....... can i change the Text- or Backgroundcolor with the help of this cool palette-window. I dont want to make a prompt-field, because the editor has to be as easy as it can be...