1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-06 12:13:16 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers
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
..
about Move docs tiddlers out of the root folder 2021-11-26 11:18:03 +00:00
commands Changing tags for NamedCommandParameters (#6238) 2021-11-18 08:47:52 +00:00
community Merge branch 'tiddlywiki-com' 2022-04-02 09:32:46 +01:00
concepts Fix regressions cause by PR #6511 (#6567) 2022-04-01 11:42:16 +01:00
customising Correct typos (#6571) 2022-03-30 18:25:03 +01:00
definitions Update TiddlyDesktop repository URL 2022-03-31 12:05:56 +01:00
demonstrations Merge branch 'tiddlywiki-com' 2022-03-22 21:59:12 +00:00
editions Change http://*.tiddlywiki.com/* to https:// 2017-11-11 11:56:20 +00:00
features [doc] Update Importing Tiddlers.tid - attempt 2 (#6432) 2022-01-30 11:17:39 +00:00
fields Overhaul the filter operator documentation: part 2 2015-01-24 21:18:44 +00:00
fileformats Update docs that mention store area 2021-07-14 13:08:19 +01:00
filters Merge branch 'tiddlywiki-com' 2022-03-25 13:03:35 +00:00
gettingstarted Add new tag 'GettingStarted' to Getting Started Tiddlers (#6204) 2021-11-14 08:42:43 +00:00
hellothere Update release note for v5.2.2 2022-03-25 13:56:57 +00:00
hiddensettings Merge branch 'tiddlywiki-com' 2021-11-17 09:33:55 +00:00
howtos Add section about dynamic links to 'Linking in WikiText' (#6361) 2022-01-09 14:30:22 +00:00
images Prepare for v5.2.3-prerelease 2022-03-25 15:05:03 +00:00
languages Tag additions (#6233) 2021-11-18 08:58:41 +00:00
learning Clarify drag-n-drop behaviour again (#3434) 2018-11-20 10:06:12 +00:00
macros Update list-links-draggabe Macro.tid (#6405) 2022-01-19 11:13:08 +00:00
mechanisms Add NavigatorWidget example (#6285) 2021-11-27 07:58:29 +00:00
menubar First commit of new Menu Bar plugin 2020-02-28 14:33:15 +00:00
messages Merge branch 'tiddlywiki-com' 2022-03-22 21:59:12 +00:00
nodejs Merge branch 'tiddlywiki-com' 2021-11-17 09:33:55 +00:00
platforms Docs: Misc minor edits 2021-11-25 08:38:17 +00:00
plugins Add contributors to release note 2022-02-22 09:54:46 +00:00
readme Promote Gitter Chat in the Readme (#3322) 2018-12-01 14:25:33 +00:00
reference Fix tag pill colouring 2021-11-19 10:52:13 +00:00
releasenotes Update release note for v5.2.2 2022-03-25 13:56:57 +00:00
roadmap Update RoadMap tiddler 2020-05-16 19:52:54 +01:00
saving Make choice selections save to state tiddler (#6585) 2022-04-01 18:07:38 +01:00
styleguide Docs Macros: Add new <<.tiddler-fields>> macro 2021-12-06 16:59:07 +00:00
system Merge branch 'tiddlywiki-com' 2022-03-22 21:59:12 +00:00
systemtags Minor tweaks to 0cfe6597d4 2021-10-25 16:29:53 +01:00
tiddlydesktop Update TiddlyDesktop repository URL 2022-03-31 12:05:56 +01:00
variables Add tag 'Variable Examples' to 3 tiddlers (#6227) 2021-11-17 12:14:42 +00:00
videos Use https for YouTube 2017-11-18 19:53:52 +00:00
webserver Add version tags for #5899 2022-02-21 09:56:05 +00:00
widgets Checkbox widget: list and filter modes (#6561) 2022-04-02 15:16:08 +01:00
wikitext Merge branch 'tiddlywiki-com' 2022-02-22 09:25:15 +00:00
workingwithtw Add docs on share plugin (#5331) 2021-01-03 11:48:17 +00:00
$__StoryList.tid Move docs tiddlers out of the root folder 2021-11-26 11:18:03 +00:00