Plugin Notes
Emoticons
To avoid using a third-party CDN, we use a self-hosted copy of the open-source Twemoji project to host emojis with the emoticons plugin.
TinyMCEManager.js holds the information on where the emoji URLs point to, and adds them to TinyMCE using the emoticons_images_url and emoticons_database parameters.
Autoresize
It's not exactly clear why, but in some cases, autoresize will not properly resize a TinyMCE editor instance when it's loaded until you manually resize the browser window at least once.
You can get around this by using the editor.execCommand function with the "mceAutoResize" parameter, forcing the plugin to resize the editor as if a browser resize had occurred. This doesn't always work immediately after setting the content; you may have to extend the number of setTimeout functions to ensure the resize always happens if loading a large amount of content.
let initialContent = "some content you want to put inside the editor";
initOpts.setup = function(editor) {
editor.on('init', function(e) {
if (initialContent !== null) {
editor.setContent(initialContent);
for (let i = 1; i < 15; i++) setTimeout(function() {
if (initOpts.plugins.includes("autoresize")) {
editor.execCommand("mceAutoResize");
}
}, i*3);
}
});
};