When clicked, disable the "Edit mode" button just before doing a
redirection. It's been reported that after clicling several times the
button, an inconsistent state between the button and the editing mode is
achieved. The patch mitigates the issue.
The reactive debug panel stops working when a new reactive instance is
created in the fly. This was not detected until the new dragf and drop
files into course uses a second reactive UI component in the same page.
This commit adds all the necessary CSS and logic to handle file dropping
into a reactive compoment. From now on, a reactive application can
handle both element drag&drop and file drop easily.
Create a new UI compoment to queue, execute and display errors on batch
processing. The first use of this component is when the teacher drops a
file into the course page.
Half of the times the normalise module is used is to get a single
element. However, because jQuery elements can contain multiple elements
the getList is always an array. Due to this in many ocasions we repeat
the getList(VAR)[0] line instead of having a more readable getFirst
method which only implies a couple of lines in the original code.
Changes in fbc2732d made the JS template string helper method
too strict in regards to what it considers a valid JSON object.
Co-authored-by: Mike Churchward <mike@brickfieldlabs.ie>
This commit makes the following changes:
* convert to use ES6 module format
* migrate from a jQuery Deferred to a native ES6 promise
* add a native-Promise-like instantiation
New uses are documented in appropriate jsdoc with examples.
When the param string contains a left curly bracket as the first character,
the system will assume the string is a JSON string and will be parsed and returned as an object.
But in some cases, the string is not JSON and will return an error if the system parses it.
For example, a user might have used the course name with a left curly bracket as the first character.
Adding a double quote after the left curly bracket to differentiate between string and JSON string,
so it can be safe to parse the string, and also added try..catch to ensure that the parsing creates an object type.
This case was left not changed @ MDL-72509, and detected by the
Moodle 4.1 apache logs review @ MDL-76064.
Not much to say, just switch to the core lang string, the other
is deprecated for 4.1 and up.