* 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.
* Documentation for indeterminate checkboxes
* Unit tests for indeterminate checkboxes
* Implement indeterminate checkboxes
* Simplify indeterminate checkbox example
* Slightly simplify refresh logic for indeterminate
That five-line if statement can be turned into a simple assignment.
* Use "yes" and "no" for checkbox indeterminate attr
This makes the "indeterminate" attribute of the checkbox widget work the
same way as other boolean attributes of other widgets.
* Fix bug with invertTag attribute
One place in the checkbox widget code was checking invertTag for
Javascript truthiness rather than the value "yes", which could have
produced incorrect results if anyone wrote invertTag="no". Fixed.
* fix: formatDateString with [UTC]xxx didn't use passed date
* test: for formatDateString UTC
* fix: not possible to test internal date without hijack
Expected '20220410073037515' to be '20220410073037516'.
* fix: hour
* 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>
* 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
* 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)
* 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 macro params in filter run prefixes and support substitution for variables set by filter run prefixes
* feat: add support macro parameters and variable substitution for all filter run prefixes
* fix: rename options argument to opts for disambiguation
* feat: add support for macro params to cascade filterrun prefix
* Initial Commit
* Set currentTiddler and ..currentTiddler for filter evaulation
* Precompile the filters for performance
* Add explicit test for empty result when no filter passes
* Use the cascade filter run prefix to choose the view template body template
* Use the cascade mechanism to choose between the edit and view templates
* Simplify cascade filter
Thanks @saqimtiaz
* Add control panel UI for inspecting the template cascades
* Refactor import listing and plugin listing as alternate body templates
As suggested by @pmario
* Refer to $:/core/ui/{View|Edit}Template via their associated config tiddlers
* Fix typo in previous commit
* Add demo of custom story tiddler template
* Tweak control panel wording
* Standardise "Story Tiddler Template" nomenclature
* Add a cascade for the editor template body
* Add a cascade for the view template title
* Avoid unwanted whitespace
* Add a cascade for dynamically choosing tiddler icons
* $let widget added and tested
* Documentation for $let, doc improvements for $vars
* let properly avoids refreshing when possible
* $let Changes as recommended by others
* Removed superfluous super method call
Also improved $let test
* Extends :map filter run prefix to provide the variables index, revIndex and length to bring it into line with :reduce
* update :maps examples
* docs: fix formatting issue with documentation
* Extend HTML tag parser to maintain an ordered array of attribute names
* Add some tests for repeated attributes
* Record entire attribute in orderedAttributes array so that we can work with duplicated attributes
* Add support for JSON-formatted tiddler store, and make it the default
The change to `getTiddlersAsJson()` is to allow experimentation
* Move JSON tiddlers into their own store area, and fix support for encrypted tiddlers
Also add a dummy old-style store area for backwards compatibility
The current arrangement is that JSON tiddlers will always override old-style tiddlers.
* Use the deserialiser mechanism to decode the content
* Refactor $:/core/modules/deserializers.js before we start extending it
Cleaning up the helper function names and ordering
* Drop support for the "systemArea" div
It was only used in really old v5.0.x
* Update deserializer to support JSON store format and add some tests
* Life UI restrictions on characters in fieldnames
* Add another test case
* Correct mis-merge
* Remove toLowerCase() methods applied to fieldnames
* Insert line breaks in output of getTiddlersAsJson (#5786)
Rather than have the entire store on one line, insert a line break
after each tiddler.
* Refactor #5786 for backwards compatibility
* Only read .tiddlywiki-tiddler-store blocks from script tags
Prompted by @simonbaird's comment here: https://github.com/Jermolene/TiddlyWiki5/pull/5708#discussion_r648833367
* Clean up escaping of unsafe script characters
It seems that escaping `<` is sufficient
* Add docs from @saqimtiaz
Thanks @saqimtiaz
* Docs tweaks
* Remove excess whitespace
Thanks @simonbaird
* Fix templates for lazy loading
* Remove obsolete item from release note
* Clean up whitespace
* Docs for the jsontiddler widget
* Fix whitespace
Fixes#5840
* Comments
* Fix newlines in JSON store area
* Remove obsolete docs change
Co-authored-by: Simon Baird <simon.baird@gmail.com>
* Exploratory pass at adding support for macro params in filter operands
* whitspace correction
* rename varInfo to varTree for disambiguation
* Refactored parseMacroInvocation to be re-usable, performance improvements for variables with no params and tests
* Revised regular expression and removed spurious white space changes
* Revised regular expression and removed spurious white space changes
* More whitespace cleanup and added more tests for edge cases
* Added test for macro params with square brackets
* html-comment, that can be used in the pragma area
* add commentpragma test
* fix typo
* fix typo and change comments ab bit
* combine html-comment and pragma-comment and add some docs, how to use it
* Make docs simpler by removing caching info
* change h2 wording
* Transclude widget: only refresh when transcluded text reference has changed, includes tests
* Refactor wiki.parseTextReference so it is re-usable for getting the parser info
* Re-arrange methods in wiki.js to improve diff readability