We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
vendor/jxlwqq/quill/src/Editor.php
var options = {$options}; var quill = new Quill("#{$this->id}", options);
function imageHandler() { let IMGUR_API_URL = '/admin/upload-image'; let fileInput = this.container.querySelector('input.ql-image[type=file]'); if (fileInput == null) { fileInput = document.createElement('input'); fileInput.setAttribute('type', 'file'); fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon'); fileInput.classList.add('ql-image'); fileInput.addEventListener('change', () => { const files = fileInput.files; const range = quill.getSelection(true); if (!files || !files.length) { console.log('No files selected'); return; } const formData = new FormData(); formData.append('file', files[0]); formData.append('_token', LA.token); quill.enable(false); var xhr = new XMLHttpRequest(); if (!xhr) { alert("Giving up :( Cannot create an XMLHTTP instance"); return false; } xhr.open('POST', IMGUR_API_URL, true); xhr.onreadystatechange = function() { if (xhr.readyState === 4) { var response = JSON.parse(xhr.responseText); console.log('response', response); if (response.success) { quill.enable(true); quill.editor.insertEmbed(range.index, 'image', response.url); quill.setSelection(range.index + 1, Quill.sources.SILENT); fileInput.value = ''; } else { console.log('quill image upload failed'); quill.enable(true); } } } xhr.send(formData); }); this.container.appendChild(fileInput); } fileInput.click(); } var options = {$options}; var quill = new Quill("#{$this->id}", options); const toolbar = quill.getModule('toolbar'); toolbar.addHandler('image', imageHandler); ... ...
说明:
1.0.2
1.3.6
1.3.x
axios
The text was updated successfully, but these errors were encountered:
No branches or pull requests
修改方法:
vendor/jxlwqq/quill/src/Editor.php
文件找到JS代码部分;说明:
1.0.2
,此插件版本使用的quill是1.3.6
版本;1.3.x
版本,不适用qiill2及以上版本;axios
上传改为了原生JS上传。The text was updated successfully, but these errors were encountered: