395 Commits

Author SHA1 Message Date
Jun Pataleta
cb7263feb0 Merge branch 'MDL-64573-master' of git://github.com/damyon/moodle 2019-04-26 10:50:55 +08:00
Damyon Wiese
260565e305 MDL-64573 output: ajax form event
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.
2019-04-24 16:17:49 +08:00
David Monllaó
906800a082 Merge branch 'MDL-65102-master' of git://github.com/rezaies/moodle 2019-04-23 13:42:37 +02:00
Damyon Wiese
cdc7390446 MDL-64331 modals: Be careful closing modals
Don't close a modal when the user clicks outside of it and the modal contains a form.
2019-04-02 10:02:26 +08:00
Shamim Rezaie
072a033a79 MDL-65102 core_form: autocomplete element to handle submit event 2019-03-27 19:00:27 +11:00
Simey Lameze
545e2abb91 MDL-63244 core: make mustache retrieve language 2019-03-19 15:03:51 +08:00
Marina Glancy
76f2d89471 MDL-10965 course: search only courses with completion
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
2019-04-10 12:35:29 +02:00
Damyon Wiese
b0d4560634 MDL-64819 output: Hide icons with no title
When output from javascript they should match what gets output from php.
2019-04-08 14:34:15 +02:00
Eloy Lafuente (stronk7)
e3d78a7c8d Merge branch 'MDL-63937-master' of https://github.com/HuongNV13/moodle 2019-03-06 13:30:39 +01:00
Andrew Nicols
507d05f6e3 Merge branch 'MDL-64376-master-2' of git://github.com/ryanwyllie/moodle 2019-02-27 11:51:14 +08:00
Ryan Wyllie
3edde4fbe8 MDL-64376 recentlyaccessedcourses: improve displaying of courses 2019-02-27 10:58:02 +08:00
Davo Smith
08163b2067 MDL-52167 admin: display dependencies in search results 2019-02-26 15:45:53 +01:00
Davo Smith
d940855f92 MDL-52167 admin: switch hide_if() to use hide() + update upgrade.txt 2019-02-26 15:45:44 +01:00
Davo Smith
8ed3671d4c MDL-52167 admin: now able to show/hide settings based on conditions 2019-02-26 15:45:35 +01:00
Huong Nguyen
efef2efdd6 MDL-63937 autocomplete: Add the indicator when processing the request 2019-02-21 10:08:16 +07:00
Andrew Nicols
df5feea490 MDL-63937 autocomplete: Add a loading icon when fetching via AJAX 2019-02-21 10:08:16 +07:00
Andrew Nicols
270fd3f5e4 MDL-63944 Question: Convert toggle all to generic module 2019-02-15 10:07:08 +07:00
Andrew Nicols
9626e56812 MDL-64835 JS: Reduce cache invalidation checks
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).
2019-02-13 10:13:05 +08:00
Andrew Nicols
dd663b41bc MDL-64835 JS: Stop using the jsrev in the jsrevPrefix
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.
2019-02-13 10:11:42 +08:00
Eloy Lafuente (stronk7)
3901fd74ba Merge branch 'MDL-64649-master' of https://github.com/felicemcc/moodle 2019-02-04 16:35:22 +01:00
Felice Candilio
c4ddf40612 MDL-64649 amd: Removing underscores from icons in [Roles/Groups] forms 2019-01-31 10:55:53 +01:00
Andrew Nicols
bebb976b99 MDL-62514 behat: Inplace editable pendingjs wrapper 2019-01-30 08:24:32 +08:00
Andrew Nicols
e994dea0b3 MDL-62514 behat: Rewrite handling of autocomplete
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.
2019-01-30 08:24:32 +08:00
Andrew Nicols
024b5c5b9f Merge branch 'MDL-63722-master' of git://github.com/rezaies/moodle 2019-01-08 12:04:19 +08:00
Ryan Wyllie
c77ba4890a MDL-64348 javascript: change template loading to a buffer
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.
2019-01-07 09:03:06 +08:00
Ryan Wyllie
2b92891a88 MDL-64348 javascript: change template loading to also load dependencies
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.
2019-01-07 09:03:06 +08:00
Ryan Wyllie
fbbed5c603 MDL-64348 javascript: add cache_strings to str.js
Added a function to allow a set of strings to be added to the
str.js caches if they've been loaded outside of that module.
2019-01-07 09:03:06 +08:00
Shamim Rezaie
b6ece79d81 MDL-63722 javascript: misinterpret as outside click if DOM is modified 2018-12-19 16:01:09 +11:00
Mirko Otto
5cfd7a7286 MDL-62756 form: Remove any click handler first.
The handler has the old state variable. Remove any click handler first.
2018-12-14 10:26:58 +01:00
Andrew Nicols
23e347bb32 MDL-64181 core: Ensure that self is included in parentage 2018-11-27 14:42:40 +08:00
Damyon Wiese
a2cb00b655 MDL-64181 javascript: Recursive template fix
This change prevents template rendering from waiting for itself, but does
allow it to wait for another async call to render.
2018-11-27 08:44:36 +08:00
Andrew Nicols
ff85fe3e53 Merge branch 'MDL-63793-master' of git://github.com/peterRd/moodle 2018-11-19 09:57:50 +08:00
Peter
11988d74b4 MDL-63793 block_myoverview: Persist the user's paging limit preference
* providers for paging preferences
* Moved the user pref persistence to the factory
* Added client defined namespace in config
* Define custom client events in the client instead of passing to the
  factory
2018-11-19 09:43:00 +08:00
Ryan Wyllie
5005d8cfb4 MDL-63303 message: add message drawer (boost only) 2018-11-15 14:43:21 +08:00
Ryan Wyllie
9d199fd2e7 MDL-63303 javascript: fix bug in auto_rows.js allowing it to shrink 2018-11-15 14:40:11 +08:00
Andrew Nicols
6d0a43deb9 Merge branch 'MDL-63763-master' of https://github.com/nwp90/moodle 2018-11-12 10:32:32 +08:00
Peter
fd955097e4 MDL-63457 block_myoverview: JS update to avoid constant network requests
* Expose paged content factory to trigger last page updates
* Remove repetitive network requests on hide/show courses
* Manually do paged dataset modification
2018-11-01 13:36:52 +08:00
Bas Brands
fd68f5a9e0 MDL-63457 block_myoverview: Rerender the paged content and jump
Jump to the page the user was last on after hiding
2018-10-29 08:36:59 +08:00
Nick Phillips
2070142f46 MDL-63763 javascript: don't have define( in AMD comments at top of files 2018-10-25 16:21:35 +13:00
Eloy Lafuente (stronk7)
19dbce00a1 Merge branch 'MDL-63714-master' of git://github.com/andrewnicols/moodle 2018-10-25 00:10:45 +02:00
Andrew Nicols
eb514bb3e5 MDL-63714 javascript: Add new core/pending module 2018-10-24 12:49:09 +08:00
Andrew Nicols
66de50c366 Merge branch 'wip-MDL-62411-master' of https://github.com/timhunt/moodle 2018-10-24 10:21:42 +08:00
Andrew Nicols
4b7ad8845c MDL-63714 core: Wrap doRender in pendingjs 2018-10-24 08:12:10 +08:00
David Monllao
d10643fbe6 Merge branch 'MDL-63625-master' of git://github.com/marinaglancy/moodle 2018-10-22 14:41:12 +02:00
Tim Hunt
ed7e30fa5c MDL-62411 qtype_ddmarker: further improvements following code review 2018-10-20 15:18:17 +01:00
John Beedell
0b1cc2890f MDL-62411 qtype_ddmarker: add dragdrop helper libarary
This was created by the Open University a couple of years ago, and is
very helpful for making dragging work reliably on a range of browsers
and with both mouse and touch-screens.

Sadly, HTML5 drag-drop is not yet ready for prime-time.
2018-10-20 15:15:23 +01:00
Andrew Nicols
61e0f58ca3 MDL-63667 amd: Check for parent template recursion 2018-10-18 12:04:19 +08:00
Damyon Wiese
b51c5b929f MDL-63667 output: Fix for recursive templates
A template can include itself - e.g. by looping over the context children and rendering a tree.

Ensure this promise still resolves.

Example: admin/tool/lp/templates/competencies_tree.mustache.
2018-10-18 10:48:01 +08:00
Ryan Wyllie
0015f5b8f1 MDL-63667 javascript: fix failed to pre-fetch the template error 2018-10-17 13:49:25 +08:00
Marina Glancy
d8c50267b9 MDL-63625 core: sortable_list iOS scrolling
For iOS we need to register non passive events not only for touchstart but also for touchmove
and touchend. Also iOS could open two move dialogue windows instead of one
2018-10-11 15:08:46 +02:00