tsechingho / ckeditor-rails

Integrate CKEditor javascript library with Rails asset pipeline
https://github.com/tsechingho/ckeditor-rails
MIT License
214 stars 133 forks source link

Can't get some toolbar buttons to show with Rails 4.2.2 #64

Closed scratchoo closed 9 years ago

scratchoo commented 9 years ago

I am customizing my toolbar like the following (my actual Rails version is 4.2.2, I tried this code in 4.2.0 and there is no problem)

config.toolbar = [
    [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ],
    [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ],
    ['Font', 'FontSize','superlink'],
    ['TextColor', 'BGColor'],
    '/',
    [ 'Bold', 'Italic', 'Underline', 'Strike' ],
    [ 'Undo', 'Redo' ],
    ['Link', 'Unlink']
];    

But some buttons are missing like 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'NumberedList', 'BulletedList' ...

PS: Also without customizing the toolbar, those buttons don't show up !! Is this a bug ?

Thanks!

tsechingho commented 9 years ago

I have app/assets/javascripts/ckeditor/config.js.coffee like

CKEDITOR.editorConfig = (config) ->
  config.language = "zh"
  config.uiColor = "#AADC6E"
  config.toolbar = [
    [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ],
    [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ],
    ['Font', 'FontSize','superlink'],
    ['TextColor', 'BGColor'],
    '/',
    [ 'Bold', 'Italic', 'Underline', 'Strike' ],
    [ 'Undo', 'Redo' ],
    ['Link', 'Unlink'],
    ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'NumberedList', 'BulletedList']
  ]

and have a correct result like

ckeditor_config