Ensures dialogs are immediately removed from DOM when closed.
Previously, dialogs were destroyed but not removed causing possibility of duplicate element IDs, so jQuery unitentionally selects and recreates old dialogs, thus GUI._updateOkButtonStatus updates the wrong button.
Old behaviour of ._downloadRegisteredResources attempts to download all registered resources, regardless of whether they have been previously downloaded. howler.js appears to ignore requests to re-download, however PreloadJS will redownload, which can cause critical errors if a resource is being used while being unnecessarily redownloaded
Now use a Map to keep track of individual elements to prevent duplication.
Previously would increment continuously just by switching dropdown options. So users could bypass the requirement to complete starred(*) fields by toggling a dropdown a few times, or by focussing and unfocussing input elements, causing nbSetRequiredKeys++ to increment without limit.
GlobalEventHandlers.onchange only fires when focus is lost. However .oninput fires whenever contents are modified. Original requires "double click" behaviour: first click to deselect the input element, second click to actually click the "Ok" button. Old code results in "Ok" buttons remaining visually disabled thus confusing users even when input elements have been completed
The indentation in JS and HTML looks wrong because of GitHubs default
settings (I think is 8 spaces for an indent?). This .editorconfig file
allows us to define what indentation params should be used for specific
file types, making the JS more readable and consistent with code style
convention.
Related to https://github.com/psychopy/psychojs/issues/44 point 2. This
fix allows users to call setSize to change rect size, as with Python code.
To change rect size, the setSize method calls the setWidth and
setHeight methods of Rect stim.
As noted in this discourse post:
https://discourse.psychopy.org/t/slider-setreadonly-sets-contrast-incorrectly/7055
Also, I wonder if we should be changing contrast by halving the color
values (if they are signed color vals) rather than the transparency, in
keeping with the Python version. Transparency will be weird if the scale
is on a textured backgorund?