News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Post text editor area background, drop down menu

Started by animod, October 15, 2005, 01:06:24 PM

Previous topic - Next topic

animod

I have been trying to get the answer to a couple of questions but seem to run into posts with no answers or posts that show the code to change for what must be an earlier version- the "find code" examples I saw show different code than my post.template.php file has in it.
I have the 1.0.5 version

What I'd like to do, since I added a bunch of text colors in the drop down menu  on request, some are using colors like yellow, white, coral and  wheat etc which frankly on the default white/grey background of posts are totally unreadable. I was able to change the post background colors but I'd like to add a drop down menu to select the post background color as you do with the text color. I notice the text color and text size are addressed by   "surroundText" in the menu code;


// Begin Print a drop down list for font size . . . . . . .
    echo ' <select onchange="surroundText(\'[size=\'+this.options[this.selectedIndex].value+\']\', \'[/size]\', document.', $context['post_form'], '.', $context['post_box_name'], '); this.selectedIndex = 0;" style="margin-bottom: 1ex;">
            <option value="" selected="selected">Font Size</option>
            <option value="12pt">12pt</option> 
            </select>';
    echo '<br />';
  // End Print a drop down list for font size


So I am thinking it would be simple enough to add a menu like that to change the post background colors, can someone post the actual CODE for that and confirm it goes in the post.template.php file below  the text size/color coldes?

I assume this is the code that controls the actual text edit window;


// Finally the most important bit - the actual text box to write in!
echo '
<tr>
<td valign="top" align="right"></td>
<td>
<textarea class="editor" name="', $context['post_box_name'], '" rows="', $context['post_box_rows'], '" cols="', $context['post_box_columns'], '" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="2"', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? ' background-color: #fffeee;"' style="border: 1px solid red;"' : '', '>', $message, '</textarea>

</td>
</tr>';
}



And lastly, what about the post text editor area size? it is pretty narrow vertically, is there a way to make the default height of the post editing window maybe half again taller?

Thank you.
http://www.allsupportgroup.info



Advertisement: