Skip to content

Instantly share code, notes, and snippets.

@rinterliche
Created June 27, 2013 19:28
Show Gist options
  • Save rinterliche/5879584 to your computer and use it in GitHub Desktop.
Save rinterliche/5879584 to your computer and use it in GitHub Desktop.
function init_ckeditor(editor_name) {
if (CKEDITOR.instances && CKEDITOR.instances[editor_name]) {
try {
CKEDITOR.instances[editor_name].destroy();
} catch (err) {
CKEDITOR.remove(editor_name);
}
}
CKEDITOR.replace( editor_name ,
{
toolbar :
[
{ name: 'clipboard', items : [ 'Cut','Copy','PasteText','-','Undo','Redo' ] },
{ name: 'insert', items : [ 'Image','Table','HorizontalRule','SpecialChar','PageBreak'
,'Iframe' ] }, '/',
{ name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-', '-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'] },
{ name: 'basicstyles', items : [ 'Bold','Italic','Strike','-','RemoveFormat' ] },
{ name: 'styles', items : [ 'Format' ] },
{ name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent' ] },
{ name: 'links', items : [ 'Link','Unlink'] } ]
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment