300 Commits

Author SHA1 Message Date
Damyon Wiese
7e8d4dac9b MDL-50308 tool_lp: Big javascript cleanup
This includes:
* Move all JS modules from lib/amd to admin/tool/lp/amd
* Add all jsdocs
* fix all jshint warnings
* Rewrite the actionmenu wrapper to a real amd module
2016-04-18 10:58:32 +08:00
Damyon Wiese
d9a39950b2 MDL-49459 Learning plans: Support for creating and editing competency frameworks.
This includes an API (\tool_lp\competency_api), a set of web services, unit tests for the web services and a nice UI built as an admin tool.
2016-04-18 10:58:32 +08:00
Damyon Wiese
c2f30eeddb MDL-49264 Javascript: Add a simple version of dragdrop reordering
This is done in YUI with an AMD wrapper.
2016-04-18 10:58:32 +08:00
Damyon Wiese
61ddd5ecd4 MDL-49263 Javascript: Add an AMD wrapper for actionmenus 2016-04-18 10:58:32 +08:00
David Monllao
101303034f Merge branch 'wip-MDL-16855-master' of https://github.com/marinaglancy/moodle 2016-04-13 09:51:35 +08:00
Eloy Lafuente (stronk7)
11c673f3a3 Merge branch 'MDL-53167-master' of git://github.com/merrill-oakland/moodle 2016-04-12 21:34:41 +02:00
David Monllao
212153767a Merge branch 'wip-MDL-52707-master' of https://github.com/marinaglancy/moodle 2016-04-12 14:34:11 +08:00
Dan Poltawski
5702a8289b Merge branch 'MDL-52954-master' of git://github.com/damyon/moodle 2016-04-11 09:52:40 +01:00
Marina Glancy
1e34257ec2 MDL-16855 tags: allow to filter tags on management page 2016-04-11 10:04:17 +08:00
Marina Glancy
0d2027896d MDL-52707 core_tag: allow to combine tags 2016-04-11 09:49:56 +08:00
Eric Merrill
427e3cbcd6 MDL-53167 search: Add ability to limit courses searched 2016-04-07 14:41:59 -04:00
Dan Poltawski
88e8e6006f Merge branch 'MDL-53633-master' of git://github.com/andrewnicols/moodle 2016-04-05 09:40:41 +01:00
Andrew Nicols
efaf5c0570 MDL-53056 JS: Whitespace fix 2016-04-05 14:58:57 +08:00
Andrew Nicols
2697ece323 Merge branch 'MDL-53056-master' of git://github.com/damyon/moodle 2016-04-05 14:57:26 +08:00
Damyon Wiese
bb690849c9 MDL-52954 assign: Rebuild the assignment single grade page. 2016-03-30 13:47:21 +08:00
Damyon Wiese
1fca8a7bdd MDL-53056 javascript: Improve the fragments API
Instead of injecting the HTML + JS directly - return a promise that is resolve with
the HTML and JS. This gives the caller control over how and when to inject the nodes
in the DOM. Also modify templates.replaceNode functions to cleanup YUI events mess.
Also pass the context to the callback so it can be verified.
Also pass the arguments to the callback as a named array - not a flat argument list.
Also - only load external scripts if they are not already loaded.
2016-03-30 11:48:38 +08:00
Andrew Nicols
9c048e21ac MDL-53633 javascript: Ensure that ordering of options is preserved 2016-03-29 15:47:00 +08:00
David Monllao
0ae7fa12ac Merge branch 'wip-MDL-52760-master' of https://github.com/marinaglancy/moodle 2016-03-29 12:55:46 +08:00
David Monllao
b5335149f4 Merge branch 'wip-MDL-53254-master' of https://github.com/marinaglancy/moodle 2016-03-23 09:17:11 +08:00
Marina Glancy
cbecc3c35a MDL-53254 tags: little fixes after review 2016-03-22 17:10:34 +08:00
Adrian Greeve
1549528a67 MDL-53458 lib: Upgrade Mustache.js to 2.2.1 2016-03-18 09:31:49 +08:00
Marina Glancy
eb97811bee MDL-52760 forms: notify form changes in autocomplete element 2016-03-18 08:16:55 +08:00
Marina Glancy
21d9596cca MDL-53254 tags: tags management inplace editable 2016-03-18 08:07:19 +08:00
Marina Glancy
352bfbf55c MDL-53254 tags: tag collections inplace editable 2016-03-18 08:07:19 +08:00
Marina Glancy
131b78b9a7 MDL-53254 tags: tag areas inplace editable 2016-03-18 08:07:19 +08:00
Damyon Wiese
6f326bd204 MDL-27628 enrol_meta: Use new multi-course selector
Allows adding multiple instances of the meta enrol plugin at once.

I had to add support to the autocomplete element for filling the field from behat
when it was not using tags. I also had to make the shortnames more easily searchable
and unique in the behat feature file.
2016-03-09 13:32:08 +08:00
Damyon Wiese
91ab264cf5 MDL-51324 forms: fix autocomplete element double selection bug
Incorrect types were preventing the currently selected values from
being removed from the new values returned via ajax.

Also fix a selection bug with autocomplete+ajax+singleselect.
2016-03-09 13:30:27 +08:00
Damyon Wiese
235ef57a3d MDL-51324 forms: Add a new course selector
This is a squashed commit containing a number of changes:

This is an ajax driven course selector that has searching etc. It can select single, or multiple courses.
Make course selector accept a list of courses to exclude
courseselector - lookup coursename on setValue
Use the get_course_display_name_in_list function to generate the course names
Add a throttle to auto-complete to reduce spamming the server
Do a single query to fetch all the courses in the mform element when validation fails
Fix core course search function to return results when there are less than 2 chars in the query.
Handle setData with an empty array in new course selector
2016-03-09 13:30:18 +08:00
Andrew Nicols
889b92c1c0 Merge branch 'MDL-53291_ajax_fix' of https://github.com/BenKelada/moodle 2016-03-08 07:43:31 +08:00
Andrew Nicols
c1cb65d470 MDL-30811 javascript: alert JS should be in template
By moving the JS required for an alert to the JavaScript we make it
possible for themers to use frameworks other than bootstrap if they so
wish.
2016-03-03 15:09:17 +08:00
Andrew Nicols
11a67b211b MDL-30811 javascript: Lazily load core dependencies
To prevent possible race conditions, we lazily load the templates, and ajax
dependencies.
2016-03-03 14:47:07 +08:00
Ben Kelada
023d6a6756 MDL-53291 javascript: fix jquery ajax requests when data contains ??
jQuery ajax requests containing multiple '?' get replaced with a
string similar to jQuery152330039032_1231231, this is because it
is processing a stringified data object as jsonp and thinks its a url.
 workaround is to add contenttype
see https://github.com/jquery/jquery/issues/1799
2016-03-03 09:15:24 +11:00
Eloy Lafuente (stronk7)
df190d18a1 MDL-52136 mod_forum: fix some out-of-sync stuff
Thanks CIs!
2016-03-02 05:42:29 +01:00
Eloy Lafuente (stronk7)
ce878562f3 Merge branch 'MDL-52136-master' of git://github.com/andrewnicols/moodle 2016-03-02 05:25:57 +01:00
Andrew Nicols
0b4bff8ca9 MDL-52136 core: Add support for quoting variables in mustache helpers
This is required for when helpers include json-encoded variables as arguments.
As an example, imagine a template with content:

{{# str }} somekey, someidentifier, { "fullname": "{{ fullname }}" } {{/ str }}

If the fullname variable were to include the double-quote character (e.g.
John "Trevor" Doe) because of the way in which mustache renders content, it
would become:

{{# str }} somekey, someidentifier, { "fullname": "John "Trevor" Doe" } {{/ str }}

This results in an invalid JSON structure.

To work around this issue, the quote characters in the passed variable
must be escaped:

{{# str }} somekey, someidentifier, { "fullname": "John \"Trevor\" Doe" } {{/ str }}

Unfortunately, Mustache provides no way of doing so natively.

With this function, we can quote the text as appropriate:

{{# str }} somekey, someidentifier, { "fullname": {{# quote }}{{ fullname }}{{/ quote }} } {{/ str }}

This also handles the case where the quoted content includes the Mustache
delimeter ({{ or }}).

For example:
fullname = 'John "}}Trevor{{" Doe'

Ordinarily this would be rendered as:
{{# str }} somekey, someidentifier, { "fullname": "John "}}Trevor{{" Doe" } {{/ str }}

This rendering is both a JSON error, and also a mustache syntax error because of the mustache delimeters.

The quote helper also escapes these by wrapping them in change delimeter
tags:

{{# str }} somekey, someidentifier, { "fullname": "John "{{=<% %>=}}}}<%={{ }}=%>Trevor{{=<% %>=}}{{{{=<% %>=}}" Doe" } {{/ str }}
2016-03-02 08:48:46 +08:00
Eloy Lafuente (stronk7)
d9dfc410ad Merge branch 'wip-MDL-53172-master' of https://github.com/marinaglancy/moodle 2016-03-01 01:59:31 +01:00
Andrew Nicols
0346323cec MDL-30811 output: Add support for session notifications 2016-02-29 09:05:56 +08:00
Andrew Nicols
490934a4ed MDL-53172 javascript: Fix coding style violations 2016-02-27 11:29:27 +08:00
Andrew Nicols
38cf8b6661 MDL-53172 javascript: Stop requiring body manipulation on load 2016-02-27 11:29:27 +08:00
Marina Glancy
8de48ad0ae MDL-53172 core: toggle and select in inplace_editable 2016-02-27 11:29:24 +08:00
David Monllao
69d66020ce MDL-31989 search: get_config method to search areas
Also content_to_text moved to weblib.
2016-02-23 10:47:59 +00:00
David Monllao
db48207e1a MDL-31989 search: Search API and search engine API
Introducing both APIs in moodle along with:
- search_box widget to add a tiny search box
- admin settings with setup steps helper
- cache for search results
- template for a search result
- php unit stuff

Many thanks to Tomasz Muras, Prateek Sachan and Daniel Neis for their contributions, for starting this development
and for pushing for it to be completed. Also thanks to other contributors: Jonathan Harker and eugeneventer.
2016-02-23 10:47:58 +00:00
Marina Glancy
cdc5f9785b MDL-51802 core: new template for quick editing a title
convert editing tag name to use new template
2016-02-13 11:07:42 +08:00
Dan Poltawski
96c69429e5 Merge branch 'wip-MDL-52715-master-additional' of git://github.com/abgreeve/moodle 2016-02-03 09:44:27 +00:00
Adrian Greeve
a2161d57a4 MDL-52715 lib: Clean up of comments and variable names. 2016-02-03 10:07:08 +08:00
Marina Glancy
e11d7380c2 MDL-51283 core_tag: change tagtype to isstandard
Change 'official' to 'standard' in UI
2016-02-02 17:31:14 +08:00
David Monllao
d23bf21b0a MDL-52715 js: Merge M.str and clean memory 2016-02-01 14:29:09 +08:00
Adrian Greeve
cc73ea075e MDL-52715 lib: Addition of new requirements class.
This adds a fragment requirements class to allow plugins
to register JavaScript to be used in an mform.
2016-02-01 14:29:09 +08:00
David Monllao
ed654d4aa8 MDL-35590 block_navigation: Set attribute on node creation
Otherwise we would need to unescape href and title.
2016-01-29 13:01:26 +08:00
John Okely
a057ba5924 MDL-35590 navigation: Remove link from admin node if you have javascript
Also:
* In behat, ensure nav node exists before checking attribute (Credit to
  Rajesh Taneja)
* Remove some unused JS constants
* Fix debugging notice for users without settings block
2016-01-29 11:28:08 +08:00