197 Commits

Author SHA1 Message Date
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
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
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
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
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
Damyon Wiese
3d6ae65b61 MDL-57009 javascript: Reject on all errors
Not all error paths were resulting in a reject() call to fail a promise.
2017-02-07 15:36:48 +08:00
Damyon Wiese
f3cd5c5b7b MDL-57009 javascript: Always use when.apply
Or it does not really wait for the promises.
2017-02-07 15:03:43 +08:00
Eloy Lafuente (stronk7)
f65a48c50e Merge branch 'MDL-53349-master' of https://github.com/xow/moodle 2017-02-06 16:06:25 +01:00
Damyon Wiese
b302369d17 MDL-57009 javascript: cibot nagging 2017-02-02 15:54:19 +08:00
Damyon Wiese
39bf2a985b MDL-57009 javascript: Dont rely on async ajax
Recursively pre-scan mustache templates to extract the list of blocks and partials. Then
we can pre-fetch them all and don't have to rely on jquery async ajax (which is deprecated).

This is part of a refactoring of the promises code in the templates module to prevent duplicate requests.
2017-02-02 15:54:19 +08:00
Damyon Wiese
f20a336b43 MDL-57009 js: Do not fetch the same template twice
Also clean up promises use of done vs then.
2017-02-02 15:54:19 +08:00
Damyon Wiese
dcdf7c6155 MDL-57009 js: Skip ajax request for same string
This is done by caching the first promise generated to fetch a string.
2017-02-02 15:54:19 +08:00
Nadav Kavalerchik
e375029ea0 MDL-53349 Autocomplete: Support multi lingual COMMA keycode (44) 2017-02-01 16:00:41 +08:00
Dan Poltawski
e7ecb4a90f MDL-57690 js: fix core modal uses in amd
Converting the uses to the AMD modules is a bit risky for now, instead
just require the YUI depdency.
2017-01-26 11:28:59 +00:00
Simey Lameze
7d17256a75 MDL-57194 core_charts: Allow colors to be overridden by setting 2016-12-01 14:44:00 +08:00
Damyon Wiese
be2247fb24 MDL-56586 blocks: Do the addblock in a modal 2016-11-24 14:24:59 +08:00
Damyon Wiese
9d44510d60 MDL-57100 JS: Exceptions give exceptions
Exceptions returned from ajax are not in the format expected by the JS, so
an error occurs and the exception popups are not appearing.
2016-11-23 18:07:26 +00:00
Damyon Wiese
52a51514f6 MDL-56683 theme_boost: Popovers on dynamic content 2016-11-22 10:28:25 +08:00
Mark Nelson
ffd7798c96 MDL-56139 core: changes after peer review
- No longer use the Fibonacci sequence for delaying the timeout.
  It is too aggressive.
- The backoff_timer AMD module now expects the callback AND the
  backoff function to be passed to the constructor.
- Added ability to specify polling frequency in config.php.
- Added helper function to return the cache key.
- Reworded the parameters for clarity.
2016-11-16 10:22:52 +08:00
Ryan Wyllie
fb1469d84f MDL-56139 message: ajax poll for new messages in message area 2016-11-16 10:22:33 +08:00
Simey Lameze
cff1f90adf MDL-56792 core_charts: clean html content from title and labels
This commit add cleanData() and call it from all places that has labels or title
to guarantee that html content will not be printed on the chart.
2016-11-09 10:41:12 +08:00
Simey Lameze
fd5797aa3b MDL-55799 inplace_editable: add form-control class to fields 2016-10-28 15:04:54 +08:00
Andrew Nicols
ab00bf59a5 Merge branch 'MDL-56341-master' of git://github.com/damyon/moodle 2016-10-24 10:11:20 +08:00
Frédéric Massart
a89cf23744 MDL-56341 mustache: JS engines handles strings wrapped in quote
Prior to the patch the strings wrapped as the following one
where not found and replaced when rendering the template via Javascript

{{#quote}}{{#str}}string,component{{/str}}{{/quote}}
2016-10-20 12:13:42 +08:00
Mark Nelson
d4b2c195e1 MDL-54682 core: build amd modules 2016-10-11 14:39:24 +08:00