Всем привет! Хотел поставить elfinder на свою админку, но столкнулся с такой проблемой. Когда перемещаю картинку - всё нормально, но когда нужно её загрузить всплывают две ошибки.
Вот код:
tinymce.init({
selector: '.editor',
plugins: 'a11ychecker advcode casechange export formatpainter linkchecker autolink lists checklist media mediaembed pageembed permanentpen powerpaste table advtable tinycomments tinymcespellchecker',
toolbar: 'a11ycheck addcomment showcomments casechange checklist code export formatpainter pageembed permanentpen table',
toolbar_mode: 'floating',
tinycomments_mode: 'embedded',
tinycomments_author: 'Author name',
file_picker_callback : elFinderBrowser
});
function elFinderBrowser (callback, value, meta) {
tinymce.activeEditor.windowManager.openUrl({
title: 'File Manager',
url: '/elfinder/tinymce5',
/**
* On message will be triggered by the child window
*
* @param dialogApi
* @param details
* @see https://www.tiny.cloud/docs/ui-components/urldialog/#configurationoptions
*/
onMessage: function (dialogApi, details) {
if (details.mceAction === 'fileSelected') {
const file = details.data.file;
// Make file info
const info = file.name;
// Provide file and text for the link dialog
if (meta.filetype === 'file') {
callback(file.url, {text: info, title: info});
}
// Provide image and alt text for the image dialog
if (meta.filetype === 'image') {
callback(file.url, {alt: info});
}
// Provide alternative source and posted for the media dialog
if (meta.filetype === 'media') {
callback(file.url);
}
dialogApi.close();
}
}
});
}
