Skip to content

Instantly share code, notes, and snippets.

@soffes
Created January 29, 2010 22:35
Show Gist options
  • Save soffes/290225 to your computer and use it in GitHub Desktop.
Save soffes/290225 to your computer and use it in GitHub Desktop.
// TinyMCE Settings.
tinyMCE.init({
extended_valid_elements: 'style',
mode: 'exact',
elements: 'id_name',
theme: 'advanced',
theme_advanced_toolbar_location: 'top',
theme_advanced_toolbar_align: 'left',
plugins: 'safari, style, table, paste, media',
theme_advanced_buttons1: 'bold, italic, underline, justifyleft, justifycenter, justifyright, justifyfull, formatselect, fontselect, fontsizeselect',
theme_advanced_buttons2: 'pastetext, pasteword, search, replace, bullist, numlist, outdent, indent, blockquote, undo, redo, link, unlink, image, forecolor, backcolor, hr, charmap',
theme_advanced_buttons3: 'visualaid, tablecontrols, |, code, removeformat, media',
content_css: '/path/to/rich_text_editor.css',
paste_retain_style_properties: 'background, border, color, font-family, font-size, font-weight, line-height, text-align, text-decoration, text-indent',
auto_focus: 'id_name',
width: '500px',
height: '300px'
});
// If using Prototype...
document.observe('dom:loaded', function() {
tinyMCE.getInstanceById('id_name').execCommand('mceSetContent', false, $('id_name').value);
});
// If using jQuery...
$(function() {
tinyMCE.getInstanceById('id_name').execCommand('mceSetContent', false, $('#id_name').val());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment