Skip to content

Instantly share code, notes, and snippets.

@BrendonKoz
Created August 4, 2014 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrendonKoz/df1e0fefedd237120872 to your computer and use it in GitHub Desktop.
Save BrendonKoz/df1e0fefedd237120872 to your computer and use it in GitHub Desktop.
Simple CKEditor custom load (with jQuery)
$(document).ready(function(){
$('textarea').ckeditor({
contentsCss: '/css/ckeditor_custom.css', //external CSS to set body{margin:0;}
uiColor: '#FFFFFF',
scayt_autoStartup: true, //spellcheck auto-enabled
autoGrow_onStartup: true,
enterMode: CKEDITOR.ENTER_BR, //I hate this but our users request it
removePlugins: 'elementspath, resize',
extraPlugins: 'autogrow,confighelper', //confighelper allows HTML5-like placeholder text
extraAllowedContent: 'img[alt,dir,id,lang,longdesc,!src,title]{*}(*)', //needed to allow image pasting without an image button
toolbar: [ //no groups, I want to specify which buttons show
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'PasteFromWord', 'Undo', 'Redo' ] },
{ name: 'links', items: [ 'Link', 'Unlink' ] },
{ name: 'editing', groups: [ 'spellchecker' ], items: [ 'Scayt' ] },
{ name: 'tools', items: [ 'Maximize' ] }
]
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment