Setup TinyMCE Editor

TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor. I used here 3.2.1.1 version.lets see how add this editor to an application. first download it and unzipped it and put it in your web application’s js folder. so the folder structure looks -

folderstruc1

I used one configaration file that initialize the TinyMCE editor. this file name is initTinyMCE.js. put this folder into \webapp\js\tiny_mce folder.

——————–  initTinyMCE.js

tinyMCE.init({
theme : “advanced”,
mode : “textareas”,
plugins : “searchreplace,print,paste”,
entity_encoding:”named”,
entities : “",34, ,160,&,38,¢,162,€,8364,£,163,¥,165,©,169,®,174,™,8482,‰,8240,<,60,>,62,≤,8804,≥,8805,°,176,−,8722″,
theme_advanced_buttons1 : “print,search,replace,separator,undo,redo”,
theme_advanced_buttons2: “”,
theme_advanced_buttons3 : “”,
theme_advanced_toolbar_location : “top”,
theme_advanced_toolbar_align : “left”,
theme_advanced_path_location : “bottom”,
extended_valid_elements : “a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]“,
theme_advanced_resize_horizontal : true,
theme_advanced_resizing : true,
nonbreaking_force_tab : false,
apply_source_formatting : false,
width : 300,
debug : false,
//handle_event_callback : “myHandleEvent”,
cleanup : true,
theme_advanced_path : false,
});

here i used entities value so that it returns the actual character. there are so many plugins and button i used only some plugins of them. the ‘TinyMCE test.html’ looks like -

——————— TinyMCE Test.html

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html>
<head>
<meta content=”text/html; charset=ISO-8859-1″ http-equiv=”content-type”>
<title>TinyMCE Test</title>
</head>

<body>
<script type=”text/javascript” src=”js/tiny_mce/tiny_mce.js”></script>
<script type=”text/javascript” src=”js/tiny_mce/initTinyMCE.js”></script>

<table width=”100%”>
<tr>
<td align=”center”>
<textarea id=”txtNote1″ name=”txtNote1″ rows=”7″ cols=”10″ >
This is Text1.
</textarea>
</td>
</tr>
<tr>
<td>
&nbsp;
</td>
</tr>
<tr>
<td align=”center”>
<textarea id=”txtNote2″ name=”txtNote2″ rows=”7″ cols=”10″ >
This is Text2.
</textarea>
</td>
</tr>

</table>
</body>
</html>

the TinyMCE test.html page looks like -

tinymce-test1
Thanks

Rajib

Advertisement

3 Responses to Setup TinyMCE Editor

  1. Enlargement says:

    I am amazed with it. It is a good thing for my research. Thanks

  2. Weehyclecop says:

    I am unable to understand this post. But well some points are useful for me.

  3. Boy70 says:

    What is contained in an ATA carnet document? ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.