720 Commits

Author SHA1 Message Date
Dan Poltawski
3a0bc0fdc4 MDL-55244 js: build changes
There should be no changes to minified code
2016-07-25 07:58:05 +01:00
Dan Poltawski
bc8b6dc652 MDL-55244 js: fix various lint warnings in yui
* Incorrect brace style
* Empty functions
* Multiple var statemnts
2016-07-25 07:53:05 +01:00
Dan Poltawski
5bb4f444de MDL-55244 js: fix problems with eslint --fix
eslint --fix '**/yui/src/**/*.js'
2016-07-25 07:53:05 +01:00
Dan Poltawski
ad3f8cd18c MDL-54944 eslint: make the .eslintrc default stricter
Instead of using the more rollup-tolerant config for all files, make the
configuration stricter by default but lower in grunt for yui modules.

This means that manual runs (prechecker) or editor integrations will
flag up the errors as well as grunt.

Also add ignore lines to the core files so that eslint isn't noisy when
not running with grunt.
2016-07-11 12:44:34 +01:00
Eloy Lafuente (stronk7)
e40dd1cdcd MDL-54778 form: Make it all js style (eslint) compliant
The changes in this commit should not be problematic, just:

- different whitespace.
- some docs.
- 1 variable to camelCase.

And then, less trivial, but safe enough IMO:

- a change to camelCase some identifiers and their calculation.
2016-06-22 01:29:51 +02:00
Andrew Nicols
badbaa64e3 MDL-54778 form: Fix lots of issues with form dependencies
The original issue here was that each loop of the named values did not
check for prototypal properties. As a result, if there were input fields
with names such as 'sort', 'valueOf', 'constructor', etc. these would
return their prototypal functions instead of a falsy value, and be treated
as though they are array - hence the 'Cannot push to Function' type error.

Following on from this I discovered that the data stores were being created
as arrays, but used as objects. This can also cause issues with some form
input names -- e.g. if they are numeric.

These two issues were resolved together by correctly storing them in
objects, and checking that those objects had real properties
(hasOwnProperty). This itself has to use the prototypal function to cater
for the potential of a field name called 'hasOwnProperty'.

I also found that the instance value stores were being initialised in the
prototype (and therefore shared), which meant that there were numerous
issues if two forms were present on the same page, or one form replaced an
existing one (e.g. forms initialised in JS).

In addition, it also became apparant that several values were being used
outside of scope, or in the wrong scope. This caused further issues when
creating multiple forms on a page.
2016-06-21 07:58:13 +08:00
Marina Glancy
6ee5e596b8 MDL-54837 tags: fixed bug when collection is locked
also fixed fatal error for upgraded plugins that did not pass tag
component to the tag form element
2016-06-07 08:38:39 +08:00
Marina Glancy
4ca17b63a1 MDL-54666 modedit: use default values when modgrade element is frozen 2016-05-21 12:37:46 +08:00
Eloy Lafuente (stronk7)
973641fe13 MDL-54666 tests: Verify that any activity keeps the settings
This was affecting both to rateable (forum...) and not rateable
(assignment...) activities. So tests have been completed to verify
that now saving is performed and the correct scale values stored.
2016-05-20 23:48:25 +02:00
Frederic Massart
440b4c54ca MDL-53957 form: Support frontpage for selection in course element 2016-05-06 09:27:31 +08:00
Skylar Kelty
e594a6a8e9 MDL-53889 forms: Fix course field values after multiple value updates 2016-05-06 09:27:30 +08:00
Adrian Greeve
1a9068ae01 MDL-53888 mod_url: Choose a link option now works.
Fixed a regression from MDL-50484.
2016-05-06 09:27:28 +08:00
Damyon Wiese
821ab1bf9b MDL-52954 assign: Behat fixes because the assign grading ui has changed 2016-04-15 15:57:56 +08:00
Eric Merrill
427e3cbcd6 MDL-53167 search: Add ability to limit courses searched 2016-04-07 14:41:59 -04:00
Andrew Nicols
82eb2cf1be MDL-53577 JS: get_string requires component 2016-04-07 12:10:26 +08:00
Ben Tindell
a2fb838e82 MDL-53577 repository: Added maxbytes error message
Changing the error message that is displayed to users when they
upload a file that is greater than the maximum upload size. Does not
include all upload cases; focuses on those most used by students.
2016-04-04 15:33:40 -05:00
Rajesh Taneja
b73e5047af MDL-46891 core_grade: Steps are not valid as element is disabled 2016-03-11 10:51:16 +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
David Monllao
406151d8e2 Merge branch 'wip-mdl-53300' of https://github.com/rajeshtaneja/moodle 2016-03-08 16:13:42 +08:00
Rajesh Taneja
bdd4bed8b5 MDL-53300 core_grade: use currentgradetype if modgrade_type is not set
If mod has grades, then while upgrading
modgrade_type is disabled. This will not post
it with form and hence validation fails.
To avoid above problem, use ->currentgradetype
if modgrade_type is not set
2016-03-01 16:38:59 +08:00
Andrew Nicols
cf633c555e MDL-30811 form: Remove continue from test. 2016-03-01 12:11:10 +08:00
Rajesh Taneja
1ebda3eb8c MDL-50484 lib_formslib: Persistant input should have different id
Persistant input is appended for frozen elements
and should have different id then the actual element
2016-02-19 14:00:04 +08:00
Dan Poltawski
220f8115d9 Merge branch 'MDL-44626-master' of git://github.com/andrewnicols/moodle 2016-02-15 10:36:20 +00:00
Andrew Nicols
658a922fa6 MDL-44626 repository: Correct error message when uploading large files 2016-02-11 08:08:57 +08:00
Mark Nelson
1b8bd51c06 MDL-48634 core_form: added behat test for 'modgrade' validation 2016-02-09 17:46:42 +08:00
Mark Nelson
664d8be7ea MDL-48634 core: prevent change of grade values when necessary
Three additional checks have been added.

Once grades have been recorded for the activity/grade item -

1) Do not allow the grade type to be changed.
2) Do not allow the scale to be changed.
3) If we are using ratings do not allow the 'Maximum points'
value to be changed.

Also reordered form elements, removed form elements that
were not necessary, added and changed existing language
strings to improve the overall UI.
2016-02-09 17:46:42 +08:00
Damyon Wiese
e7c71c189b MDL-48634 grades: Make the rescaling option required if maxgrade changes 2016-02-05 18:20:17 +08:00
Damyon Wiese
d629c601c5 MDL-48634 grades: Add an option to rescale when changing the maxgrade 2016-02-05 18:20:17 +08:00
David Monllao
52ad3afadb Merge branch 'wip-MDL-51283-master' of git://github.com/marinaglancy/moodle 2016-02-02 17:40:39 +08:00
Marina Glancy
4be9c7ad99 MDL-51283 core_tag: Allow each tag area to set 'showstandard' 2016-02-02 17:31:17 +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
367cf39985 Merge branch 'MDL-52873-master-modgradeid' of git://github.com/mudrd8mz/moodle 2016-02-02 12:12:03 +08:00
David Mudrák
d84c64b7d6 MDL-52873 forms: Generate unique id attributes for modgrade elements
The previous method of generating the id attribute of the elements
within the modgrade group did not take the name of the modgrade field
into account. So if there were multiple fields of the modgrade type
added into a form (not a common case yet still valid), elements created
within the group were assigned same id attributes.

The patch introduces a new method for generating the id attribute of
modgrade elements. The new method takes the name of the modgrade group
into account and returns the id in the format similar to the default one
returned by HTML_QuickForm_element::_generateId().

The patch changes the generated id attribute. Apart from the
block_activity_results' behat feature files, not other places seem to
rely on the exact value.
2016-01-22 14:24:53 +01:00
Rushikesh
32f2116b08 MDL-29817 Form : advcheckbox allows attributes even without group key 2016-01-21 22:37:43 +05:30
Marina Glancy
c026a28d59 MDL-50851 core_tag: introduce tag collections 2016-01-10 15:25:43 +08:00
Marina Glancy
32fada5cb2 MDL-52081 forms: indicate usage of grandparent constructor 2015-12-10 13:38:04 +08:00
Marina Glancy
1a0df5535e MDL-52081 forms: Use __construct() for constructors 2015-12-10 13:38:01 +08:00
Damyon Wiese
97d2ea7f87 MDL-51970 autocomplete: Add an option to hide the suggestions
This is used by tags when official tags are disabled.
2015-11-02 10:21:57 +08:00
Andrew Nicols
22d0a8f11e MDL-51966 forms: Typo correction 2015-10-30 07:56:25 +08:00
Andrew Nicols
63a03a8b05 Merge branch 'wip-MDL-51966-master' of https://github.com/marinaglancy/moodle 2015-10-30 07:31:28 +08:00
Marina Glancy
ecbc2a2f25 MDL-51966 forms: case-insensitive search in autocomplete 2015-10-29 15:10:20 +08:00
Jun Pataleta
9f555a7e77 MDL-51921 files: Fixes for file manager issues
Fixed the issue where the file path select box goes beyond the
container with very long folder names. Instead of setting to
"width: auto", I set it the select box's "width: 100%" so that it will
just fill up its container's width.
Fixed the issue where markups are being shown on file aliases.
2015-10-28 04:48:25 -05:00
Damyon Wiese
bb6ca6f360 MDL-51260 tags: Update the tags form element to use the autocomplete field
AMOS BEGIN
    REM [interestslist_help,moodle] Commas are no longer required
    REM [entertags,tag] Commas are no longer required
    REM [othertags,tag] Commas are no longer required
AMOS END
2015-10-15 12:03:35 +08:00
Damyon Wiese
60a1ea56d9 MDL-51247 forms: All new aria-pimped autocomplete mform element.
Supports static list of options - or options fetched via ajax.
Has options for single,multi and tags support.
2015-10-14 16:22:44 +01:00
Jetha Chan
ec887caa4a MDL-50685 core_form: disable hidden options, don't just hide 2015-09-11 15:08:37 +08:00
Adrian Greeve
40a154551f MDL-48371 editors: Option for removing managefiles
We want to remove the managefiles button from the
editors in the wiki so that students don't delete
each others files.
2015-09-07 09:59:35 +01:00
Damyon Wiese
988592c556 MDL-51179 Atto: Extend autosave fix to cover text changes
Added new functions to editor api - set/get_text so the
original form text can be determined from an editor.

When calling use_editor() you should first call set_text() with
the text that will be inserted in the form element.

There is also a new scheduled task for cleaning Atto autosave drafts.
2015-09-01 12:23:00 +08:00
pau.ferrer-ocana
6d4088b7e3 MDL-49440 lib: Date picker duplicated week day names repaired
Thanks Marc Català for the patch
2015-07-16 12:38:59 +02:00
Martin Mastny
eaec9cfec7 MDL-49783 forms: Collapsed form section is opened on error 2015-05-07 08:57:30 +08:00
Andrew Nicols
793645a03f Merge branch 'm29_MDL-49782' of https://github.com/totara/moodle 2015-04-21 10:43:48 +08:00