I require that the editor only allows images to be loaded and that these are not loaded through the URL as the editor allows by default
I need the load section to be by default and the General tab not to be there, I have searched the documentation but apparently they do not have a configuration for this, I tried to hide it through javascript code but that modal that I show in the image is created and destroys when we click on the image icon that is embedded in the editor, which means that the DOMS elements to load and General do not exist at the time of execution of that code
tinymce.init({
selector: "textarea",
language: "es",
branding: false,
plugins: "image autoresize",
toolbar: "image",
automatic_uploads: true,
file_picker_types: "image",
relative_urls: false,
images_upload_handler: img_handler,
image_uploadtab: true,
typeahead_urls: false,
});
const divs = $(".tox-dialog__body-nav-item");
divs.each(function (i, e) {
if (e.textContent === "General") {
e.remove();
divs[++i].trigger("click");
}
});
Is there a way to remove the General section of my editor?
I was checking the source code implementation of that library and there is no way to remove that tab, at least not through the library api or options because it will show whenever you put an
images_upload_handler
orimages_upload_url
.The only way to hide it would be with CSS and programmatically clicking the "load" tab. The following code excerpt is an ugly implementation but it works:
It basically consists of detecting every time the upload image dialog is opened to click on the "upload" tab.