Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i add browse option for image upload and also resize image once user selects the image #96

Open
srishti-sqm opened this issue Aug 2, 2019 · 9 comments
Assignees

Comments

@srishti-sqm
Copy link

I am using vue-ckeditor2 and I want to upload image from local machine and resize it, I have downloaded plugings but where to place them and how vue-ckeditor2 node module will use that

@dangvanthanh
Copy link
Owner

Hi @srishti-sqm

What is plugin of ckeditor, you use?

@srishti-sqm
Copy link
Author

srishti-sqm commented Aug 2, 2019 via email

@srishti-sqm
Copy link
Author

srishti-sqm commented Aug 2, 2019 via email

@dangvanthanh
Copy link
Owner

With Ckeditor4 doesn't support such as modules.

You can add normal with folder and path such as:

ckeditor4
  |- plugins
    |- image
    |- uploadwidget
  |- ckeditor.js

Then you insert in html file

<script src="/path/to/ckeditor/ckeditor.js"></script>

and use with vue-ckeditor2 such as your code.

@srishti-sqm
Copy link
Author

srishti-sqm commented Aug 2, 2019 via email

@dangvanthanh
Copy link
Owner

dangvanthanh commented Aug 2, 2019

Can you send me example code. I will investigate and fix for you.

@srishti-sqm
Copy link
Author

ckeditor.zip

Code for vue file :

<script> import VueCkeditor from 'vue-ckeditor2'; export default { components: { VueCkeditor }, data() { return { content: '', config :{ toolbar : [ { name: 'colors', items: [ 'TextColor'] }, { name: 'styles', items: [ 'FontSize' ] }, { name: 'editing', items: [ ] }, { name: 'basicstyles', items: [ 'Bold', 'Italic', 'Strike','Underline',] }, { name: 'paragraph', items: [ 'NumberedList', 'BulletedList', 'Outdent', 'Indent', '-', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-',] }, { name: 'links', items: [ 'Link' ] }, { name: 'clipboard', items: [ 'Cut']}, { name: 'insert', items: [ 'Image'] }, { name: 'clipboard', items: [ 'Undo', 'Redo' ] }, { name: 'uploadImage', items: [ 'uploadImage' ] }, { name: 'uploadWidget', items: [ 'uploadWidget' ] } ] , extraPlugins : ['uploadImage' , 'uploadWidget'], // imageUploadUrl :'/uploader/upload.php?type=Images', height: 115, } }; }, methods: { onBlur(evt) { console.log(evt); }, onFocus(evt) { console.log(evt); }, onContentDom(evt) { console.log(evt); }, onDialogDefinition(evt) { console.log(evt); }, onFileUploadRequest(evt) { console.log(evt); }, onFileUploadResponse(evt) { console.log(evt); } } }; </script>

@srishti-sqm
Copy link
Author

This error got resolved, can you please tell me what I need to edit in the config so that browse or upload options come for image upload?

@dangvanthanh dangvanthanh self-assigned this Aug 8, 2019
@dangvanthanh
Copy link
Owner

Hi @srishti-sqm

I will investigate your issues.

Besides, you can see demo use upload image with easyimage plugin in https://vue-ckeditor2.surge.sh/classic/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants