1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-06 12:13:16 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/widgets
Robin Munn e28af8d594
Checkbox widget: list and filter modes (#6561)
* Docs for CheckboxWidget list and filter modes

This documents the `listField` and `filter` attributes.

* Tests for checkbox widget list mode

* Implement checkbox list mode

* WIP on implementing filter attr for checkboxes

* Improve CheckboxWidget documentation

* Refactor checkbox tests: move function to top

The big findNodeOfType function belongs at the top of the describe
block, so that the checkbox tests are more compact and easy to read.

* Move checkbox widget tests to end of file

The checkbox widget tests are long and involved, so we'll move them to
the end of the file so they aren't a huge block of code you need to read
past to find the next test.

* Improve formatting of CheckboxWidget docs

The \define() calls that are short enough to fit on one line should be
put on one line, for readability. The ones that are quite long have been
kept on multiple lines, for readability.

* Added more passing tests for checkbox widget

* Add some failing tests for checkbox widget

The filter mode where neither checked nor unchecked is specified (in
which case an empty filter result means false and a non-empty result
means true) is not working yet.

* Make failing tests pass

* Uncomment (and improve) test for field mode

We're now ready to start working on making this test pass. (There was
also one small mistake in the test, which this commit corrects).

* All tests now passing

* No indeterminate checkboxes in simple modes

The simple checkbox modes (field and index) should not produce
indeterminate checkboxes. That should be reserved for the advanced modes
(list and filter).

* Minor improvement to unit tests

* Allow indeterminate checkboxes in list and filter modes

This change may require some tweaks to the unit tests to be able to test
it properly.

* Slightly easier to read tests

* Two more tests for list mode

* Greatly simplify unit test code

Turns out there's no need to jump through Object.getPrototypeOf hoops.

* Minor simplification of unit test

* Add tests for indeterminate in list & filter modes

With this, the set of tests is complete.

* More tests to specify list mode behavior

* Unfocus tests so all tests run

* Update docs to say "new in 5.2.3" insetad of 5.2.2

* Move checkbox widget tests into their own file

The test-widget.js file was getting too long with all the checkbox
tests added, so we'll move the checkbox tests into their own file.

* Add checkbox widget tests for index mode

This commit also adds tests for index list mode (with a listIndex
attribute that will parallel the listField attribute) but leaves them
commented out because they don't pass yet: the code that implements the
listIndex attribute hasn't been written yet).

* Add listIndex attribute to checkbox widget

* Remove code that lets checkboxes be indeterminate

This reverts commit 6afcb151be. We will
add this code back in a later PR.

* Remove indeterminate tests for checkbox widget

We're currently not allowing indeterminate checkboxes, so there's no
need for the tests that check for them.

* Document listIndex attribute of CheckboxWidget

* adds class tc-checkbox-checked when checked

* equivalent to #2182 (RadioWidget)
* also applies `tc-checkbox` to checkboxes by default, always

* Move macro definitions inside example text

Since the wikitext-example-without-html macro creates a new parsing
context, it's safe to have macro definitions inside it. That makes these
examples a lot easier to write, and to read.

* Remove all mention of indeterminate checkboxes

Also improve the documentation a little bit: mention what happens in
list mode if neither checked nor unchecked is specified.

* Move filter mode to bottom of checkbox docs

The `filter` attribute should be under both `listField` and `listIndex`
rather than being between them. The documentation for filter mode should
similarly be after the `listIndex` documentation.

* Improve docs for `class` attr of checkbox widget

This brings the wording of the `class` attribute more in line with how
it's worded in the RadioWidget docs.

* Fix bug with list tiddlers

If neither checked nor unchecked was specified, then the behavior should
be "empty = false, non-empty = true". But if *both* are specified yet
neither is found, then the checkbox should be unchecked (false). It had
been falling through to the "non-empty = true" behavior, which was wrong.

* Improve listIndex example of checkbox widgets

* Remove unused function from test-widget.js

Co-authored-by: Tobias Beer <beertobias@gmail.com>
2022-04-02 15:16:08 +01:00
..
$__docs_anyField.tid improve setwidget examples and add a link to and from enlist operator (#5666) 2021-05-25 22:19:28 +01:00
$__editions_tw5.com_widget-examples_qualify-transcluded.tid QualifyWidget documentation (#6422) 2022-01-25 17:59:59 +00:00
ActionConfirmWidget.tid Added docs for action-confirm widget, added default message for widget and improved logic for disabling it. (#5047) 2020-11-16 17:02:22 +00:00
ActionCreateTiddlerWidget Example 1.tid More tag changes for file routing (#6199) 2021-11-14 09:12:19 +00:00
ActionCreateTiddlerWidget Example 2.tid Correct tag names. Add missing tags (#6193) 2021-11-13 08:48:52 +00:00
ActionCreateTiddlerWidget Example 3.tid Correct tag names. Add missing tags (#6193) 2021-11-13 08:48:52 +00:00
ActionCreateTiddlerWidget Example 4.tid Correct tag names. Add missing tags (#6193) 2021-11-13 08:48:52 +00:00
ActionCreateTiddlerWidget Template.tid Add tags to route to widgets file path (#6223) 2021-11-16 22:06:04 +00:00
ActionCreateTiddlerWidget_Example.tid Correct tag names. Add missing tags (#6193) 2021-11-13 08:48:52 +00:00
ActionCreateTiddlerWidget.tid Search and replace "v5.1.24" to "v5.2.0" 2021-07-14 09:21:37 +01:00
ActionDeleteFieldWidget.tid Missed parenthesis 2017-04-19 13:25:31 +01:00
ActionDeleteTiddlerWidget.tid Move docs for 5.1.5 release 2014-11-26 11:22:20 +00:00
ActionListopsWidget.tid tw5.com : Fix typo in ActionListopsWidget.tid (#6215) 2021-11-15 21:17:10 +00:00
ActionLogWidget.tid Doc updates for ActionLog and Log widgets (#5081) 2020-11-20 18:37:48 +00:00
ActionNavigateWidget.tid Overhaul the macro and variable documentation 2015-02-21 23:03:24 +00:00
ActionPopupWidget.tid Search and replace "v5.1.24" to "v5.2.0" 2021-07-14 09:21:37 +01:00
ActionSendMessageWidget.tid Fix docs typos 2021-10-30 15:28:54 +01:00
ActionSetFieldWidget.tid Missed parenthesis 2017-04-19 13:25:31 +01:00
ActionSetMultipleFieldsWidget.tid Fix docs typos 2021-10-30 15:28:54 +01:00
ActionWidget Execution Modes.tid Add tags to route to widgets file path (#6223) 2021-11-16 22:06:04 +00:00
ActionWidgets.tid Added MessageHandlerWidgets and TriggeringWidgets tags (#6161) 2021-11-01 12:56:52 +00:00
BrowseWidget.tid Fix typo in BrowseWidget docs 2020-04-22 12:10:34 +01:00
ButtonWidget.tid Added MessageHandlerWidgets and TriggeringWidgets tags (#6161) 2021-11-01 12:56:52 +00:00
CheckboxWidget.tid Checkbox widget: list and filter modes (#6561) 2022-04-02 15:16:08 +01:00
CodeblockWidget.tid Fix problem with highlight plugin language brushes 2016-08-18 09:07:06 +01:00
CountWidget.tid Docs: add example to CountWidget.tid (#3732) 2019-01-27 19:28:42 +00:00
DiffTextWidget.tid Incorporate “diff” engine to show visual differences (#3112) 2018-03-16 20:38:35 +00:00
DraggableWidget.tid Extend $draggable to support an optional drag handle (#6480) 2022-02-24 11:06:18 +00:00
DroppableWidget.tid Added MessageHandlerWidgets and TriggeringWidgets tags (#6161) 2021-11-01 12:56:52 +00:00
DropzoneWidget.tid Added MessageHandlerWidgets and TriggeringWidgets tags (#6161) 2021-11-01 12:56:52 +00:00
EditBitmapWidget.tid Update EditBitmapWidget doc to reflect update in code (#2725) 2018-11-27 18:11:21 +00:00
EditTextWidget.tid Update size attribute in EditTextWidget.tid (#6403) 2022-01-17 10:11:20 +00:00
EditWidget.tid Added MessageHandlerWidgets and TriggeringWidgets tags (#6161) 2021-11-01 12:56:52 +00:00
EncryptWidget.tid More mangling of reference docs 2014-09-11 00:06:19 +01:00
EntityWidget.tid Introduce text editor toolbar (#2315) 2016-04-22 08:36:29 +01:00
EventCatcherWidget.tid Eventcatcher widget: add "matchSelector" attribute (#6523) 2022-03-14 09:56:23 +00:00
FieldMangler Widget (Examples).tid Add an example to the $fieldmangler widget (#4287) 2019-10-04 15:50:00 +01:00
FieldManglerWidget.tid Added MessageHandlerWidgets and TriggeringWidgets tags (#6161) 2021-11-01 12:56:52 +00:00
FieldsWidget.tid Add new parameters to fields-widget and fields-operator. (#4433) 2020-04-15 12:36:48 +01:00
ImageWidget.tid Image widget: Add classes for loading/loaded/error 2022-01-02 17:28:54 +00:00
ImportVariablesWidget.tid Minor issue in example of Import Variables Widget (#5165) 2020-12-03 22:27:21 +00:00
JSONTiddlerWidget.tid Add support for JSON-formatted tiddler store, and make it the default (#5708) 2021-07-14 09:15:30 +01:00
Keyboard Codes.tid Move docs tiddlers out of the root folder 2021-11-26 11:18:03 +00:00
KeyboardWidget.tid Added MessageHandlerWidgets and TriggeringWidgets tags (#6161) 2021-11-01 12:56:52 +00:00
LetWidget.tid Add $let widget (#6148) 2021-10-30 11:42:22 +01:00
LinkCatcherWidget.tid Docs: mention MessageCatcher widget in LinkCatcher tiddler (#6485) 2022-02-26 18:59:45 +00:00
LinkWidget.tid Update LinkWidget.tid (#4690) 2020-06-11 12:11:12 +01:00
ListopsData.tid Adding tag to ListopsData (#6248) 2021-11-19 07:54:43 +00:00
ListWidget.tid List widget: Clarify performance optimisation impact of counter attribute 2021-10-02 18:27:50 +01:00
LogWidget.tid Doc updates for ActionLog and Log widgets (#5081) 2020-11-20 18:37:48 +00:00
MacroCallWidget.tid Add doc related to WikiText parser modes (#6415) 2022-01-23 09:44:01 +00:00
MessageCatcherWidget.tid Update messagecatcher widget example to use newer syntax 2021-12-22 15:31:35 +00:00
MessageHandlerWidgets.tid Move docs tiddlers out of the root folder 2021-11-26 11:18:03 +00:00
NavigatorWidget.tid Add NavigatorWidget example (#6285) 2021-11-27 07:58:29 +00:00
PasswordWidget.tid More mangling of reference docs 2014-09-11 00:06:19 +01:00
QualifyWidget.tid QualifyWidget documentation (#6422) 2022-01-25 17:59:59 +00:00
RadioWidget Example.tid Update RangeWidget and RadioWidget examples from #5158 2021-03-07 10:23:14 +00:00
RadioWidget ExampleTemplate.tid add docs for radio-actions (#5156) 2020-11-30 18:48:48 +00:00
RadioWidget.tid Added MessageHandlerWidgets and TriggeringWidgets tags (#6161) 2021-11-01 12:56:52 +00:00
RangeWidget Example.tid Update RangeWidget and RadioWidget examples from #5158 2021-03-07 10:23:14 +00:00
RangeWidget.tid Added MessageHandlerWidgets and TriggeringWidgets tags (#6161) 2021-11-01 12:56:52 +00:00
RevealWidget.tid Reveal widget allow re-positioning (#5087) 2020-11-21 17:19:52 +00:00
ScrollableWidget.tid Add position: relative to scrollable widget 2015-04-27 13:38:20 +01:00
SelectWidget.tid Add example of actions attribute to SelectWidget documentation (#6181) 2021-11-08 16:59:17 +00:00
SetMultipleVariablesWidget.tid Set multiple fields/variables/params using filters (#6130) 2021-10-27 11:20:11 +01:00
SetVariableWidget.tid Docs update 2014-10-25 14:02:21 +01:00
SetWidget.tid improve setwidget examples and add a link to and from enlist operator (#5666) 2021-05-25 22:19:28 +01:00
TextWidget.tid Update TextWidget.tid (#3696) 2019-01-15 16:14:50 +00:00
The Extended Listops Filters.tid Add Filter tag to The Extended Listops Filters (#6201) 2021-11-14 08:47:53 +00:00
TiddlerWidget.tid Docs fix: Remove erroneous "class" attribute from tiddler widget 2017-09-01 11:13:39 +01:00
TranscludeWidget.tid Add doc related to WikiText parser modes (#6415) 2022-01-23 09:44:01 +00:00
TriggeringWidgets.tid Move docs tiddlers out of the root folder 2021-11-26 11:18:03 +00:00
VarsWidget.tid Add $let widget (#6148) 2021-10-30 11:42:22 +01:00
ViewWidget.tid Add ViewWidget cross references and examples (#6355) 2021-12-20 10:07:34 +00:00
Widgets.tid Overhaul the macro and variable documentation 2015-02-21 23:03:24 +00:00
WikifyWidget.tid Add doc related to WikiText parser modes (#6415) 2022-01-23 09:44:01 +00:00