The intent is to ultimately replace ClientFieldValidator with this and
individual validators that interact with it.
* src/validate/ValidStateMonitor.js: Added
* test/validate/ValidStateMonitorTest.js: Added
This allows #validate to be used generically for any type of validation, not
just change events.
* src/validate/ClientFieldValidator.js (validate):
Accept and propagate all bucket data to `validate` event listeners.
* src/validate/ClientFieldValidator.js (monitor): Remove
This just concerns itself with something that it should be concerned about;
let the caller handle monitoring, now that we have a #validate method.
* src/validate/ClientFieldValidator (validate): Added
Extracted logic that previously was exclusive to #monitor; that method will
now simply invoke #validate.
* src/ui/field/DomField.js (queryElement): {Error=>DomFieldNotFoundError}
when a DOM element cannot be located for the field.
* src/ui/field/DomFieldNotFoundError.js: Added
element.style is not supported as an lvalue in IE<9.
All the rest of the sane world that doesn't support IE<9 should be laughing
at me in pity right now.
* src/ui/styler/NaFieldStyler.js (hideField):
Use HTMLElement#setAttribute instead of HTMLElement#style as an lvalue
* test/ui/styler/NaFieldStylerTest.js: Modify test cases to check for
invocation of setAttribute
* src/ui/styler/NaFieldStylerAnimation (showField):
The 'display:none' style was retained in certain circumstances after
animation in IE; this fixes that.
Yes, this is a mess; I'm pretty much out of time now.
* src/ui/group/GroupUi.js (doShowField, doHideField):
Use field styler
* src/ui/group/TabbedGroupUi (doShowField, doHideField):
Defer to supertype
I didn't really want to add this back in, but others in the group
thought that change might be bad for users. This animation thing is
just so sloppy, I think.
* src/ui/styler/NaFieldStylerAnimation.js: Added
This solves styling and DOM mutation issues. For now.
* src/ui/field/DomField.js (queryElement, updateElement): Added
(_getElement): Extracted into queryElement and updated to re-query DOM each
time, returning last match if not found.
(applyStyle, revokeStyle): Defers style applied predicate to style itself
Field stylers now determine whether they've been applied to the target field
on their own, which solves the problem of the system getting out of sync.
* src/ui/styler/ErrorFieldStyler.js (isApplied): Added
* src/ui/styler/FieldStyler.js (isApplied): Added
* src/ui/styler/NaFieldStyler.js (isApplied): Added
* test/ui/styler/NaFieldStylerTest.js: Test for #isApplied
This is necessarily primarily for a specific case: option elements in IE,
which cannot be styled. >:O
This implementation is not complete: we want to re-attach the field at the
same position it was at before it was detached. This might not be
trivial---imagine if its sibling was also detached.
* src/ui/styler/NaFieldStyler.js (isSubField): Receive field instead of
element (to check parent)
(applyStyle, revokeStyle): Detach and re-attach field from/to DOM
respectively
* test/ui/styler/NaFieldStylerTest.js: Associated tests
* src/ui/field/DomField.js (getParentElement):
Renamed from getParent. Cache parent element in memory so that we have a
reference for re-attaching fields to the DOM.
(getParent): Public API addition; call getParentElement
* src/ui/group/TabbedGroupUi.js (doShowField, doHideField):
Return from method after setting deferred operation. This previously
did not fail because jQuery didn't care if operations are not
performed on field matches.
* src/ui/field/DomField.js (getContainingRow): Return self if DT or DD
Certain types of elements (e.g. statics) are compiled such that the direct
reference is the row itself.
* src/ui/ElementStyler.js: Added
* src/sort/MultiSort.js: Removed ElementStyler liberation todo
* src/ui/field/DomFieldFactory.js: Same
* src/ui/step/GeneralStepUi.js: Same
* src/ui/step/StepUiBuilder.js: Same
This existed when the framework was very long, and has managed to survive
numerous refactoring attempts; it used to be a small class abstracting
element styling, and it has had crap thrown into it ever since, partially
due to time constraints. It needs to go away.
* src/ui/GroupUi.js (getFieldElements): New method
(showField, hideField): Use GroupUi#getFieldElements
* src/ui/group/TabbedGroupUi (showField, hideField):
Use GroupUi#getFieldElements
It is expected that support for promises will be available in whatever
environment liza is run. Here, we're adding a shim for the sake of testing
in ancient environments.
It's almost as if I'm stuck using an ancient environment somewhere...*cough*