1
0
Fork 0
Commit Graph

78 Commits (3a2a5642b65f80d648762cfc55e144c298785172)

Author SHA1 Message Date
Mike Gerwitz 3a2a5642b6 Add FlatGroupUi
This solves the problem of trying to show/hide indexes that do not even
exist on the DOM.

There are no tests for this due to the complexity of the parent; refactoring
is needed. :(

* src/ui/group/FlatGroupUi: Added
2016-04-19 10:51:15 -04:00
Mike Gerwitz fcce2e814a Fields with index greater than total in group are not visible
* src/ui/group/GroupUi (isFieldVisible): Indexes greater than the current
index count will no longer be considered to be visible.
2016-04-19 10:50:32 -04:00
Mike Gerwitz 6d51dc55eb Add DataApiManager field stale flag
This will allow it to know when a request needs to be re-made at a later
time.

* src/dapi/DataApiManager (fieldStale, isFieldStale): Added
(fieldNotReady): Check stale status of field
2016-04-15 12:24:08 -04:00
Mike Gerwitz 3e84f18c56 Extract Data API management into DataApiManager
This is extracted from a not-yet-liberated Program class (that you really
don't want to see).

* src/dapi/DataApiManager.js: Added
2016-04-15 12:23:31 -04:00
Mike Gerwitz d37a8aab12 Liberate dapis
* src/bucket/Bucket.js: Added
* src/dapi/BucketDataApi.js: Added
* src/dapi/RestrictedDataApi.js: Added
* src/dapi/StaticAdditionDataApi.js: Added
2016-04-14 13:53:35 -04:00
Mike Gerwitz a6115018d2 Add x-www-form-urlencoded header for XhrHttpImpl
It might be the case that we may want to post raw data in the future; in
fact, I can guarantee it.  We'll cross that bridge when we come to it.

* src/dapi/http/XhrHttpImpl.js (openRequest): Set ContentType header
on POST

* test/dapi/http/XhrHttpImplTest.js: Modified accordingly
2016-04-14 12:08:00 -04:00
Mike Gerwitz bc0d230246 Remove trailing comma from ValidStateMonitor
Yes, the reason is IE.

* src/validate/ValidStateMonitor.js: Remove trailing comma after method
definition list.
2016-04-13 08:27:16 -04:00
Mike Gerwitz 9dfc7c04ff Remove ClientFieldValidator
Use ValidStateMonitor instead.

* src/validate/ClientFieldValidator.js: Deleted
2016-04-12 14:06:57 -04:00
Mike Gerwitz 659c820eb6 Add ValidStateMonitor
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
2016-04-12 13:57:34 -04:00
Mike Gerwitz 88313c016e Accept full bucket data for ClientFieldValidator#validate
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.
2016-04-11 11:53:45 -04:00
Mike Gerwitz fefe2dae41 Remove ClientFieldValidator#monitor
* 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.
2016-04-11 11:50:27 -04:00
Mike Gerwitz 0ac16a3505 Add ClientFieldValidator#validate
* src/validate/ClientFieldValidator (validate): Added
Extracted logic that previously was exclusive to #monitor; that method will
now simply invoke #validate.
2016-04-11 11:29:34 -04:00
Mike Gerwitz 6f17e704a6 Liberate {ClientField,BucketData}Validator
* src/validate/BucketDataValidator.js: Added
* src/validate/ClientFieldValidator.js: Added
2016-04-11 11:18:18 -04:00
Mike Gerwitz bada152d52 {Error=>DomFieldNotFound} error when DOM field is not found
* src/ui/field/DomField.js (queryElement): {Error=>DomFieldNotFoundError}
when a DOM element cannot be located for the field.

* src/ui/field/DomFieldNotFoundError.js: Added
2016-04-06 10:44:11 -04:00
Mike Gerwitz a145bfe1f8 Use HTMLElement#setAttribute in NaFieldStyler for IE<9
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
2016-04-05 11:53:30 -04:00
Mike Gerwitz c29b935f5c NaFieldStylerAnimation properly re-show element in IE
* src/ui/styler/NaFieldStylerAnimation (showField):
The 'display:none' style was retained in certain circumstances after
animation in IE; this fixes that.
2016-04-05 08:59:43 -04:00
Mike Gerwitz 921880cb35 {Tabbed,}GroupUi now show/hide using FieldStyler
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
2016-04-05 00:07:26 -04:00
Mike Gerwitz d8fc549700 DomFieldFactory falls back to element lookups by id
* src/ui/field/DomFieldFactory (create):
Use ElementStyler#getElementByNameLax
2016-04-05 00:05:07 -04:00
Mike Gerwitz afa14ccc39 Add ElementStyler#getFieldByNameLax
Not that I want to keep adding to this monstrosity; no time to refactor
right now.

* src/ui/ElementStyler.js (getFieldByNameLax): Added
2016-04-05 00:03:47 -04:00
Mike Gerwitz 1e332a5a72 Add NaFieldStylerAnimation
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
2016-04-05 00:01:08 -04:00
Mike Gerwitz befca68110 Extract NaFieldStyler show/hide actions into protected methods
* src/ui/styler/NaFieldStyler.js (showField, hideField): Added
* test/ui/styler/NaFieldStyler.js: Added respective tests
2016-04-04 23:59:57 -04:00
Mike Gerwitz e1c2194962 DomField will now consider that field element might have changed on DOM
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
2016-04-04 15:35:43 -04:00
Mike Gerwitz 40505c3328 FieldStyler#isApplied added
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
2016-04-04 15:25:52 -04:00
Mike Gerwitz ae9f2a7cab NaFieldStyler remove subfields from DOM
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
2016-04-04 12:30:21 -04:00
Mike Gerwitz 782e4832af Cache DomField parent element
* 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
2016-04-04 12:30:21 -04:00
Mike Gerwitz fa37850408 Proper NaFieldStyler sub-field hiding support
* src/ui/styler/NaFieldStyler.js (_isSubField): Added
(applyStyle, revokeStyle): Will not hide parents of sub-fields
2016-04-04 12:30:21 -04:00
Mike Gerwitz 064fcd00fd Abort TabbedGroupUi hide when deferred
* 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.
2016-04-04 12:30:05 -04:00
Mike Gerwitz eb073f5db0 DomField#getParent proper nodeName comparison
* src/ui/field/DomFieldFactory (getParent): Convert parent nodeName to
uppercase before comparison (it might not always be)
2016-04-04 11:17:14 -04:00
Mike Gerwitz edbc45a79b DomField#getContainingRow handling of direct row reference
* 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.
2016-04-04 11:17:14 -04:00
Mike Gerwitz c204a12c19 Add NaFieldStyler
* src/ui/styler/NaFieldStyler.js: Added
* test/ui/styler/NaFieldStylerTest.js: Added
2016-04-04 11:17:12 -04:00
Mike Gerwitz 4cce3759db Rename method todo on DomContext#_dequeue
* src/ui/context/DomContext.js (_dequeue): Add todo
2016-04-02 00:30:42 -04:00
Mike Gerwitz d126f618ae Add FieldStyler docblocks
* src/ui/styler/FieldStyler.js (getId, applyStyle, revokeStyle,
addClass, removeClass): Docblocks added
2016-04-02 00:30:42 -04:00
Mike Gerwitz a3b16f33c9 Liberate ui/styler/
* src/ui/styler/ErrorFieldStyler.js: Added
* src/ui/styler/ErrorStyler.js: Added
* src/ui/styler/FieldStyler.js: Added
* src/ui/styler/SidebarErrorStyler.js: Added
* src/ui/styler/StepErrorStyler.js: Added
* src/ui/styler/Styler.js: Added
2016-04-02 00:30:42 -04:00
Mike Gerwitz 37c74eac48 ElementStyler.js (__construct): Decouple jQuery instance 2016-04-02 00:30:42 -04:00
Mike Gerwitz fea4e151cc Liberated archaic DOM element styler
* 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.
2016-04-02 00:30:11 -04:00
Mike Gerwitz 003d527307 Liberate context/
* ui/context/Context.js: Added
* ui/context/DomContext.js: Added
* ui/context/DynamicContext.js: Added
* ui/context/RootDomContext.js: Added
2016-04-01 16:03:52 -04:00
Mike Gerwitz 2fa20c9864 Group support for showing/hiding sub-fields
* src/ui/GroupUi.js (getFieldElements): New method
(showField, hideField): Use GroupUi#getFieldElements

* src/ui/group/TabbedGroupUi (showField, hideField):
Use GroupUi#getFieldElements
2016-03-30 14:16:27 -04:00
Mike Gerwitz 6ab3842015 Proper attribution for src/version.js.in 2016-03-29 14:35:59 -04:00
Arthur Domino 93bff03676 Do not collapse CollapseTableGroups when created. 2016-03-29 09:58:26 -04:00
Mike Gerwitz c56d6ac7b2 GeneralStepUi#_sortGroups: correct group sorting
The modified parent was not the parent of groups, so the group DOM operations failed.
2015-12-04 10:03:52 -05:00
Mike Gerwitz 1a3dd236f8 GeneralStepUi#_sortGroups: maintain DOM order after group sorting
This was affected by 4ce78ebd9e.
2015-12-03 08:27:59 -05:00
Mike Gerwitz a60bf6b52e Liberated Group and its various UIs
The `AccordionGroupUi` was not liberated, because it is my intent to
eliminate it---I did not agree with its needless addition to begin with.  If
we do end up keeping it, then it will be liberated as well.
2015-12-03 00:36:31 -05:00
Mike Gerwitz 3d9780c39e {=>General}StepUi; StepUi interface
This allows us to begin development (and testing) of StepUi subtypes without
having to worry about the convoluted crap that GeneralStepUi is doing.
Specifically, all the jQuery stuff needs to go.
2015-12-03 00:11:53 -05:00
Mike Gerwitz cc21298297 StepUi: Accept and return vanilla DOM content
This encapsulates the use of jQuery which will eventually be entirely
eliminated.
2015-12-03 00:11:53 -05:00
Mike Gerwitz 972856225b Extract StepUi#detach
You can't see where this is going, because there is other code that is not
yet part of Liza.  ...sorry.
2015-12-03 00:11:52 -05:00
Mike Gerwitz 4ce78ebd9e StepUiBuilder do not enclose groups in parent element
This allows the caller to handle how to group and render steps.  But we do
add another container to hold each of the groups.
2015-12-03 00:11:52 -05:00
Mike Gerwitz 44323a0b59 Liberated StepUiBuilder 2015-12-03 00:11:52 -05:00
Mike Gerwitz 9a1dd337eb Liberate {,ui/}field/ 2015-11-30 14:38:42 -05:00
Mike Gerwitz 4cc240e977 Liberate Step 2015-11-30 13:40:33 -05:00
Mike Gerwitz f9b3fa0622 Liberate MultiSort
Step dependency.
2015-11-30 13:40:26 -05:00