Open qurgh opened 5 years ago
This is probably kind of hacky, but this updated function now works with TinyMCE 5:
function mce_back($filename)
{
return ("
<script>
top.$('.tox-browse-url').parent().find('.tox-textfield').val('/img/$filename');
top.$(\"button[title|='Save']\").click();
</script>
");
}
There's probably a way to do this in one line, but at least it works!
This is probably kind of hacky, but this updated function now works with TinyMCE 5:
function mce_back($filename) { return (" <script> top.$('.tox-browse-url').parent().find('.tox-textfield').val('/img/$filename'); top.$(\"button[title|='Save']\").click(); </script> "); }
There's probably a way to do this in one line, but at least it works!
you saved my life, thanks
This doesn't work with TinyMCE 5.
file_browser_callback was removed in version 5. The code to get the dialog box to display would be:
However, the javascript returned to fill in the dialog box isn't working. Laravel returns it, but it does nothing (probably due to how they changed the dialog box). I'm going to work on it and see if I can figure it out, but my javascript isn't strong, so it may take a while.