This allows for better caching capabilities on servers. If a
cache key is passed and the web service call does not require
the user to be logged in we will attempt to use GET for the
request. This allows for things like proxy caching on URLs.
The cache key must be changed if we do not want to retrieve
what has been cached and want to perform the request again.
* Use the 'starts with' selector when matching toggle groups by name in
non-exact mode to avoid potential conflicts with other toggle groups.
* Note down the required data attributes for JS in the template
documentations.
* Add a note of this output component in upgrade.txt.
* Add doc blocks for the core/checkbox-toggleall attributes and methods.
After showing a warning, if the "extend session" button is clicked too late,
tell them their session is expired so they can collect any unsaved data in the page.
Add an event that can be fired when an mform is about to be submitted via ajax.
This allows custom field types to perform an action when the form is submitted.
The atto text editor will reset any autosaves when the form is submitted.
it is quite often when we need to have an autocomplete element that searches courses that
have completion enabled. This commit adds an option for the 'course' form element, and also
changes two places where we search for courses with completion. This should fix MDL-58989
The cache invalidation check was previously occuring every time either
the `set` or `get` function was called on the cache. However, the cache
invalidation check is based on the jsrev which is static for the
lifetime of the page.
This change moved the invalidation to happen during the setup of the AMD
module such that it only happens one time per storage type (Local +
Session).
We only use the jsrevPrefix to determine if the cache should be
invalidated, but the prefix that we were using is based on the new
jsrev.
For example, the jsrevPrefix will be:
hash(wwwroot + '/ + config.jsrev) + '/jsrev'
Where config.jsrev is the _current_ (new) jsrev.
As a result when searching for the jsrev used to store the data which is
currently in the storage cache, no key is returned, and we instead set
an 'initial' value and the cache is not cleared
This patch changes the jsrevPrefix to be:
hash(wwwroot) + '/jsrev'
Since the wwwroot does not change, the key remains static for the
current site. As a result, when the jsrev is bumped via a Moodle cache
purge, we are able to correctly fetch the old jsrev from the cache,
determine that the jsrev has changed, and purge the cache.
This includes a minor restructure of the autocomplete JS to make use of
promises and improve tracking of pending JS.
In particular it improves the way in which throttled text input is
handled to ensure that the behat does not continue until:
- typing is fully complete; and
- all possible ajax requests have been sent; and
- all possible ajax requests complete; and
- the suggestions are updated.
A number of conditions existed where behat would move on to the next
step too early in a race condition effect between Behat and Autocomplete.
Changed the template loading to buffer the requests for templates
so that they can be sent in batches to the server to save large
volumes of network requests.
Changed the getTemplate function in templates.js to use the
core_output_load_template_with_dependencies function to load the
requested template and all of the dependencies required to render it.
The dependencies are added to the relevant caches so that when the
template is rendered they aren't re-requested from the server.