public
Last active

  • Download Gist
rte.html
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<h1>Sample Rich Text Editor</h1>
<div id="sample_textarea"></div>
 
<script language="javascript" type="text/javascript" src="/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
//-- <![CDATA[
tinyMCE.init({
theme : "advanced",
dialog_type : "modal",
plugins : "inlinepopups,fullscreen, spellchecker, paste, directionality",
theme_advanced_buttons1 : "bold,italic,underline, strikethrough, |, justifyleft,justifycenter,justifyright,justifyfull, |, forecolor, backcolor",
theme_advanced_buttons2: "undo, redo, |, bullist, numlist, |, code, |, fullscreen, spellchecker, |, ltr,rtl",
theme_advanced_buttons3: "",
theme_advanced_buttons4: "",
theme_advanced_resizing : true,
theme_advanced_toolbar_location : "top",
content_css : "/styles/qa_styles.css",
spellchecker_languages : "+English=en",
extended_valid_elements : "input[name|size|type|value|onclick],iframe[height|width|src],style[type]",
setup : function(ed) {
ed.onPaste.add( function(ed, e, o) {
ed.execCommand('mcePasteWord', true);
return tinymce.dom.Event.cancel(e);
});
}
});
$j("document").ready(function(){
var $sample_rte = $j("<textarea>");
$sample_rte.css({ width: "98%", height: "200px"});
$j("#sample_textarea").append($sample_rte);
tinyMCE.execCommand('mceAddControl', false, $sample_rte[0]);
})
//-- ]]>
</script>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.