5
votes

I'm using the TinyMCE HTML Editor with the insert image function. The application I'm working on isn't allowed to use images from external URLs. So they should only be able to use the Upload option. Is there a way to disable the Source textbox shown below? Is there an initialisation property that can be used?

Souce Image

Here is an example of the TinyMCE editor in question. https://www.tiny.cloud/docs/demo/local-upload/

1
Hey. did you find an answer for this? I need to remove the source input also - Action_Turtle
@Action_Turtle Yeah I actually just targeted all the HTML elements and hide them using css. I will add my solution as an answer to the question as I forgot to do so way back. - Bad Dub

1 Answers

0
votes

I couldn't find an official way to do this so I just targeted all the associated HTML elements and hid them using CSS.

.tox-dialog .tox-dialog__content-js .tox-dialog__body .tox-form__controls-h-stack input[type=url].tox-textfield {
    display: none;
}

.tox-dialog .tox-dialog__content-js .tox-dialog__body div.tox-form__group:first-child label {
    display: none;
}

.tox-dialog .tox-dialog__content-js .tox-dialog__body .tox-form__controls-h-stack div.tox-form__group:first-child label {
    display: block;
}