Quill ImageUpload Module
A module for Quill rich text editor to upload images to be selected from toolbar editor.
🐛 Fix Bug : accepted response code 200, 201, 202, 203, 204, 205, 206, 207, 208, 226
Usage
Webpack/ES6
;; Quill; const quill = editor // ... modules: // ... imageUpload: url: '' // server url. If the url is empty then the base64 returns method: 'POST' // change query method, default 'POST' name: 'image' // custom form name withCredentials: false // withCredentials headers: // add custom headers, example { token: 'your-token'} 'Authorization': 'Token your-token' csrf: // add custom CSRF token: 'token' hash: '' {} // add custom uploader // personalize successful callback and call next function to insert new url to the editor { // serverResponse must return of full image URL. ; } // personalize failed callback { ; } // optional // add callback when a image have been chosen { console; ; // go back to component and send to the server } ;
Script Tag
Copy image-upload.min.js into your web root or include from node_modules
var quill = editor // ... modules: // ... imageUpload: url: '' // server url. If the url is empty then the base64 returns method: 'POST' // change query method, default 'POST' name: 'image' // custom form name withCredentials: false // withCredentials headers: 'Authorization': 'Token your-token' // add custom headers, example { token: 'your-token'} // personalize successful callback and call next function to insert new url to the editor { // serverResponse must return of full image URL. ; } // personalize failed callback { ; } ;