codeslayer1 / react-ckeditor

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

[Question] How to add plugins in build #65

Closed SeongwoonHong closed 5 years ago

SeongwoonHong commented 5 years ago
  1. I'd like to upload local files. but react-ckeditor-component by default, doesn't have that functionality right..? so I'd like to add an upload image plugin.. but the thing is that i am not sure how to add a plugin with this library. Should I add it in webpack settings..? or somewhere? Could you give me a piece of example code please?

  2. I know you mentioned here https://github.com/codeslayer1/react-ckeditor/issues/45 that the latest standard version 4.9.2 includes imageupload plugin. how do i make this library to point to 4.9.2 not 4.6.2..?

Thank you!

codeslayer1 commented 5 years ago

Hey, you can change the CKEditor script to be used using scriptUrl prop.

<CKEditor scriptUrl="YOUR_SCRIPT_URL" />

In case you need to use a custom build to use image upload plugin, you can refer this issue - #7 .

SeongwoonHong commented 5 years ago

@codeslayer1 I've read it and I have absolutely no idea what you meant by 'add plugin to your ckeditor build' ... Could you please give me how to add it to ckeditor build ...? This is my piece of code

        <CKEditor
          activeClass="p10"
          content={input.value}
          config={{
            readOnly: this.props.disabled,
            language: i18n.language,
            allowedContent: true,
            extraPlugins: 'uploadimage',
            uploadUrl: '/blahblah'
          }}
          events={{
            change: (value) => {
              input.onChange(value.editor.getData());
            }
          }}
        />
SeongwoonHong commented 5 years ago

nvm got it. thanks :)