The TinyMCE menu has a significant issue with the Overflow style,
and the Boost theme heavily uses Overflow for drawer navigation.
Nest the dropdown menu container into the parent editor container makes it work correctly.
Co-authored-by: davewoloszyn <david.woloszyn@moodle.com>
Co-authored-by: xr0master <xr0master@gmail.com>
Added a few functions to remove the toolbar button, menubar and sub-menu items.
One of the implementations is to remove the justify alignment in the toolbar and
the sub-menu items to aid the accessibility aspect of the TinyMCE editor.
We created a list of placeholder selectors in placeholderSelectors option.
The purpose of this list is to indicate the contents that are only shown
in the editor and not to the users, by that way, we can decide to apply or
not to apply rules, styles, etc... to these contents
jQuery submit events do not trigger the native submit event, and
therefore the TinyMCE submit listener is not called. This means that the
tinymce.triggerSave() function is not called, and the editor content is
not saved.
To work around this, if there is a form for the Node that the editor is
attached to, the jQuery submit event is listened to and the save event
called.
Unfortunately it is not possible to use a global jQuery submit listener
added to the document to save all editors on the page.
In some cases, this is too late because the bubbling process means that
a child node consumer may attempt to consume the data before the
delegated handler is called for the document.
The autosave is reset on form submission, but if that form submission
happens at the same time as a page reload, the connection and/or server
is slow, then the connection may be aborted before the session is
removed.
This commit changes the autosave reset to use the fetch() API with a
keepalive flag.
Unfortunately we do not have a formal endpoint for this in Moodle JS so
this is a hackier approach than I would like. MDL-76463 has been opened
to investigate this.
This commit also fixes a situation where the autosave content is re-sent
when the user has typed in the editor and their next action is to click
on the submit button. This is now blocked for that editor instance.
Bootstrap core's "reboot" sets a default text-align which is
incompatible with RTL languages.
Arguably this should be set in the Boost theme, but this is a fairly
large change which has potential to break things so I'm making it here
where we experience the issue for now.