* Extend element widget with support for CSS custom properties.
* chore: added tests
* chore: code style
* docs: added documentation for support for CSS custom properties
* docs: added documentation for support for CSS custom properties
* create empty tags only if template or additionalFields contain a tags-field
* fix typos
* add tests for tm-new-tiddler message
* tm-new-tiddler add standard test with tags field
* add $compound-filter parameter to data-widget
* update TestCaseTemplate to use $compound-filter parameter
* update data-widget, TestCaseTiddlers and CompoundTiddlers docs
* Introduced preliminary idea for infinite recurse exception
* Better handling of infinite recursion
But it could be better still...
* the TransclusionError is a proper error
Moved the magic number to be on the error's class. Not sure if that's
a great idea.
* Fixed minor minor issue that came up in conflict
The minor fix to the jasmine regexp that escaped a '+' somehow
broke some random test.
* Initial Commit
* Add note to preview build
* Fix whitespace and indenting
Thanks @pmario
* Fix crash with unset $tiddler attribute on <$data> widget
Thanks @CodaCodr
* Don't duplicate "description" field in test cases
* Use different background colours for nested testcase widgets
* Extend the testcase widget to run tests
* Add testcases to control panel
* Add a view template body template to render testcase tiddlers
* Test edition should display testcases
* Whitespace fixes
* Make testcase tiddler tempalte link to itself
* Styling tweaks
* Docs improvements
* Styling tweaks
* Run the new tw5.com testcases in the test edition
* Update data widget to display its content in JSON
* Add testcase convenience procedure
* Clearer testcases for data widget, and docs tweaks
* Don't expect our intentionally failing test to pass
* Extend testcase default template so that the display format can be chosen
It is selected by setting the variable "displayFormat"
* DataWidget docs typo
* Fix data widget not refreshing
* Links in testcase output switch to the tab containing that tiddler
Thanks to @btheado for the suggestion
* Docs update for 648855e8a5
* Wording tweak
* Add support for narrative tiddlers in test cases
* Documentation improvements
* Cleanup comments
* Remove obsolete code comments
* Simplify template
* Docs update
* Rename $:/core/ui/testcases/DefaultTemplate/SourceTabs from $:/core/ui/testcases/DefaultTemplate/Source
* Use the view template body for failing tests
* Don't reference the geospatial plugin
* "Test case" should be two words
* Fix handling of currentTiddler variable
Fixes problem reported by @btheado in https://github.com/Jermolene/TiddlyWiki5/pull/7817#issuecomment-2103704468
* Prepare for merging
* Start on some tests for <$action-deletefield />
* Only update modified field if we actually delete a field
…in the <$action-deletefield /> widget.
Fixes a bug where <$action-deletefield foo /> would update the modified field
if the "foo" field wasn't present on a tiddler.
* action-deletefield: Test when modified does and doesn't exist
* Add $timestamp argument to action-deletefield
To make it more consistent with other tiddler-manipulating action widgets
* Add docs for action-deletefield $timestamp
* Update draggable.js - rename updateDomNodeClasses to assignDomNodeClasses
If I'm not wrong then the "updateDomNodeClasses" is unused and the "assignDomNodeClasses" is missing
This renames "updateDomNodeClasses" to "assignDomNodeClasses"
* Use "updateDomNodeClasses"
* Add join attribute to list widget
* Use new join attribute in HTML saving templates
This simplifies the logic involved in saving tiddlers in JSON format
into TW html files, and should also slightly speed up the saving process
depending on how often that list widget gets refreshed.
* Unit tests for list widget's new join attribute
* Add `<$list-join>` widget
Allows specifying complicated join text more easily than an attribute
* Add data attribute support to button widget
* Fix typo
* Refactor ready for making mechanism more generic
* Apply more generic implementation to multiplate widgets
* Refactor to use existing widget.assignAttributes() method
* Fix typo
* Clarify docs
* Update docs
* Update select widget to support style.* attributes
* Remove obsolete comment
* Fixes refresh issues for checkbox and links widgets for data attributes (#7846)
* fix: refresh issues with checkbox and links widgets
* fix: indenting
* Feat: add support for data attributes to Draggable and Droppable widgets (#7845)
* Docs clarification
* docs: add style and data attributes to Draggable and Droppable widget docs (#7850)
* Refactors Select widget to directly create DOM node (#7848)
* fix: refactored SelectWidget to directly create DOM nodes
* fix: refactored SelectWidget to directly create DOM nodes
* fix: improve refresh handling for select widget
* Fixes issues in the PR "Button widget data attributes" (#7852)
* fix: fixed ordered attributes handling and improved tests to catch event attributes
* fix: clean up code from testing
* fix: more tests and refactoring
* fix: use lowercase when checking for event attribute prefix
* fix: use lowercase when checking for event attribute prefix
* fix: changed comment wording
* fix: minor refactoring
* refactor: for brevity
---------
Co-authored-by: Saq Imtiaz <saq.imtiaz@gmail.com>
* Add usemap attribute to image macro
Allow for a usemap attribute on the $image macro call which is passed through to the resulting img tag. This makes the use of HTML image maps [1] possible.
[1]: <https://www.w3schools.com/html/html_images_imagemap.asp>
* Document new usemap attribute in ImageWidget
* Update version docs
---------
Co-authored-by: Jeremy Ruston <jeremy@jermolene.com>
* Alternate fix for inconsistent list template syntax
First attempt, which fails on the ListWidget/WithMissingTemplate test.
* Make WithMissingTemplate test pass, inefficiently
Unfortunately, this ends up being very inefficient, because the
clone-and-mutate logic is repeated for every list item. Not ideal.
* More efficient way to do it
This also makes the failing test pass, but far more efficiently.
* Improve performance of list template discovery
Since parse tree nodes never change after widget creation (whereas
attribute values *can* change), we can safely search for the explicit
list templtaes only once, at widget creation time. This saves time as
the search doesn't have to be done on each re-render, and also allows us
to safely do a clone-and-mutate step to extract the list widget's body
(if any) without any `$list-empty` or other items. That, in turn, allows
using the list widget's body as the template even if `$list-empty` is
specified inside the widget body.
* Passing test
* Failing test
* Fix test
It still fails, but now fails correctly
* Fix refreshing transcluded functions (#7755)
We store the previous result of the filter function and recalculate it
when the transclude widget needs to be refreshed, refreshing the widget
if the result is different.
---------
Co-authored-by: Jeremy Ruston <174761+Jermolene@users.noreply.github.com>
Co-authored-by: Robin Munn <rmunn@pobox.com>
* Add failing test for list widget with counter-last
The failing test appends a value to a list without changing the rest of
the list, and the counter-last value doesn't get updated correctly when
that happens. Also added another test, which passes, testing removing
the last item of the list, just in case of a regression.
* Improve unit tests for counter-last list widget bug
The unit tests were looking very similar to each other, so I factored
out the common code and made them into simple data-driven tests.
* Fix bug where counter-last fails in list widget
The only scenario that was failing was when counter-last was used, but
the list was strictly appended to with no other changes made. The one
unit test that was failing now passes with this fix.
* Improve bugfix to list widget counter-last
Now we only refresh the last item if it was truly necessary.
* Refactor parse mode out of getTransclusionTarget
* Refactor missing transclusion target
* Add a test to avoid regressions on the handling of macros vs procedures
* Refactor condition logic
* Preparing to split getTransclusionTarget into two separate functions
* Split getTransclusionTarget into getTransclusionTargetIncludingParseTreeNodes
* Resolve another inefficiency
The transclusion target was sometimes being parsed twice when transcluding as text/plain
Associated test results are also made more consistent
* Simplify method naming
* Neatening up