37 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
7e7732e8e7 NOBUG: Fixed file access permissions 2018-07-26 19:56:32 +02:00
Jake Hau
b6976f1a87 MDL-29701 editor: mform disableif doesn't work on editor element 2018-07-19 11:38:26 +07:00
Davo Smith
d5cd1496ce MDL-61061 formslib: make sure hideIf rules hide labels within groups 2018-01-03 13:05:58 +00:00
Davo Smith
c377d07f26 MDL-60205 form: fix hiding of elements within groups with theme_clean 2017-10-03 09:10:56 +01:00
Davo Smith
b67f3bc693 MDL-60012 form: improve clarity of elementsByName code 2017-10-03 09:09:09 +01:00
Davo Smith
8cab0a2571 MDL-60012 form: fix 'neq' disabledif regression 2017-09-14 16:28:53 +01:00
Davo Smith
8dff6c78bd MDL-53848 formslib: peer review fixes 2017-08-17 14:52:11 +01:00
Davo Smith
68d206b274 MDL-53848 form: fix disabledIf functionality 2017-08-17 14:52:11 +01:00
Davo Smith
766d6f9a61 MDL-53848 form: hide entire group if hideIf test is applied to the group 2017-08-17 14:52:10 +01:00
Ankit Agarwal
988879655b MDL-53848 formslib: make conditional hidden elements properly accessible 2017-08-17 14:52:10 +01:00
Davo Smith
d20498625c MDL-53848 form: add hideIf functionality 2017-08-17 14:52:10 +01:00
Rajesh Taneja
86ebbed6ca
MDL-56210 behat: Test for disabled button later
With phantomjs, dom is not updated by the time
next step is executed, so suffle it to ensure
this scenario pass
2016-10-05 15:45:22 +08:00
David Monllao
2e5a8fd7aa Merge branch 'wip-mdl-56210' of https://github.com/rajeshtaneja/moodle 2016-10-03 13:53:29 +08:00
Rajesh Taneja
eed52d64bb
MDL-56210 behat: Ensure behat waits for dependancy manager 2016-09-30 10:19:09 +08:00
Eloy Lafuente (stronk7)
83edfba240 MDL-56127 forms: multiple select dependencies fixed
This is a fix for a regressions introduced by MDL-54778. It
seems that escaped all our tests because there isn't any case
of such a dependency in core, but Daniele Cordella was facing
it within his surveypro module.
2016-09-29 16:53:08 +02:00
Damyon Wiese
e8272e748c MDL-55071 theme_boost: Fix relevant JS warnings
Part of MDL-55071
2016-09-23 10:57:36 +01:00
Damyon Wiese
63e4df60f6 MDL-55839 behat: Behat fixes for theme_noname
This is a squash of many small fixes.
The list of changes are:

Initial set of behat selectors overrides required for new theme.

set core behat selectors if not overridden by theme

Remove pause

Fix for checkboxes not saving properly

Custom override for click in the user menu

Fix for behat guessing the field type.

Behat fix for guessing the correct field type.

Fix for missing closeElementBefore mforms mess.

Fix for textareas not displaying their contents.

Fix availability form element

Fix action menu selectors for activities in a course page

Fix textareas not retaining their values

Fix selector for blocks

I had to change the single select template to use an input instead of a button because of a
behat bug we have not tracked down yet.

Fix for frozen attribute in form elements

Use input instead of button while behat is still broken

Fix for navigation selector override

Behat selector fixes and multi-select fixes for templated select

Fix for configure blocks selector + booleans for autocomplete

Fixes for course_summary behat tests

Allow optgroups in single_select

Behat fixes for block_navigation

Fixes for url form element and activity chooser selectors

blocks_social - fix specific selector for behat

Fix export_for_template for selectgroups element.

Dont set empty id on the form

Fix direct call to behat_navigation in backup context

Checkbox empty value fix

Fix for assign grading panel popouts

file picker overrides to find a file manager in the page

Fix chat tests to use element name

Make selectors in mod_data behat less specific

MDL-55839: recent activity behat test relies on time()

SQUASH Honour mform element "class" attribute on the container

SQUASH Fixes for behat in mod_forum

SQUASH search form template showing value as text next to the button

SQUASH undo double selectgroup fix

SQUASH - The slightly different structure to action menus breaks course drag and drop

SQUASH Wrap loading icon in a span so the selector still works.

SQUASH Fix fragile javascript in report_loglive

SQUASH Fix tabtree, and selectgroups for mod_feedback

Also - do-not enhance the action menu - we are dropping support for this.

SQUASH Fix filemanager selector and pix_icon template for mod_forum tests.

SQUASH Fixes to breadcrumb and add formid to single select (fixes mod_glossary tests)

SQUASH lesson behat fixes. 95% of lesson styles were rubbish so they were disgarded.

SQUASH Fix lti behat tests - they were cheating and using a context step from quiz

SQUASH Behat fixes for quiz with new theme

SQUASH behat fixes for mod_wiki

SQUASH Workshop behat fixes

SQUASH Frozen form elements cannot use a readonly form element because it screws with the form JS "disabledIf" stuff.

SQUASH Fixes for grades behat tests

SQUASH behat fixes for groups

SQUASH blacklist action menu tests

SQUASH Fix for tag form element missing "manage standard tags" link

SQUASH Incomplete fixes for course behat tests

SQUASH behat fixes for badges

SQUASH Tags fixes for behat

SQUASH filepicker fixes for behat

SQUASH Abort guessing field type when we hit 'html'

SQUASH Fix for admin/tool/behat tests

SQUASH fix for admin tool behat tests

SQUASH fix for availabilty conditions hiding "aria-hidden" elements

SQUASH give the blocks more room. We get behat files because nav tree nodes are not in view

SQUASH Blocks fixed

Fix behaviour of unchecked checkboxes

SQUASH Remove incorrect step in user test

SQUASH behat fixes for course tests

Part of MDL-55071
2016-09-23 10:55:16 +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
Ankit Agarwal
6513cc0376 MDL-42097 formslib: updates to edit profile form
Add a new dependency 'in' in forms library
Use the 'in' dependency to disable the 'changepassword' field when a auth plugin doesn't support it
2013-12-03 14:15:16 +08:00
Matt Petro
2f8edd067f MDL-35674 formslib: Optimized disabledIf javascript for large forms 2013-07-22 00:08:18 +01:00
Frederic Massart
58f3865fce MDL-39280 form: Multiple select support disabledIf with multiple values 2013-05-10 09:33:46 +08:00
Ruslan Kabalin
ac5e6ca4d1 MDL-30637 Refactor Advanced fileds functionality
The displaying of advanced items has been refactored. The changes are:

* The Advanced button is replaced by the Show Less/More link
* The Show less/more link controls advanced elements only within the section
  it is located at
* The Show less/more state of sections is preserved between form submissions
* When javascript is off, all advanced elements will be displayed by default,
  no show/hide controls will exists on the page
2013-02-07 14:38:37 +00:00
Tim Hunt
bef9ab0ad5 MDL-34728 forms: woy for other JS to trigger disableIf update.
This was discovered while working on MDL-32705. If some JavaScript (for
example a select all/none link) changes the state of some form fields,
then the disabledIf state of other form elements does not automatically
update.

The existing form JS was so well encapsulated that this was impossible.
This change pokes a hole in the encapsulation, and provides an API
    M.form.updateFormState(formid);
that other bits of JS code can call when necessary.
2012-08-13 11:13:06 +01:00
Marina Glancy
c81f332876 MDL-34221 disabledIf support for filemanager and filepicker elements 2012-07-20 10:49:30 +08:00
Davo Smith
b1c669a711 MDL-34221 Filepicker - disableIf now prevents drag and drop upload 2012-07-20 10:49:30 +08:00
Tim Hunt
8f6384a9ec MDL-27045 formslib: fix disabledif for advcheckbox
This is based on earlier work by Henning Bostelmann and Tom Potts.
2011-11-17 17:57:27 +00:00
Jason Fowler
483239087c MDL24200 - Admin Users - Changing the submit button to just a button to prevent it from taking focus when entering text. (Patch provided by Hubert Chathi) 2011-11-07 15:29:11 +08:00
Rajesh Taneja
63d5c4ac85 MDL-25937 Forms Library: Filepicker will respect disable if 2011-10-03 16:26:21 +08:00
Aaron Wells
4b72f9eb78 MDL-26167 lib/form: Altering Javascript so that "disabledIf" will disable the "Choose" button for a filepicker 2011-04-15 09:59:46 +12:00
Petr Skoda
d306751695 fixed unterminated JS statements 2010-09-18 10:37:19 +00:00
Sam Hemelryk
c1422316bf backup MDL-24219 Fixed up dependencies JS for mforms 2010-09-17 03:30:15 +00:00
Sam Hemelryk
e2620b9d15 form-javascript MDL-24024 Fixed bug with mforms JavaScript whereby dependencies on radio buttons were constantly returning true 2010-09-13 08:58:32 +00:00
Sam Hemelryk
13e9c0af85 forms MDL-24051 Fixed regression in IE + YUI 2010-09-10 05:53:18 +00:00
Sam Hemelryk
3a905609ae mforms MDL-24048 Fixed bug in IE when attempting to iterate form elements 2010-09-09 06:36:33 +00:00
Sam Hemelryk
5e60ed9b25 forms MDL-23891 Fixed up IE bug in JavaScript for finding reset buttons 2010-08-26 02:05:47 +00:00
Sam Hemelryk
c7e3e61c70 javascript MDL-23850 Moved mforms specific JavaScript to a separate file 2010-08-19 05:43:06 +00:00