-
Notifications
You must be signed in to change notification settings - Fork 135
Configure CKEditor
Daniel Cestari edited this page Dec 3, 2015
·
3 revisions
Please refer to these pages for documentation on customizing CKEditor:
To add and use a new toolbar named 'Pure', create or edit app/assets/javascripts/ckeditor/config.js.coffee with the following content: (or config.js if you're not using coffeescript, in which case you have to translate this to javascript, obviously)
# http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.toolbar_Full
CKEDITOR.editorConfig = (config) ->
config.language = 'en'
config.width = '725'
config.height = '600'
config.toolbar_Pure = [
{ name: 'document', items: [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ] },
{ name: 'clipboard', items: [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
{ name: 'editing', items: [ 'Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt' ] },
{ name: 'tools', items: [ 'Maximize', 'ShowBlocks','-','About' ] }
'/',
{ name: 'basicstyles', items: [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] },
{ name: 'paragraph', items: [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ] },
{ name: 'links', items: [ 'Link','Unlink','Anchor' ] },
'/',
{ name: 'styles', items: [ 'Styles','Format','Font','FontSize' ] },
{ name: 'colors', items: [ 'TextColor','BGColor' ] },
{ name: 'insert', items: [ 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak' ] },
]
config.toolbar = 'Pure'
trueFor at least some people, the custom config.js file will not load in development, but once deployed to a staging or production server, it works as intended.
You may be able to work around this issue by setting the following configuration in your config/environments/development.rb file
config.serve_static_assets = false
config.assets.compile = false