255 Commits

Author SHA1 Message Date
Damyon Wiese
ddc1482026 MDL-59527 autocomplete: Don't fetch ajax twice 2017-07-20 09:52:05 +08:00
David Monllao
7d04eaca5c Merge branch 'MDL-59527-master' of git://github.com/damyon/moodle 2017-07-17 14:07:59 +02:00
Damyon Wiese
47dd535097 MDL-59527 forms: Race cond with ajax autocomplete
Sometimes (rarely) the auto complete will show "No suggestions" when there are valid suggestions.
2017-07-14 12:41:14 +08:00
David Monllao
eac6f51590 Merge branch 'MDL-59368-master' of git://github.com/damyon/moodle 2017-07-12 16:46:49 +02:00
David Monllao
9e548756cf Merge branch 'MDL-59384-master-final' of https://github.com/lameze/moodle 2017-07-12 14:12:53 +02:00
Simey Lameze
97c4a29d41 MDL-59384 core_modal: trigger bodyRendered event
Part of MDL-59333.
2017-07-12 19:57:22 +08:00
Simey Lameze
f02e119afd MDL-59383 core_modal: trigger event on modal module 2017-07-12 18:57:55 +08:00
Simey Lameze
d4a87aa370 MDL-59383 core_modal: trigger event on modal module 2017-07-12 18:28:11 +08:00
Damyon Wiese
f3ecea3af4 MDL-59368 groups: Peer review fixes
* Fix coalesce on postgres.
* The edit icon's alt shows the HTML entities causing
* enrol/tests/behat/add_to_group.feature Contains a '@doit' tag which I assume is there from testing.
* group/classes/output/user_groups_editable.php
** Missing MOODLE_INTERNAL check.
** Unused variables context_system and moodle_exception.
** The PHPDocs for the constructors are wrong.
** export_for_template() returns an array, not stdClass (according to parent docs).
** Change moodle_exception to coding_exception at the beginning.
* group/lib.php
** Missing docs for core_group_inplace_editable().
* user/classes/participants_table.php
** The docs for the class variables $groups, $course and $context need a '\' beforehand as they are in a namespace.
** I would prefer $this->context = $context; and $this->groups = ... to be done at the end of the constructor with the other class variable assignments.
** You could get rid of the class variable courseid if we are setting course and use $this->course->id instead.
** The function col_groups has @param \stdclass $row but it should be $data
* lib/amd/src/form-autocomplete.js and lib/amd/src/inplace_editable.js
** Some issues here CiBot has pointed out.
* lib/classes/output/inplace_editable.php
** @see should be on a new line.
2017-07-12 10:09:09 +08:00
Damyon Wiese
13426bae93 MDL-59368 inplace_editable: Focus on auto-complete
Also fix JS coding style and build the amd.
2017-07-12 10:07:58 +08:00
Damyon Wiese
5a90a7cabe MDL-59368 groups: Add an explicit cancel button
Autocomplete already uses Escape keyboard handler - so we can't use it to cancel an edit-inplace thing.
Make an obvious cancel button instead.
2017-07-12 10:07:57 +08:00
Damyon Wiese
2fa35b8d16 MDL-59368 groups: Inplace editing for users groups 2017-07-12 10:07:57 +08:00
Damyon Wiese
2e1615f2c0 MDL-59365 eslint: Noop changes for eslint 2017-07-11 13:48:26 +01:00
Damyon Wiese
786e014c5c MDL-59365 autocomplete: Keep the suggestions open
If the list allows multiple selections, don't auto-close the suggestions list
every time something is chosen.
2017-07-11 13:47:28 +01:00
Damyon Wiese
a60e8ba51e MDL-59365 enrol_manual: Rewrite the yui enrolment popup in amd
The add/roles thing was only converted to bootstrap 2/4 markup and the yui left in place.

The modal for adding users to a course was unsavable so I rewrote it with an mform in a popup, still calling
the same (barely) modified ajax script.

The webservice for searching cohorts was taken from admin/tool/lp and moved into /cohort. I added a generic "cohort"
mform element at the same time.

The webservice for searching for users was taken from the original ajax script.
2017-07-11 13:47:26 +01:00
John Okely
6bdcaa1320 MDL-59312 notification: Normalise backtrace/stacktrace 2017-06-23 10:43:56 +08:00
Andrew Nicols
fa038116bc MDL-59312 js: Add exception on AJAX error 2017-06-23 10:42:22 +08:00
John Okely
671be2bedb MDL-58310 ajax: suppress errors upon page unload 2017-06-19 11:31:24 +08:00
Dan Poltawski
50c277a5d8 MDL-57139 js: built 2017-06-01 14:54:40 +01:00
Dan Poltawski
751ec02540 MDL-57139 amd/templates: catch unhandled promise failure 2017-06-01 14:54:39 +01:00
Dan Poltawski
4276f9c717 MDL-57139 amd/user_date: always return 2017-06-01 14:54:39 +01:00
Dan Poltawski
e58ecca175 MDL-57139 core/fragment: simplify promises and always return
We can remove the DIY promise handling because the ajax request can just
return a promise itself.
2017-06-01 10:27:59 +01:00
Dan Poltawski
bcf69a655a MDL-58837 js: fix jsdoc error 2017-05-11 14:29:11 +01:00
Marina Glancy
f24e17c93e MDL-58837 course: allow to add multiple sections 2017-05-11 18:48:04 +08:00
Dan Poltawski
f0572ad21f Merge branch 'MDL-58760-master-pixescape' of git://github.com/mudrd8mz/moodle 2017-05-01 11:25:39 +01:00
David Mudrák
74e238f4b7 MDL-58760 templates: Make {{#pix}} helper work with escaped icon key
There is a difference between how our PHP mustache engine and JS
mustache engine escaping works. If the icon key is not hard-coded in the
template but defined as a context variable, the JS mustache engine
escapes the forward slashes.
2017-04-28 23:04:04 +02:00
David Mudrák
f387058839 MDL-58698 js: Fix the detection of the moodle language
This is the same problem that we had in MDL-52486. When the language
pack with multiple underscores (such as "en_us_k12") is selected, the
html root element's "lang" attribute is set to

    <html lang="en-us-12" ...>

which we then map back to the Moodle lang code using the JS function
replace().

What was missed in MDL-52486 was that when replacing a value (and not a
regular expression), only the first instance of the value is replaced.
So the value "en_us-k12" was sent as the lang parameter for the
core_string, which is invalid PARAM_LANG value and the exception was
thrown.

In case of the user_date.js, there was no actual problem experienced and
probably there is none as the language code is used as a cache key
rather than a PARAM_LANG parameter. But we are changing it too for
consistency.
2017-04-26 18:47:10 +02:00
Tim Hunt
c1ac8e7fbf MDL-58555 ajax: make ajax web service log entries more useful
It is not used for anything, but we put the method name(s) being called in the URL.
2017-04-10 16:29:16 +01:00
Ryan Wyllie
e03d5d4790 MDL-57445 core: allow context variables in pix helper
Allow the user of context variables in the id and component section of
the pix helper.

Part of MDL-55611 epic.
2017-04-03 11:35:37 +08:00
Dan Poltawski
dca0ea03b1 Merge branch 'MDL-58317-master' of git://github.com/damyon/moodle 2017-03-21 08:03:42 +00:00
Damyon Wiese
8626dc99fa MDL-40759 fontawesome: Add BC for unmapped icons
This is yukky but it works. Note: I had to duplicate the standard pix icon template
inside the font-awesome one because the way this is rendered does not support partials.
2017-03-20 13:47:30 +08:00
Damyon Wiese
f4e623b3e7 MDL-58317 templates: Fix async template render
There is an edge case where we do not wait for all promises before
rendering a template. This can generate "failed to pre-fetch the template" JS errors.
2017-03-20 13:29:09 +08:00
Damyon Wiese
42d4689c65 MDL-40759 fontawesome: Minor cleanups
Remove eslint hints that are not required and revert changes to the
behat test for recycle bin that are not needed.
2017-03-17 15:52:46 +08:00
Damyon Wiese
b9b409cfc3 MDL-40759 icons: Peer review fixes (all minor) 2017-03-17 15:52:46 +08:00
Damyon Wiese
1caabd8468 MDL-40759 icons: Keep separate alt/title
For font awesome icons I had only supported one of alt/title. This was because (subjectively) we have
done a terrible job of providing meaningful alt text for icons. This is not a good idea and not backwards
compatible so I have put it back again.

Fingers crossed I did not break 1000 behats.
2017-03-17 15:52:18 +08:00
Damyon Wiese
8857c715d1 MDL-40759 icons: Behat fixes for font-awesome 2017-03-17 15:52:18 +08:00
Damyon Wiese
e330b1c214 MDL-40759 icons: Refactor to allow theme icon systems 2017-03-17 15:52:18 +08:00
Damyon Wiese
7776c9e112 MDL-40759 icons: Fix when icon map comes from cache 2017-03-17 15:52:17 +08:00
Damyon Wiese
95b06c13c6 MDL-40759 icons: Refactor icon system to be extensible. 2017-03-17 15:51:29 +08:00
Andrew Nicols
e2310e4361 Merge branch 'MDL-57975-master' of git://github.com/ryanwyllie/moodle 2017-03-10 18:04:42 +00:00
Ryan Wyllie
0e5b3e282f MDL-57975 javascript: add userdate mustache js helper
Part of MDL-55611
2017-03-08 03:33:24 +00:00
Ryan Wyllie
b61015cfcd MDL-57975 javascript: add user_date.js
Part of MDL-55611
2017-03-08 03:33:23 +00:00
David Monllao
68aab93ea5 Merge branch 'MDL-57280-master' of git://github.com/ryanwyllie/moodle 2017-03-07 13:13:51 +01:00
Ryan Wyllie
75378ded5f MDL-57972 mustache: add shortentext template helper
Part of MDL-55611
2017-03-07 06:33:56 +00:00
Ryan Wyllie
180f5f23a6 MDL-57972 javascript: add upgrade instructions for truncate.js
Part of MDL-55611
2017-03-07 06:33:56 +00:00
Ryan Wyllie
7172b33e24 MDL-57972 javascript: Change truncate.js behaviour
Updated truncate.js to behave closer to the moodle implementation of
shorten_text.

Part of MDL-55611
2017-03-07 05:22:38 +00:00
Ryan Wyllie
d74d91f49a MDL-57972 javascript: Add truncate.js third party lib
Part of MDL-55611
2017-03-07 05:22:34 +00:00
Ryan Wyllie
b6563dcfc3 MDL-57975 javascript: add sessionstorage.js
Part of MDL-55611
2017-03-07 01:29:13 +00:00
Ryan Wyllie
0531ce1a29 MDL-57280 javascript: add modal registry
Add a modal registry for the types and make the factory use it to allow
code to register modal types at run time and use the factory for
non-core modals.
2017-02-27 01:05:44 +00:00
Dan Poltawski
cf8c463de6 Merge branch 'MDL-57009-master' of git://github.com/damyon/moodle 2017-02-07 12:32:34 +00:00