Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Community Cafe (http://www.bvlist.com/forumdisplay.php?f=18)
-   -   Color pallette (http://www.bvlist.com/showthread.php?t=2826)

LANDSER 14th June 2009 19:17

Color pallette
 
I want to ad this option in forum (this option is from phpbb3.0.4)
PHP Code:

 Color pallette
*/
function 
colorPalette(dirwidthheight)
{
    var 
000;
    var 
numberList = new Array(6);
    var 
color '';

    
numberList[0] = '00';
    
numberList[1] = '40';
    
numberList[2] = '80';
    
numberList[3] = 'BF';
    
numberList[4] = 'FF';

    
document.writeln('<table cellspacing="1" cellpadding="0" border="0">');

    for (
05r++)
    {
        if (
dir == 'h')
        {
            
document.writeln('<tr>');
        }

        for (
05g++)
        {
            if (
dir == 'v')
            {
                
document.writeln('<tr>');
            }
            
            for (
05b++)
            {
                
color String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
                
document.write('<td bgcolor="#' color '">');
                
document.write('<a href="#" onclick="bbfontstyle(\'[color="##39  color  #39"]\', \'[/color]\'); return false;" onmouseover="helpline(\'s\');"  onmouseout="helpline(\'tip\');"><img src="http://bvlist.com/images/spacer.gif" width="' width '" height="' height '" alt="#' color '" title="#' color '" /></a>');
                
document.writeln('</td>');
            }

            if (
dir == 'v')
            {
                
document.writeln('</tr>');
            }
        }

        if (
dir == 'h')
        {
            
document.writeln('</tr>');
        }
    }
    
document.writeln('</table>');
}


/** 

hire is the problem:
PHP Code:

<table class="type2" border="0" cellpadding="0" cellspacing="1">

<
tbody><tr>

<
td bgcolor="#000000"><img src="images1/spacer.gif" alt="#000000" title="#000000" height="6" width="7" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');" /></td>

<
td bgcolor="#000040"><img src="images1/spacer.gif" alt="#000040" title="#000040" height="6" width="7" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');" /></td>

<
td bgcolor="#000080"><img src="images1/spacer.gif" alt="#000080" title="#000080" height="6" width="7" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');" /></td>

<
td bgcolor="#0000bf"><img src="images1/spacer.gif" alt="#0000BF" title="#0000BF" height="6" width="7" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');" /></td>

<
td bgcolor="#0000ff"><img src="images1/spacer.gif" alt="#0000FF" title="#0000FF" height="6" width="7" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');" /></td>

</
tr>
<
tr>
<
td bgcolor="#004000"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#004000" title="#004000" height="6" width="7"></a></td>
<
td bgcolor="#004040"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#004040" title="#004040" height="6" width="7"></a></td>
<
td bgcolor="#004080"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#004080" title="#004080" height="6" width="7"></a></td>
<
td bgcolor="#0040bf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#0040BF" title="#0040BF" height="6" width="7"></a></td>
<
td bgcolor="#0040ff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#0040FF" title="#0040FF" height="6" width="7"></a></td>
</
tr>

<
tr>
<
td bgcolor="#008000"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#008000" title="#008000" height="6" width="7"></a></td>
<
td bgcolor="#008040"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#008040" title="#008040" height="6" width="7"></a></td>
<
td bgcolor="#008080"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#008080" title="#008080" height="6" width="7"></a></td>
<
td bgcolor="#0080bf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#0080BF" title="#0080BF" height="6" width="7"></a></td>
<
td bgcolor="#0080ff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#0080FF" title="#0080FF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#00bf00"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#00BF00" title="#00BF00" height="6" width="7"></a></td>
<
td bgcolor="#00bf40"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#00BF40" title="#00BF40" height="6" width="7"></a></td>
<
td bgcolor="#00bf80"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#00BF80" title="#00BF80" height="6" width="7"></a></td>
<
td bgcolor="#00bfbf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#00BFBF" title="#00BFBF" height="6" width="7"></a></td>
<
td bgcolor="#00bfff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#00BFFF" title="#00BFFF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#00ff00"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#00FF00" title="#00FF00" height="6" width="7"></a></td>
<
td bgcolor="#00ff40"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#00FF40" title="#00FF40" height="6" width="7"></a></td>

<
td bgcolor="#00ff80"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#00FF80" title="#00FF80" height="6" width="7"></a></td>
<
td bgcolor="#00ffbf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#00FFBF" title="#00FFBF" height="6" width="7"></a></td>
<
td bgcolor="#00ffff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#00FFFF" title="#00FFFF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#400000"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#400000" title="#400000" height="6" width="7"></a></td>
<
td bgcolor="#400040"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#400040" title="#400040" height="6" width="7"></a></td>
<
td bgcolor="#400080"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#400080" title="#400080" height="6" width="7"></a></td>
<
td bgcolor="#4000bf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#4000BF" title="#4000BF" height="6" width="7"></a></td>
<
td bgcolor="#4000ff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#4000FF" title="#4000FF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#404000"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#404000" title="#404000" height="6" width="7"></a></td>
<
td bgcolor="#404040"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#404040" title="#404040" height="6" width="7"></a></td>
<
td bgcolor="#404080"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#404080" title="#404080" height="6" width="7"></a></td>
<
td bgcolor="#4040bf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#4040BF" title="#4040BF" height="6" width="7"></a></td>
<
td bgcolor="#4040ff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#4040FF" title="#4040FF" height="6" width="7"></a></td>

</
tr>
<
tr>
<
td bgcolor="#408000"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#408000" title="#408000" height="6" width="7"></a></td>
<
td bgcolor="#408040"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#408040" title="#408040" height="6" width="7"></a></td>
<
td bgcolor="#408080"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#408080" title="#408080" height="6" width="7"></a></td>
<
td bgcolor="#4080bf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#4080BF" title="#4080BF" height="6" width="7"></a></td>
<
td bgcolor="#4080ff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#4080FF" title="#4080FF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#40bf00"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#40BF00" title="#40BF00" height="6" width="7"></a></td>
<
td bgcolor="#40bf40"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#40BF40" title="#40BF40" height="6" width="7"></a></td>
<
td bgcolor="#40bf80"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#40BF80" title="#40BF80" height="6" width="7"></a></td>
<
td bgcolor="#40bfbf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#40BFBF" title="#40BFBF" height="6" width="7"></a></td>
<
td bgcolor="#40bfff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#40BFFF" title="#40BFFF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#40ff00"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#40FF00" title="#40FF00" height="6" width="7"></a></td>

<
td bgcolor="#40ff40"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#40FF40" title="#40FF40" height="6" width="7"></a></td>
<
td bgcolor="#40ff80"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#40FF80" title="#40FF80" height="6" width="7"></a></td>
<
td bgcolor="#40ffbf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#40FFBF" title="#40FFBF" height="6" width="7"></a></td>
<
td bgcolor="#40ffff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#40FFFF" title="#40FFFF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#800000"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#800000" title="#800000" height="6" width="7"></a></td>
<
td bgcolor="#800040"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#800040" title="#800040" height="6" width="7"></a></td>
<
td bgcolor="#800080"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#800080" title="#800080" height="6" width="7"></a></td>
<
td bgcolor="#8000bf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#8000BF" title="#8000BF" height="6" width="7"></a></td>
<
td bgcolor="#8000ff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#8000FF" title="#8000FF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#804000"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#804000" title="#804000" height="6" width="7"></a></td>
<
td bgcolor="#804040"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#804040" title="#804040" height="6" width="7"></a></td>
<
td bgcolor="#804080"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#804080" title="#804080" height="6" width="7"></a></td>
<
td bgcolor="#8040bf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#8040BF" title="#8040BF" height="6" width="7"></a></td>

<
td bgcolor="#8040ff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#8040FF" title="#8040FF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#808000"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#808000" title="#808000" height="6" width="7"></a></td>
<
td bgcolor="#808040"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#808040" title="#808040" height="6" width="7"></a></td>
<
td bgcolor="#808080"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#808080" title="#808080" height="6" width="7"></a></td>
<
td bgcolor="#8080bf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#8080BF" title="#8080BF" height="6" width="7"></a></td>
<
td bgcolor="#8080ff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#8080FF" title="#8080FF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#80bf00"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#80BF00" title="#80BF00" height="6" width="7"></a></td>
<
td bgcolor="#80bf40"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#80BF40" title="#80BF40" height="6" width="7"></a></td>
<
td bgcolor="#80bf80"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#80BF80" title="#80BF80" height="6" width="7"></a></td>
<
td bgcolor="#80bfbf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#80BFBF" title="#80BFBF" height="6" width="7"></a></td>
<
td bgcolor="#80bfff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#80BFFF" title="#80BFFF" height="6" width="7"></a></td>
</
tr>
<
tr>

<
td bgcolor="#80ff00"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#80FF00" title="#80FF00" height="6" width="7"></a></td>
<
td bgcolor="#80ff40"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#80FF40" title="#80FF40" height="6" width="7"></a></td>
<
td bgcolor="#80ff80"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#80FF80" title="#80FF80" height="6" width="7"></a></td>
<
td bgcolor="#80ffbf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#80FFBF" title="#80FFBF" height="6" width="7"></a></td>
<
td bgcolor="#80ffff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#80FFFF" title="#80FFFF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#bf0000"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BF0000" title="#BF0000" height="6" width="7"></a></td>
<
td bgcolor="#bf0040"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BF0040" title="#BF0040" height="6" width="7"></a></td>
<
td bgcolor="#bf0080"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BF0080" title="#BF0080" height="6" width="7"></a></td>
<
td bgcolor="#bf00bf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BF00BF" title="#BF00BF" height="6" width="7"></a></td>
<
td bgcolor="#bf00ff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BF00FF" title="#BF00FF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#bf4000"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BF4000" title="#BF4000" height="6" width="7"></a></td>
<
td bgcolor="#bf4040"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BF4040" title="#BF4040" height="6" width="7"></a></td>
<
td bgcolor="#bf4080"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BF4080" title="#BF4080" height="6" width="7"></a></td>

<
td bgcolor="#bf40bf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BF40BF" title="#BF40BF" height="6" width="7"></a></td>
<
td bgcolor="#bf40ff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BF40FF" title="#BF40FF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#bf8000"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BF8000" title="#BF8000" height="6" width="7"></a></td>
<
td bgcolor="#bf8040"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BF8040" title="#BF8040" height="6" width="7"></a></td>
<
td bgcolor="#bf8080"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BF8080" title="#BF8080" height="6" width="7"></a></td>
<
td bgcolor="#bf80bf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BF80BF" title="#BF80BF" height="6" width="7"></a></td>
<
td bgcolor="#bf80ff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BF80FF" title="#BF80FF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#bfbf00"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BFBF00" title="#BFBF00" height="6" width="7"></a></td>
<
td bgcolor="#bfbf40"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BFBF40" title="#BFBF40" height="6" width="7"></a></td>
<
td bgcolor="#bfbf80"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BFBF80" title="#BFBF80" height="6" width="7"></a></td>
<
td bgcolor="#bfbfbf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BFBFBF" title="#BFBFBF" height="6" width="7"></a></td>
<
td bgcolor="#bfbfff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BFBFFF" title="#BFBFFF" height="6" width="7"></a></td>
</
tr>

<
tr>
<
td bgcolor="#bfff00"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BFFF00" title="#BFFF00" height="6" width="7"></a></td>
<
td bgcolor="#bfff40"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BFFF40" title="#BFFF40" height="6" width="7"></a></td>
<
td bgcolor="#bfff80"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BFFF80" title="#BFFF80" height="6" width="7"></a></td>
<
td bgcolor="#bfffbf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BFFFBF" title="#BFFFBF" height="6" width="7"></a></td>
<
td bgcolor="#bfffff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#BFFFFF" title="#BFFFFF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#ff0000"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FF0000" title="#FF0000" height="6" width="7"></a></td>
<
td bgcolor="#ff0040"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FF0040" title="#FF0040" height="6" width="7"></a></td>
<
td bgcolor="#ff0080"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FF0080" title="#FF0080" height="6" width="7"></a></td>
<
td bgcolor="#ff00bf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FF00BF" title="#FF00BF" height="6" width="7"></a></td>
<
td bgcolor="#ff00ff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FF00FF" title="#FF00FF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#ff4000"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FF4000" title="#FF4000" height="6" width="7"></a></td>
<
td bgcolor="#ff4040"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FF4040" title="#FF4040" height="6" width="7"></a></td>

<
td bgcolor="#ff4080"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FF4080" title="#FF4080" height="6" width="7"></a></td>
<
td bgcolor="#ff40bf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FF40BF" title="#FF40BF" height="6" width="7"></a></td>
<
td bgcolor="#ff40ff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FF40FF" title="#FF40FF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#ff8000"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FF8000" title="#FF8000" height="6" width="7"></a></td>
<
td bgcolor="#ff8040"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FF8040" title="#FF8040" height="6" width="7"></a></td>
<
td bgcolor="#ff8080"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FF8080" title="#FF8080" height="6" width="7"></a></td>
<
td bgcolor="#ff80bf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FF80BF" title="#FF80BF" height="6" width="7"></a></td>
<
td bgcolor="#ff80ff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FF80FF" title="#FF80FF" height="6" width="7"></a></td>
</
tr>
<
tr>
<
td bgcolor="#ffbf00"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FFBF00" title="#FFBF00" height="6" width="7"></a></td>
<
td bgcolor="#ffbf40"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FFBF40" title="#FFBF40" height="6" width="7"></a></td>
<
td bgcolor="#ffbf80"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FFBF80" title="#FFBF80" height="6" width="7"></a></td>
<
td bgcolor="#ffbfbf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FFBFBF" title="#FFBFBF" height="6" width="7"></a></td>
<
td bgcolor="#ffbfff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FFBFFF" title="#FFBFFF" height="6" width="7"></a></td>

</
tr>
<
tr>
<
td bgcolor="#ffff00"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FFFF00" title="#FFFF00" height="6" width="7"></a></td>
<
td bgcolor="#ffff40"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FFFF40" title="#FFFF40" height="6" width="7"></a></td>
<
td bgcolor="#ffff80"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FFFF80" title="#FFFF80" height="6" width="7"></a></td>
<
td bgcolor="#ffffbf"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FFFFBF" title="#FFFFBF" height="6" width="7"></a></td>
<
td bgcolor="#ffffff"><a href="#" onClick="bbfontstyle('', ''); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="images1/spacer.gif" alt="#FFFFFF" title="#FFFFFF" height="6" width="7"></a></td>
</
tr>

<!--
///-->

</tbody></table

http://img35.picoodle.com/img/img35/...Lm_af85c56.png

Fynnon 14th June 2009 21:46

first you need to specify what tracker source you use !

joeroberts 14th June 2009 22:59

we first off are you adding this to phpBB forum or to a tracker source?
if your adding this to a tracker source you need to define the java parts
Code:

bbfontstyle
helpline

and second you need to finnish filling in the info in
bbfontstyle like this

Code:

bbfontstyle('[color'=#40FFFF]', '[/color']');
and then it may work

LANDSER 15th June 2009 15:57

Quote:

Originally Posted by joeroberts (Post 12416)
we first off are you adding this to phpBB forum or to a tracker source?
if your adding this to a tracker source you need to define the java parts
Code:

bbfontstyle
helpline

and second you need to finnish filling in the info in
bbfontstyle like this

Code:

bbfontstyle('[color'=#40FFFF]', '[/color']');
and then it may work

Yes is for a tracker surce.
I use installer surce.(last version)
Please help me with this line of cod:
PHP Code:

<td bgcolor="#000000"><a href="#" onClick="bbfontstyle('[color=#000000]', '[/color]'); return false;" onMouseOver="helpline('s');" onMouseOut="helpline('tip');"><img src="pic/bbcode/spacer.gif" alt="#000000" title="#000000" height="6" width="7"></a></td


joeroberts 16th June 2009 05:07

Im not realy sure what your trouble with the code is?
I went threw phpBB and got all the code needed to make colour pallet to work and it did its not the same colors yours is + I was also able to get the tab to show and Hide it.
can you please tell Me where your trouble is in detail?

Or would you like for me to post and explane what I came up with?

LANDSER 17th June 2009 18:03

this one is work
 
Quote:

Originally Posted by joeroberts (Post 12434)
Im not realy sure what your trouble with the code is?
I went threw phpBB and got all the code needed to make colour pallet to work and it did its not the same colors yours is + I was also able to get the tab to show and Hide it.
can you please tell Me where your trouble is in detail?

Or would you like for me to post and explane what I came up with?

This one is work is made by Pinduur (credit for Pinduur,thx)
javascript:
PHP Code:

///////     INSERT COLOR ////// by Pinduur  //////////////////

        function culoare(src){
        var codculoare = document.getElementById("<?=$text?>");
        var tmp = codculoare.value;
        codculoare.value = tmp + ' ' + src;
    }

///////     INSERT COLOR ////// by Pinduur  /////////   END   /////////

html:
PHP Code:

<table border="1"  align="justify"cellpadding="0" cellspacing="0" height="7" >          
<
tbody><tr>


<
td bgcolor="#000000">
<
img src="pic/bbcode/spacer.gif" title="#000000" height="8" width="9" border="0" alt="[color=#000000]text aici[/color]" onClick="culoare(this.alt);" />
</
td>
</
tr>
</
tbody></table

If is posible please post your mode to see how it is work.

Thx.

joeroberts 20th June 2009 05:26

First you need to create a new java page name to what ever you want
add this code to it
Code:

// Startup variables
var onload_functions = new Array();
var imageTag = false;
var theSelection = false;

// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version

var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
var baseHeight;
    window.onload = function()
    {
        for (var i = 0; i < onload_functions.length; i++)
        {
            eval(onload_functions[i]);
        }
    }
onload_functions.push('initInsertions()');

function insert_text(text, spaces, popup)
{
    var textarea;
   
    if (!popup)
    {
        textarea = document.forms[form_name].elements[text_name];
    }
    else
    {
        textarea = opener.document.forms[form_name].elements[text_name];
    }
    if (spaces)
    {
        text = ' ' + text + ' ';
    }
   
    if (!isNaN(textarea.selectionStart))
    {
        var sel_start = textarea.selectionStart;
        var sel_end = textarea.selectionEnd;

        mozWrap(textarea, text, '')
        textarea.selectionStart = sel_start + text.length;
        textarea.selectionEnd = sel_end + text.length;
    }
    else if (textarea.createTextRange && textarea.caretPos)
    {
        if (baseHeight != textarea.caretPos.boundingHeight)
        {
            textarea.focus();
            storeCaret(textarea);
        }

        var caret_pos = textarea.caretPos;
        caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
    }
    else
    {
        textarea.value = textarea.value + text;
    }
    if (!popup)
    {
        textarea.focus();
    }
}
function dE(n, s)
{
    var e = document.getElementById(n);

    if (!s)
    {
        s = (e.style.display == '' || e.style.display == 'block') ? -1 : 1;
    }
    e.style.display = (s == 1) ? 'block' : 'none';
}
function mozWrap(txtarea, open, close)
{
    var selLength = txtarea.textLength;
    var selStart = txtarea.selectionStart;
    var selEnd = txtarea.selectionEnd;
    var scrollTop = txtarea.scrollTop;

    if (selEnd == 1 || selEnd == 2)
    {
        selEnd = selLength;
    }

    var s1 = (txtarea.value).substring(0,selStart);
    var s2 = (txtarea.value).substring(selStart, selEnd)
    var s3 = (txtarea.value).substring(selEnd, selLength);

    txtarea.value = s1 + open + s2 + close + s3;
    txtarea.selectionStart = selEnd + open.length + close.length;
    txtarea.selectionEnd = txtarea.selectionStart;
    txtarea.focus();
    txtarea.scrollTop = scrollTop;

    return;
}


function caretPosition()
{
    var start = null;
    var end = null;
}
function getCaretPosition(txtarea)
{
    var caretPos = new caretPosition();
   
    // simple Gecko/Opera way
    if(txtarea.selectionStart || txtarea.selectionStart == 0)
    {
        caretPos.start = txtarea.selectionStart;
        caretPos.end = txtarea.selectionEnd;
    }
    // dirty and slow IE way
    else if(document.selection)
    {
   
        // get current selection
        var range = document.selection.createRange();

        // a new selection of the whole textarea
        var range_all = document.body.createTextRange();
        range_all.moveToElementText(txtarea);
       
        // calculate selection start point by moving beginning of range_all to beginning of range
        var sel_start;
        for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++)
        {       
            range_all.moveStart('character', 1);
        }
   
        txtarea.sel_start = sel_start;
   
        // we ignore the end value for IE, this is already dirty enough and we don't need it
        caretPos.start = txtarea.sel_start;
        caretPos.end = txtarea.sel_start;           
    }

    return caretPos;
}
function bbfontstyle(bbopen, bbclose)
{
    theSelection = false;

    var textarea = document.forms[form_name].elements[text_name];

    textarea.focus();

    if ((clientVer >= 4) && is_ie && is_win)
    {
        // Get text selection
        theSelection = document.selection.createRange().text;

        if (theSelection)
        {
            // Add tags around selection
            document.selection.createRange().text = bbopen + theSelection + bbclose;
            document.forms[form_name].elements[text_name].focus();
            theSelection = '';
            return;
        }
    }
    else if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0))
    {
        mozWrap(document.forms[form_name].elements[text_name], bbopen, bbclose);
        document.forms[form_name].elements[text_name].focus();
        theSelection = '';
        return;
    }
   
    //The new position for the cursor after adding the bbcode
    var caret_pos = getCaretPosition(textarea).start;
    var new_pos = caret_pos + bbopen.length;       

    // Open tag
    insert_text(bbopen + bbclose);

    // Center the cursor when we don't have a selection
    // Gecko and proper browsers
    if (!isNaN(textarea.selectionStart))
    {
        textarea.selectionStart = new_pos;
        textarea.selectionEnd = new_pos;
    }   
    // IE
    else if (document.selection)
    {
        var range = textarea.createTextRange();
        range.move("character", new_pos);
        range.select();
        storeCaret(textarea);
    }

    textarea.focus();
    return;
}

function colorPalette(dir, width, height)
{
    var r = 0, g = 0, b = 0;
    var numberList = new Array(6);
    var color = '';

    numberList[0] = '00';
    numberList[1] = '40';
    numberList[2] = '80';
    numberList[3] = 'BF';
    numberList[4] = 'FF';

    document.writeln('');

    for (r = 0; r < 5; r++)
    {
        if (dir == 'h')
        {
            document.writeln('');
        }

        for (g = 0; g < 5; g++)
        {
            if (dir == 'v')
            {
                document.writeln('');
            }
           
            for (b = 0; b < 5; b++)
            {
                color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
                document.write('');
            }

            if (dir == 'v')
            {
                document.writeln('');
            }
        }

        if (dir == 'h')
        {
            document.writeln('');
        }
    }
    document.writeln('
');
                document.write('#' + color + '');
                document.writeln('
');
}

now where you want color pallet to be add this to top
HTML Code:

<script type="text/javascript" src="http://yoursite/javacode.js"></script>
        <script type="text/javascript">
// <![CDATA[
    var form_name = 'formdata';
    var text_name = 'descr';
    var load_draft = false;
    var upload = false;

    // Define the bbCode tags
    var bbcode = new Array();
    var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','<<<@!1!@>>>','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]');
    var imageTag = false;

    // Helpline messages
    var help_line = {
        b: 'Bold text: [b]text[/b]',
        i: 'Italic text: [i]text[/i]',
        u: 'Underline text: [u]text[/u]',
        q: 'Quote text: <<<@!2!@>>>',
        c: 'Code display: [code]code[/code]',
        l: 'List: [list]text[/list]',
        o: 'Ordered list: [list=]text[/list]',
        p: 'Insert image: [img]http://image_url[/img]',
        w: 'Insert URL: [url=http://url]Lost redirect[/url] or [url=http://url]URL text[/url]',
        a: 'Inline uploaded attachment: [attachment=]filename.ext[/attachment]',
        s: 'Font colour: [color=red]text[/color]  Tip: you can also use color=#FF0000',
        f: 'Font size: [size=85]small text[/size]',
        e: 'List: Add list element',
        d: 'Flash: [flash=width,height]http://url[/flash]'
            }

    var panels = new Array('options-panel', 'attach-panel', 'poll-panel');
    var show_panel = 'options-panel';


// ]]>

</script>

be sure to edit
Code:

    var form_name = 'formdata';
    var text_name = 'descr';

to your form name and text area name
now where you want to add the pallet (with in the form) put this code
HTML Code:

<div id="colour_palette" style="display: none;">
    <dl style="clear: left;">
        <dt><label>Font colour:</label></dt>
        <dd>

        <script type="text/javascript">
        // <![CDATA[
            function change_palette()
            {
                dE('colour_palette');
                e = document.getElementById('colour_palette');
               
                if (e.style.display == 'block')
                {
                    document.getElementById('bbpalette').value = 'Hide font colour';
                }
                else
                {
                    document.getElementById('bbpalette').value = 'Font colour';
                }
            }

            colorPalette('h', 15, 10);
        // ]]>

        </script>
        </dd>
    </dl>
</div>
    <input type="button" class="button2" name="bbpalette" id="bbpalette" value="Font colour" onclick="change_palette();" title="Font colour: [color=red]text[/color]  Tip: you can also use color=#FF0000" />

You can see this work here
phpMyBitTorrentV2.0.3

Dehas 7th July 2009 20:35

updated for TBDEV and TorrentStrike

javacode.js
Code:

// Startup variables
var onload_functions = new Array();
var imageTag = false;
var theSelection = false;

// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version

var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
var baseHeight;
    window.onload = function()
    {
        for (var i = 0; i < onload_functions.length; i++)
        {
            eval(onload_functions[i]);
        }
    }
onload_functions.push('initInsertions()');

function insert_text(text, spaces, popup)
{
    var textarea;
   
    if (!popup)
    {
        textarea = document.forms[form_name].elements[text_name];
    }
    else
    {
        textarea = opener.document.forms[form_name].elements[text_name];
    }
    if (spaces)
    {
        text = ' ' + text + ' ';
    }
   
    if (!isNaN(textarea.selectionStart))
    {
        var sel_start = textarea.selectionStart;
        var sel_end = textarea.selectionEnd;

        mozWrap(textarea, text, '')
        textarea.selectionStart = sel_start + text.length;
        textarea.selectionEnd = sel_end + text.length;
    }
    else if (textarea.createTextRange && textarea.caretPos)
    {
        if (baseHeight != textarea.caretPos.boundingHeight)
        {
            textarea.focus();
            storeCaret(textarea);
        }

        var caret_pos = textarea.caretPos;
        caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
    }
    else
    {
        textarea.value = textarea.value + text;
    }
    if (!popup)
    {
        textarea.focus();
    }
}
function dE(n, s)
{
    var e = document.getElementById(n);

    if (!s)
    {
        s = (e.style.display == '' || e.style.display == 'block') ? -1 : 1;
    }
    e.style.display = (s == 1) ? 'block' : 'none';
}
function mozWrap(txtarea, open, close)
{
    var selLength = txtarea.textLength;
    var selStart = txtarea.selectionStart;
    var selEnd = txtarea.selectionEnd;
    var scrollTop = txtarea.scrollTop;

    if (selEnd == 1 || selEnd == 2)
    {
        selEnd = selLength;
    }

    var s1 = (txtarea.value).substring(0,selStart);
    var s2 = (txtarea.value).substring(selStart, selEnd)
    var s3 = (txtarea.value).substring(selEnd, selLength);

    txtarea.value = s1 + open + s2 + close + s3;
    txtarea.selectionStart = selEnd + open.length + close.length;
    txtarea.selectionEnd = txtarea.selectionStart;
    txtarea.focus();
    txtarea.scrollTop = scrollTop;

    return;
}


function caretPosition()
{
    var start = null;
    var end = null;
}
function getCaretPosition(txtarea)
{
    var caretPos = new caretPosition();
   
    // simple Gecko/Opera way
    if(txtarea.selectionStart || txtarea.selectionStart == 0)
    {
        caretPos.start = txtarea.selectionStart;
        caretPos.end = txtarea.selectionEnd;
    }
    // dirty and slow IE way
    else if(document.selection)
    {
   
        // get current selection
        var range = document.selection.createRange();

        // a new selection of the whole textarea
        var range_all = document.body.createTextRange();
        range_all.moveToElementText(txtarea);
       
        // calculate selection start point by moving beginning of range_all to beginning of range
        var sel_start;
        for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++)
        {       
            range_all.moveStart('character', 1);
        }
   
        txtarea.sel_start = sel_start;
   
        // we ignore the end value for IE, this is already dirty enough and we don't need it
        caretPos.start = txtarea.sel_start;
        caretPos.end = txtarea.sel_start;           
    }

    return caretPos;
}
function bbfontstyle(bbopen, bbclose)
{
    theSelection = false;

    var textarea = document.forms[form_name].elements[text_name];

    textarea.focus();

    if ((clientVer >= 4) && is_ie && is_win)
    {
        // Get text selection
        theSelection = document.selection.createRange().text;

        if (theSelection)
        {
            // Add tags around selection
            document.selection.createRange().text = bbopen + theSelection + bbclose;
            document.forms[form_name].elements[text_name].focus();
            theSelection = '';
            return;
        }
    }
    else if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0))
    {
        mozWrap(document.forms[form_name].elements[text_name], bbopen, bbclose);
        document.forms[form_name].elements[text_name].focus();
        theSelection = '';
        return;
    }
   
    //The new position for the cursor after adding the bbcode
    var caret_pos = getCaretPosition(textarea).start;
    var new_pos = caret_pos + bbopen.length;       

    // Open tag
    insert_text(bbopen + bbclose);

    // Center the cursor when we don't have a selection
    // Gecko and proper browsers
    if (!isNaN(textarea.selectionStart))
    {
        textarea.selectionStart = new_pos;
        textarea.selectionEnd = new_pos;
    }   
    // IE
    else if (document.selection)
    {
        var range = textarea.createTextRange();
        range.move("character", new_pos);
        range.select();
        storeCaret(textarea);
    }

    textarea.focus();
    return;
}

function colorPalette(dir, width, height)
{
    var r = 0, g = 0, b = 0;
    var numberList = new Array(6);
    var color = '';

    numberList[0] = '00';
    numberList[1] = '40';
    numberList[2] = '80';
    numberList[3] = 'BF';
    numberList[4] = 'FF';

    document.writeln('');

    for (r = 0; r < 5; r++)
    {
        if (dir == 'h')
        {
            document.writeln('');
        }

        for (g = 0; g < 5; g++)
        {
            if (dir == 'v')
            {
                document.writeln('');
            }
           
            for (b = 0; b < 5; b++)
            {
                color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
                document.write('');
            }

            if (dir == 'v')
            {
                document.writeln('');
            }
        }

        if (dir == 'h')
        {
            document.writeln('');
        }
    }
    document.writeln('
');
                document.write('#' + color + '');
                document.writeln('
');
}

in global.php after
Code:

                var r = document.body.createTextRange();
                r.moveToElementText(e);
                r.select();
        }
}


add
HTML Code:

<script type="text/javascript" src="javacode.js"></script>
        <script type="text/javascript">
// <![CDATA[
    var form_name = '<?=$form?>';
    var text_name = '<?=$text?>';
    var load_draft = false;
    var upload = false;

    // Define the bbCode tags
    var bbcode = new Array();
    var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','<<<@!1!@>>>','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]');
    var imageTag = false;

    // Helpline messages
    var help_line = {
        b: 'Bold text: [b]text[/b]',
        i: 'Italic text: [i]text[/i]',
        u: 'Underline text: [u]text[/u]',
        q: 'Quote text: [code]                var r = document.body.createTextRange();
                r.moveToElementText(e);
                r.select();
        }
}

</script>[/code]',
        c: 'Code display: [code]code[/code]',
        l: 'List:[list]text[/list]',
        o: 'Ordered list:[list=]text[/list]',
        p: 'Insert image: [img]http://image_url[/img]',
        w: 'Insert URL: [url=http://url]Lost redirect[/url] or [url=http://url]URL text[/url]',
        a: 'Inline uploaded attachment: [attachment=]filename.ext[/attachment]',
        s: 'Font colour: [color=red]text[/color]  Tip: you can also use color=#FF0000',
        f: 'Font size: [size=85]small text[/size]',
        e: 'List: Add list element',
        d: 'Flash: [flash=width,height]http://url[/flash]'
            }

    var panels = new Array('options-panel', 'attach-panel', 'poll-panel');
    var show_panel = 'options-panel';


// ]]>

</script>

find
Code:

replace by
Code:

text  Tip: you can also use color=#FF0000" />
find
Code:





add after
Code:


add in your css
Code:

.colorpiker {
 border: solid #FFFFFF 2px;
 }



All times are GMT +2. The time now is 11:06.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.