codeslayer1 / react-ckeditor

CKEditor component for React with plugin and custom event listeners support
MIT License
129 stars 34 forks source link

Full preset of toolbar options. Can't add more options #66

Closed pr0thean closed 5 years ago

pr0thean commented 5 years ago

I have only standard version of toolbar. I tried to add full set of options like this: <CKEditor content={props.content} events={{ "change": props.onChangeEditor }} config={{ toolbar: [ { name: 'document', items: [ 'Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates' ] }, { name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] }, { name: 'editing', items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] }, { name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] }, '/', { name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'CopyFormatting', 'RemoveFormat' ] }, { name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language' ] }, { name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] }, { name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe' ] }, '/', { name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] }, { name: 'colors', items: [ 'TextColor', 'BGColor' ] }, { name: 'tools', items: [ 'Maximize', 'ShowBlocks' ] }, { name: 'about', items: [ 'About' ] } ], }} /> But this does not change anything. However removeButtons work fine. I can remove options from toolbar but I can't add any.

NikhilP99 commented 5 years ago

same issue..

isaacghorbani commented 5 years ago

hi guys in node_modules/react-ckeditor-componnet/lib/ckeditor.js change line : var defaultScriptUrl = 'https://cdn.ckeditor.com/4.6.2/standard/ckeditor.js'; to var defaultScriptUrl = 'https://cdn.ckeditor.com/4.6.2/full/ckeditor.js'; good lock,

codeslayer1 commented 5 years ago

Hey,

If the issue is solved using isaac's method, then you can simply pass the full script url as prop using scriptUrl prop present in the library. Because directly changing the node_modules build files won't help as the files will reset when you update/reinstall the library.

So you can directly use this code:

<CKEditor scriptUrl="https://cdn.ckeditor.com/4.6.2/full/ckeditor.js" />