This is to solve a tricky edge case, when a page has no equations, and then an AJAX
action loads filtered content which contains an equation. (The glossary filter can do this).
To fix this I split the loading into configuration and typesetting. The config always happens,
but does not load the external mathjax libraries. The typesetting happens when an equation is
found - and is what triggers the load of MathJax. This can happen in response to an AJAX event.
1) The same code used in other Moodle forms is now used in Feedback to display the "There are required fields in this form marked (*/Required field)" message at the top of the screen and each of the asterisks next to required fields.
2) Feedback specific styles (missingrequire, feeback_required_mark), which were used to highlight required and error fields, have been eliminated. These colours are now controlled by the common Moodle styles (mform1, mform, fdescription, required, req and error) that are used throughout the rest of Moodle for a more uniform appearance.
3) Field level error reporting now displays a message instead of just highlighting the field in a similar way that other Moodle forms do.
Affected files:
- /mod/feedback/styles.css
- /mod/feedback/complete.php
- /mod/feedback/complete_guest.php
- /mod/feedback/edit.php
- /mod/feedback/print.php
- /mod/feedback/item/captcha/lib.php
- /mod/feedback/item/info/lib.php
- /mod/feedback/item/multichoice/lib.php
- /mod/feedback/item/multichoicerated/lib.php
- /mod/feedback/item/numeric/lib.php
- /mod/feedback/item/textarea/lib.php
- /mod/feedback/item/textfield/lib.php
- /mod/feedback/lang/en/feedback.php
Signed-off-by: Michael Milette <michael.milette@instruxmedia.com>
* Remove all traces of mathjax from the atto equation editor - it is filter agnostic
* Add a M.core.event module for core events that can be published/subscribed to by plugins (loose coupling)
* Add a FILTER_CONTENT_UPDATED event so plugins can tell the filter system when nodes are added to the page
* Implement a listener for this event in the MathJax filter
* Fire this event from the equation editor and from the glossary filter
* Add a nolink tag to the mathjax filter, so equations will not be processed by the other filters
* Add a smarter throttle function to the equation editor preview updates (Y.throttle is dumb)
If MathJax is loaded by any means, the editor should use it instead of the filter. This prevents
slow ajax requests and gives much better rendering. MathJax could be loaded by the filter,
or it could just be done the old way by sticking the include in the page header.
This event was missed in the previous workshop add_to_log change over. The
switch phase event has been moved into the workshop::switch_phase() method.
Also workshop::log() has been deprecated. Developers should use the event
classes to log events.
The problem is that in IE, the browser implements color commands with font tags (<font color=...>).
We specifically strip font tags to avoid abuse when pasting from word (the world has seen enough of Tahoma).
This solution instead uses Rangy to set inline styles on the selection. This works in all browsers nicely.
I also updated the toggleInlineSelectionClass function to use the same rangy function. This solves problems with
whitespace squashing in ie.
This responsive image behaviour prevents setting of image sizes in text editors,
as well as a string of pix icon bugs / profile image bugs across Moodle.
We are switching to Bootstrap 3 syntax where you need img-responsive class to images
that want this behaviour.