When an image was added via Atto and it was set to resize automatically
if the alignment was set to Top, Middle or Bottom when it was made
smaller then a vertical scroll bar would be displayed.
This was caused by the interaction of the margin settings on the image
and the 100% width set via the img-responsive css class. The width of
an element only includes the content area and not any borders, padding
or margins.
This change stops atto hardcoding the styles for image alignment into
the images style tag, it instead adds a class that defines the alignment
the image should have.
This change has the benefit that themers will now be able to adjust
how atto image alignments work if they wish.
Images added before this patch will continue to have the issue
until they are edited by the plugin, at which time their legacy style
will be removed and the new alignment method will be added.
Thanks to Andrew Nicols who provided a refactor for the Alignment
and style detection code.
When using a different theme and removing an editor
plugin such as the equation plugin, atto will display
an error about a missing dependency.
A thank you to Anthony Forth for providing this patch.
Specifically on paste - we don't need all the random style attributes
from content on the clipboard. When you copy from a webpage - the browser
inlines all the styles from the page so that the pasted content will look
like the place it was copied from. But this is never what you want - you
want the content on paste, but with no special styling.
Instead of using the more rollup-tolerant config for all files, make the
configuration stricter by default but lower in grunt for yui modules.
This means that manual runs (prechecker) or editor integrations will
flag up the errors as well as grunt.
Also add ignore lines to the core files so that eslint isn't noisy when
not running with grunt.
dirname() is a slow function compared with __DIR__ and using
'/../'. Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code. This allows those required includes to perform as
best as possible in this situation.
The previous commit "Automatically sync editor with its textarea" was
found a not good solution as the onchange event is triggered way less
often than needed for our needs. So this reverts commit 34321d49.
Instead, we add a hack to the formslib so that when there are some
TinyMCE editors used at the page, we explicitly save them before
triggering the form validation. This simply calls save() on all editors
on the page - see the API reference:
http://archive.tinymce.com/wiki.php/API3:method.tinymce.triggerSave
Having TinyMCE hardcoded like this on this core level does not make me
happy. But it seems to be most effective solution for now (and
definitely more efficient than the previous solution). Plus there is a
precedence - we already use window.tinyMCE in formchangechecker.js YUI
module, for example.
Probably as a result of recent changes in the way how forms client side
validators are trigerred (MDL-52826), the field validator has been
triggered before the underlying textarea's values property is updated by
TinyMCE. This led to marking such a field as "required" even if the
value is provided.
Inspired by http://stackoverflow.com/questions/2122085/
this patch adds a new onchange callback that automatically keeps the
underlying textarea synced with the editor iframe. Relevant API docs:
http://archive.tinymce.com/wiki.php/Configuration3x:onchange_callback
I was also trying to call the save() method via the editor's onSubmit
method but that one seems to be also triggered only after the validator.
Copying from one atto editor to another comes with a lot of style
information. This removes the color attributes which make the page
look ugly when competing with different themes.
1. Browserkit doesn't handle [] in name
2. Grades are not visible in viewport and might fail
with few drivers, increasing size of window to ensure
grades are visible and can be modified.
3. Click edit first to see grade link
4. Expand fields before setting value
5. Updated xpath, as crawler update it.
6. Hover fails to show icon
Atto bold using behat with phantomjs doesn't work.
In this case there is no need to test plugin functionality.
Only checking if plugin is loaded in toolbar is sufficient.
This just deletes all the upgrade steps previous to 2.7.0. Some
small adjustments, like adding missing MOODLE_INTERNAL or tweaking
globals can also be applied when needed.
Next commit will get rid of/deprecate all the upgradelib functions
not used anymore in codebase.