Posts made by Joseph Rézeau

Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

For a new question type I am developing I need to manipulate the question text. Because that text is displayed differently in the ATTO and TinyMCE editors, I need to find out in my JS script which editor is in use. This works:

const attoIsLive = $('.editor_atto').length;
const tinymceIsLive = !attoIsLive;

Well, it works until Moodle makes another editor available in the near future. What would be a more robust way to find out if TinyMCE is being used?

Average of ratings: -