* 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>
* Make choice selections save to state tiddler
Currently choice selections save to current tiddler (Saving), which marks TW as needing to Save. This fixes that by saving the working list to a state tiddler.
* Change state tiddler to $:/state/gettingstarted
* Fix field edit bug
This fixes the field edit bug mentioned in
https://talk.tiddlywiki.org/t/possible-field-editing-bug-in-5-2-2/2884 .
* Revert "Fix visual regression in #6511"
This reverts commit c920960942.
* Add new class `tc-edit-fieldeditor`
This class must be added to input and select elements that are used as
field editors. This class reduces the line height of the input element
if it is displayed within the `tc-edit-fields` part of the edit
template.
This allows the same input and select elements to be used for editing
and adding fields.
* Add the new class `tc-edit-field` to the docs
The example in `Customizing EditTemplate Field Rendering` now uses the
new CSS classes.
* tabs activate v5.2.2 tests add whitespace trim
* tabs-macro -- add indentation and code preview
* tabs-macro -- replace substitutions with variables
* split tabs-macro macro into different elements
- tabs-button
- tabs-tab
- tabs-tab-list
- tabs-tab-body
- tabs ... main macro
* tabs: add cascade to button and reaveal widgets
This will allow users to create "default tab" configurations similar to the tiddler info tab handling.
* tabs-macro -- add code_body: yes
* adding trim: Last of the macros I think
* adding trim: EditTemplate and ItemSidebarIcon
* adding trim: control panel basics
* Another hidden space to guide the uglifier
* More consistent nested quoting
* Reconciling tests for \whitespace trim
* Allow the rendering of fields to be extended
This commit extends the `$:/core/ui/EditTemplate/fields` tiddler to
use a new cascade (Field Editor Cascade) to allow customizing the
rendering of the field editor.
It provides a default element for the cascade that displays the standard
EditTextWidget as a fallback. That way, the implementation is completely
backwards compatible. The `currentTiddler` and `currentField` variables
are available in the transcluded tiddler. This has the additional
benefit, that not only the `EditTextWidget` can be used. The user can
use a dropdown-list or even something completely crazy. As long as it
can be put into a tiddler that updates the field, it will be fine.
* Make `select` Tags in Fields look like the rest
This patch updates the CSS to make `tc-edit-texteditor` usable on
`select`-tags as well.
I'm not sure what `-webkit-appearance: none;` is for, but it hides the
DropDown-arrow in Chrome and makes the select-tag hard to discover. I've
changed the css to only apply it to the input tag. Maybe it can be
removed altogether.
* Add documentation for the Field Editor Cascade
* feat: extend tm-open-window to allow opening the same tiddler in multiple templates, and introduce tm-close-window to close browser windows
* fix: use a windowID parameter to uniquely identify a window and introduce tm-close-all-tiddlers
* fix: whitespace
* fix: update variable
* Move GettingStarted to the right place
Previous batch of translations changed the wrong file
* Revert #6467 for GettingStarted
* Delete $ _editions_tw5.com_doc-macros.tid
Wrong name for the updated tiddler
* Update $__editions_tw5.com_doc-macros.tid
* Translation updates
* Update of 2 tiddlers referenced on HelloThere
* 5 more tiddlers, referenced in WikiText.tid
* Support specifying insertbefore position title as parameter
Closes: #6133
* Update insertbefore calls with new variable parameter syntax
See-also: 96b52606a (Support specifying insertbefore position title as parameter, 2022-02-21)
* feat: extend to support a selector attribute identifying the DOM element to be used as the drag handle
* fix: remove redundant variable declaration
* fix: remove extranneous variable declaration
* corrected [!is[draft]] to be a proper complement
* Ensuring [is[draft]] and [!is[draft]] are complements
* Made [is[draft]] more analogous to .isDraft()
* Support case insensitive matching in prefix/suffix operators
Support `caseinsensitive`/`caseinsensitive` suffixes in the following
filter operators:
* prefix
* suffix
* removeprefix
* removesuffix
The suffixes have the same behaviour as in the match operator.
Closes: #6407
* Do not filter titles if suffix/removesuffix operand is empty
Issue: #6407
* Failing test
* Fix underlying problem
* Less naive fix
Now we make sure we maintain the sort order of the titles array when adding a new tiddler
* Fix failing tests
* Refactor filter tests to repeat them with different store orderings
* Revert "Fix failing tests"
This reverts commit ee03ee57f5.
* Refine fix to retain stylesheet ordering
The order of tiddlers in the HTML file uses localeCompare(), and that determines the insertion order. So if we want to be compatible with older versions we have to use localeCompare() to order tiddlers, not a plain sort()
* Don't sort shadow tiddlers
Instead rely on the existing ordering
* Fix failing tests, take 2
I think that all of these changes are explained by the store no longer retaining insertion order, but now using localecompare ordering
* Fix tests from #6327
* Support direct style attributes on the element widget
* Fix tests
Not all parse tree nodes have an "orderedAttributes" member (eg. the error message generated at 5613bcc884/core/modules/widgets/transclude.js (L73-L75))
* Ensure ordering isn't insertion dependent if orderedAttributes is missing
* Add docs
* Delete $__core_ui_ViewTemplate_title.tid
fr-FR modifications to ViewTemplate/title can now be done through cascades mechanism.
* fr-FR New ViewTemplate title cascade
Replacement for old fr-FR ViewTemplate/title shadow tiddler
* fr-FR Better ViewTemplate title cascade
Updated according to @Jermolene review.
* [fr_FR] Add utility macro for translated links
* Update Saving.tid
* Add TiddlyFox Apocalypse translation
* Update TiddlyFox.tid
* Translate Community Links Aggregator.tid
* Update Forums.tid
* Update Developers.tid
* Update HelloThere.tid
* Update GettingStarted.tid
* Update Community.tid
* Update tw5.com edition macros from uplink
Some text in these macros must be translated.
* Various translation updates
* Clean utility fields I had left over
* Clean older files too
* feat: extend tm-open-window to support optional top and left position for new browser window
* fix: whitespace correction
* Update WidgetMessage_ tm-open-window.tid
* feat: add support for animationDuration attribute of paramObject for tm-scroll message
* docs: added docs for animationDuration attribute of tm-scroll message
* fix: use .utils.hop instead of Object.hasOwnProperty()
* fix: do not check if object before calling utils.hop()
* fix: syntax
* Added macros for displaying wikitext examples in a table
* Added documentation for WikiText parsing
* Changed recognize to British spelling
* Add links to the new wikitext parser tiddlers
* Add discussion of dynamic links to 'Linking in WikiText'
* Added macro and styles for displaying a 'bad' example
* Use .bad-example macro in 'Linking in WikiText'
* Convert existing warnings to use .bad-example macro