Wednesday, September 20, 2006

Tweaking Tinymce

Tinymce has a lot of cute functionality that is handy for email formatting but might become redundant when you want to format text to be sent as SMS. So how do you remove those function? Things like bullets list, underline and stuffs like that?

I had to do that recently and it is quite simple.
You navigate to the themes folder:

And to the particular theme you are using.
By default you have advanced, default and simple as the three themes option you have; although you can surely well come up with your own theme.

Once you are in the folder you will see a .js file titled: editor_template.js.
This file contains the HTML table used to format the textarea and a corresponding javascript function.
So to quickly disable any function you can just remove it from the function or just remove its corresponding HTML codes.
Using the later method, to remove the ‘redo’ function just look for this block of code:

< img src="{$themeurl}/images/redo.gif" title="{$lang_redo_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Redo\')" >

And delete it.

Do this for the other functionalities you might not be needing

No comments: