* Fix popup location for tables
This commit introduces the `popupAbsCoords` option to the $button widget
and implements an absolut coordinate format.
Coordinates for popups are stored in the format `(x,y,w,h)`. These
coordinates are relative to the offset parent of the element that
defines the popup.
This commits adds a second format `@(x,y,w,h)`. Coordinates specified in
this format a relative to the pages root element.
The `popupAbsCoords` option of the $button widget enables the use of
this coordinates.
* Unify the declaration of the RegEx for parsing the popup-position
The regular expression was declared in three locations with the same
content. This commit supplies a new function `parseCoordinates` in
`popup.js`. This function returns the parsed coordinates and understands
the classic/absolute coordinates.
This function is used in `reveal.js` and `action-popup.js` to parse the
coordinates.
* Add documentation for coordinate systems
* Consolidate creating coordinate strings
The Popup object now contains a `buildCoordinates` method that can be
used to build coordinate strings. It takes an "enum" for the coordinate-
system to use. This makes everything easily extensible and prevents the
use of magic values.
* Add tests for `parseCoordinates` and `buildCoordinates`
* Add `tv-popup-abs-coords` to `collectDOMVariables`
This will make the absolute coordinates available for the
`DraggableWidget` and the `EventCatcherWidget`.
* Add documentation for the `tv-popup-abs-coords`
... to the `DraggableWidget` and the `EventCatcherWidget`.
* Fix crash when generating a static version of the TW
The Popup class is not initialized in `startup.js` if `$tw.browser` is
not true. After having consolidated the facilities for parsing
coordinate strings into `popup.js` this breaks because the static build
needs to parse coordinate stings even if no Popup module is initialized.
This commit solves this problem by making `readPopupState`,
`parseCoordinates` and `buildCoordinates` static methods of `popup.js`.
It also adds a comment to these functions to show that these can be called
safely even if the Popup-Class is not initialized.
* Added failing linked-list test for #7059
* Fixed linked-list remove bug #7059
* Added failing linked-list test for #7059
* Switched LinkedList to use Map
* Removed this.last from LinkedList
* Removed this.first from LinkedList
* Switching to deleting old LinkedList entries
* LinkedList rewritten to be better
* Using null as LinkList ends to reduce hashing
* Using adhoc map... cause it's better than ECMA6 Map
* compliance with TiddlyWiki coding conventions
* Made link-list tests confirm the prev links
Co-authored-by: btheado <brian.theado@gmail.com>
* Fix popup location for tables
This commit introduces the `popupAbsCoords` option to the $button widget
and implements an absolut coordinate format.
Coordinates for popups are stored in the format `(x,y,w,h)`. These
coordinates are relative to the offset parent of the element that
defines the popup.
This commits adds a second format `@(x,y,w,h)`. Coordinates specified in
this format a relative to the pages root element.
The `popupAbsCoords` option of the $button widget enables the use of
this coordinates.
* Unify the declaration of the RegEx for parsing the popup-position
The regular expression was declared in three locations with the same
content. This commit supplies a new function `parseCoordinates` in
`popup.js`. This function returns the parsed coordinates and understands
the classic/absolute coordinates.
This function is used in `reveal.js` and `action-popup.js` to parse the
coordinates.
* Add documentation for coordinate systems
* Consolidate creating coordinate strings
The Popup object now contains a `buildCoordinates` method that can be
used to build coordinate strings. It takes an "enum" for the coordinate-
system to use. This makes everything easily extensible and prevents the
use of magic values.
* Add tests for `parseCoordinates` and `buildCoordinates`
* Add `tv-popup-abs-coords` to `collectDOMVariables`
This will make the absolute coordinates available for the
`DraggableWidget` and the `EventCatcherWidget`.
* Add documentation for the `tv-popup-abs-coords`
... to the `DraggableWidget` and the `EventCatcherWidget`.
* Add tests for [is[variable]] and "faked" variables
See GH #6303
* Make is[variable] and variables[] operators resilient to fake widgets
Co-authored-by: jeremy@jermolene.com <jeremy@jermolene.com>
* add default settings for styled inline SPANs
* change color names in palettes and vanilla-base
* change parser behaviour if custom class is used
* tc-inline-style will only be set if no other custom setting is appliead
* Add tests for inline-styles
* add one more test
* remove space after if
* Fix bug with checkbox widget and `list` field
The `list` field is stored as a list and frozen against modifications,
and getFieldList() returns it directly without creating a copy. So
before we modify it, we need to make a copy so we're not modifying a
frozen list. This bug doesn't manifest with custom fields, which are
stored as strings, only with the built-in `list` field.
* Fix checkboxes referencing non-existent tiddlers
This fixes the "tiddler is undefined" error when a checkbox's listField
property references a tiddler that doesn't (yet) exist.
* Better logic for checkbox listField handling
If the field contains an array, then it's almost certainly referenced
elsewhere and needs a defensive copy made. If it contained a string,
then it's safe to modify without making a defensive copy.
This first implementation concatenates the results of the filter (with no separator) and then wikifies the result.
The test in this commit is quite interesting...
* Implement insertafter operator (like insertbefore)
Currently, the behavior of insertafter if the target is not found is to
append the inserted tiddler to the end of the list, like insertbefore
does. In the next commit, we'll add a suffix to customize what both
insertafter and insertbefore do when the target is not found.
* Add failing tests for insertafter suffixes
Also includes tests for insertbefore suffixes (start/end), since we'll
be implementing both of those at the same time.
* Add start/end suffixes for insertafter/before
The tests that exercise the start/end suffixes now pass.
* Add `main` and `article` roles to stories and story.
* Support `role` and \aria-checked` in buttons, and integrate with sidebar tabs.
* Add `region` role to sidebar, and set caption as `aria-label`.
* Add accessibility roles and labels to static templates.
* Update test fixtures with new ARIA tab attributes.