1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-04 11:13:15 +00:00
Commit Graph

433 Commits

Author SHA1 Message Date
yaisog
bfcb386343
Restructure and optimize CheckboxWidget docs (#7362)
* Restructure and optimize `CheckboxWidget` docs

* Minor improvements

* Use new tab macros and some reformatting

* Fix bug in widget-attr-link tooltip

* Minor layout tweaks

* First try at a Widget Documentation Style Guide

* Add new tabs-related macros to overview

* Update CSS, add tm-scroll and rename macros

* Avoid RSoE with tm-scroll, improve CSS for tab-links

* Handle doc-tab-links within tab tiddlers better

* Reflect macro name changes in their docs

* Update Widget Doc Style Guide
2023-04-04 18:00:04 +01:00
jeremy@jermolene.com
95a9c0bd54 Merge branch 'tiddlywiki-com' 2023-03-12 16:19:22 +00:00
yaisog
2bac676ac4
Docs: Align description with example (#7339) 2023-03-07 21:51:52 +00:00
jeremy@jermolene.com
f343198353 Merge branch 'tiddlywiki-com' 2023-03-04 20:42:22 +00:00
yaisog
1946f173a9
Update ActionListopsWidget documentation including notes on de-duplication (#7301)
* Changed headings under Content

Made them H2 and changed the wording a bit.

* Move the list of filters to another tiddler

There is a tiddler for Extended Listops Filters, and the list should go there, so that the Widget tiddler does not get too overcrowded.

* Rework comparison to ActionSetFieldWidget

* Add notes on de-duplication

* Update link to Extended Listops Filters

* Updated link to Extended Listops Filters

* Update link to Extended Listops Filters

Duh. This was the most important one.

* Remove repeated links to widgets within one section

* Re-create original tiddler with a redirect notice

* Excised the examples into a separate tiddler

Also created an "examples" subdirectory under tw5.com/tiddlers/widgets.
2023-03-04 11:48:14 +00:00
Jeremy Ruston
2271f6885a
Add focusSelectFromStart/focusSelectFromEnd attributes to <$edit-text> widget (#7222)
* Initial commit

* WIP

* Align implementation with @yaisog's suggestion

See https://github.com/Jermolene/TiddlyWiki5/pull/7222#issuecomment-1410194593

* Commit missing from 3262b8d77d

Thanks @pmario

* Fix version number

Thanks @yaisog

* Add two examples for text selection (#7286)

---------

Co-authored-by: yaisog <m@rcuswinter.de>
2023-02-25 18:25:46 +00:00
Cameron Fischer
028dfe39b7
Fixed issue where $genesis didn't pass isBlock (#7230)
* Fixed issue where $genesis didn't pass isBlock

* Added $mode attribute for genesis

* Added documentation for $mode attribute
2023-02-10 10:17:32 +00:00
TonyM
8567c48be8
Update BrowseWidget.tid (#7231)
* Update BrowseWidget.tid

Made sure all references to use of the `<$browse>` widget were changed to `<$browse/>`

Which possibly caused this problem, now closed https://github.com/Jermolene/TiddlyWiki5/issues/7223

If not closed other widgets may work

* To documentation standard

Replaced `The content of the `<$browse>` widget is ignored.`
`The content of the <<.wid BrowseWidget>> widget is ignored.`
To restore documentation standards as per   @Jermolene
2023-02-03 19:25:23 +00:00
jeremy@jermolene.com
67a8f7aeba Merge branch 'tiddlywiki-com' 2023-01-19 16:44:09 +00:00
Mario Pietsch
af1cc56c0c
[DOC] Improve ActionCreateTiddlerWidget documentation (#7202)
* [DOC] Improve ActionCreateTiddlerWidget documentation

* action-createtitddler improve docs as requested
2023-01-17 17:29:08 +00:00
jeremy@jermolene.com
4546828541 Genesis widget rewording 2023-01-17 16:56:25 +00:00
jeremy@jermolene.com
1a69fb7e5c Merge branch 'tiddlywiki-com' 2023-01-17 16:48:26 +00:00
Mario Pietsch
db88eed88f
Improve docs for genesis-widget (#7174)
* Improve docs for genesis-widget

* improve wording

* use <<.attr macro instead of <<.param
2023-01-17 16:45:51 +00:00
jeremy@jermolene.com
02d28c100b Merge branch 'tiddlywiki-com' 2023-01-15 18:46:46 +00:00
jeremy@jermolene.com
42a408146d Empty or missing type on genesis widget should not render an element/widget
Fixes #7153
2022-12-30 21:42:07 +00:00
Wincent Balin
d217826375
Fix miscellaneous docs typos (#7143) 2022-12-21 10:07:14 +00:00
Mohammad Rahmani
45a7eb1c03
Add new focus attribute to $select widget (#7081)
* Add focus attribute to $select widget

This address https://github.com/Jermolene/TiddlyWiki5/issues/7070

* Update SelectWidget.tid

Update the documentation for $select widget to include the new attribute: focus
2022-12-03 08:22:21 +00:00
FlashSystems
3918e59cc1
Fixed PR to fix popup position if popup is triggered from within an offsetParent element (#7013)
* Fix popup location for tables

This commit introduces the `popupAbsCoords` option to the $button widget
and implements an absolut coordinate format.

Coordinates for popups are stored in the format `(x,y,w,h)`. These
coordinates are relative to the offset parent of the element that
defines the popup.

This commits adds a second format `@(x,y,w,h)`. Coordinates specified in
this format a relative to the pages root element.

The `popupAbsCoords` option of the $button widget enables the use of
this coordinates.

* Unify the declaration of the RegEx for parsing the popup-position

The regular expression was declared in three locations with the same
content. This commit supplies a new function `parseCoordinates` in
`popup.js`. This function returns the parsed coordinates and understands
the classic/absolute coordinates.

This function is used in `reveal.js` and `action-popup.js` to parse the
coordinates.

* Add documentation for coordinate systems

* Consolidate creating coordinate strings

The Popup object now contains a `buildCoordinates` method that can be
used to build coordinate strings. It takes an "enum" for the coordinate-
system to use. This makes everything easily extensible and prevents the
use of magic values.

* Add tests for `parseCoordinates` and `buildCoordinates`

* Add `tv-popup-abs-coords` to `collectDOMVariables`

This will make the absolute coordinates available for the
`DraggableWidget` and the `EventCatcherWidget`.

* Add documentation for the `tv-popup-abs-coords`

... to the `DraggableWidget` and the `EventCatcherWidget`.

* Fix crash when generating a static version of the TW

The Popup class is not initialized in `startup.js` if `$tw.browser` is
not true. After having consolidated the facilities for parsing
coordinate strings into `popup.js` this breaks because the static build
needs to parse coordinate stings even if no Popup module is initialized.
This commit solves this problem by making `readPopupState`,
`parseCoordinates` and `buildCoordinates` static methods of `popup.js`.
It also adds a comment to these functions to show that these can be called
safely even if the Popup-Class is not initialized.
2022-12-01 21:16:44 +00:00
jeremy@jermolene.com
62f26d6630 Improve genesis widget examples 2022-11-01 10:07:54 +00:00
jeremy@jermolene.com
b9d27e9fd5 Revert "Fix popup position if popup is triggered from within an offsetParent element (#6887)"
This reverts commit 5b85786f73.
2022-10-22 13:22:15 +01:00
FlashSystems
5b85786f73
Fix popup position if popup is triggered from within an offsetParent element (#6887)
* Fix popup location for tables

This commit introduces the `popupAbsCoords` option to the $button widget
and implements an absolut coordinate format.

Coordinates for popups are stored in the format `(x,y,w,h)`. These
coordinates are relative to the offset parent of the element that
defines the popup.

This commits adds a second format `@(x,y,w,h)`. Coordinates specified in
this format a relative to the pages root element.

The `popupAbsCoords` option of the $button widget enables the use of
this coordinates.

* Unify the declaration of the RegEx for parsing the popup-position

The regular expression was declared in three locations with the same
content. This commit supplies a new function `parseCoordinates` in
`popup.js`. This function returns the parsed coordinates and understands
the classic/absolute coordinates.

This function is used in `reveal.js` and `action-popup.js` to parse the
coordinates.

* Add documentation for coordinate systems

* Consolidate creating coordinate strings

The Popup object now contains a `buildCoordinates` method that can be
used to build coordinate strings. It takes an "enum" for the coordinate-
system to use. This makes everything easily extensible and prevents the
use of magic values.

* Add tests for `parseCoordinates` and `buildCoordinates`

* Add `tv-popup-abs-coords` to `collectDOMVariables`

This will make the absolute coordinates available for the
`DraggableWidget` and the `EventCatcherWidget`.

* Add documentation for the `tv-popup-abs-coords`

... to the `DraggableWidget` and the `EventCatcherWidget`.
2022-10-22 13:13:39 +01:00
jeremy@jermolene.com
c19d6d6328 Merge branch 'tiddlywiki-com' 2022-10-17 12:22:06 +01:00
jeremy@jermolene.com
941c09fae2 ScrollableWidget example shouldn't iterate through all tiddlers 2022-10-17 12:21:34 +01:00
jeremy@jermolene.com
d6ff38095b Docs: Fix typo 2022-10-06 10:25:14 +01:00
Jeremy Ruston
db6abb9703
Improve recursion detection for transclusion and filters (#6970) 2022-10-01 10:13:40 +01:00
jeremy@jermolene.com
1df4c29d73 Relax the restriction on the let widget being unable to create variables starting with a dollar 2022-10-01 09:47:26 +01:00
Jeremy Ruston
4e9267ea58
Introduce genesis widget (#6961)
* Initial Commit

* Fix version number

* Fix docs date
2022-09-24 14:07:42 +01:00
jeremy@jermolene.com
608aa3378a Merge branch 'tiddlywiki-com' 2022-08-02 12:21:14 +01:00
jeremy@jermolene.com
75865385a6 Docs: Fix typos
Thanks @amreus

Fixes #6860

Fixes #6859
2022-07-31 15:23:58 +01:00
Saq Imtiaz
613b3df367
Image lazy loading (#6809)
* Extend image widget with lazy loading support

* docs: added from-version to docs update
2022-07-21 15:30:56 +01:00
jeremy@jermolene.com
39996c7a2f Merge branch 'tiddlywiki-com' 2022-07-21 10:11:14 +01:00
jeremy@jermolene.com
93717560dc Docs: Update advice about using counter attribute of list widget 2022-07-18 12:03:42 +01:00
Saq Imtiaz
19331cc6f9
Fix: brittle selector implementation for draggable widget (#6786)
* Fix: fixes #6595, brittle selector implementation for draggable widget

* Docs: updated for fix to selector implementation for draggable widget
2022-07-15 15:38:09 +01:00
jeremy@jermolene.com
a59ec3ebf7 Merge branch 'tiddlywiki-com' 2022-07-04 21:15:23 +01:00
Mario Pietsch
10bc84ba6c
Add Note formatting to an important paragraph in ScrollableWidget (#6729) 2022-06-20 13:51:44 +01:00
jeremy@jermolene.com
c808764254 Merge branch 'tiddlywiki-com' 2022-05-23 09:14:54 +01:00
jeremy@jermolene.com
a9b0c5d7ff Cherry-pick JSON docs improvements from #6522 2022-05-23 09:14:02 +01:00
jeremy@jermolene.com
9e3c233686 Add some warnings about the dangers of title lists 2022-05-23 08:56:10 +01:00
jeremy@jermolene.com
1a377a485b Merge branch 'tiddlywiki-com' 2022-05-14 15:55:42 +01:00
Mario Pietsch
084a5cb0f0
Fix headings in wikitext example code (#6692) 2022-05-14 13:31:36 +01:00
Simon Huber
b4deb7cc45
Add tv-widgetnode-width and tv-widgetnode-height (#6681)
* Add tv-widgetnode-width and tv-widgetnode-height to collectDOMVariables

* Add docs

* update docs

* Update modified field
2022-05-09 10:42:23 +01:00
Robin Munn
8dec674121
Allow checkboxes to be indeterminate (#6593)
* 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.
2022-04-18 20:50:03 +01:00
Simon Huber
383c8b5e49
Add docs for "enable" attribute of draggable widget (#6634) 2022-04-16 16:30:50 +01:00
Simon Huber
58dd47d128
Add "tv-selectednode-width" and "tv-selectednode-height" ... (#6582)
* Add "tv-selectednode-width" and "tv-selectednode-height" ...

... variables to dragstartactions

* Update dragndrop.js

* Update dragndrop.js

* Add docs

* Update dragndrop.js

* Update dragndrop.js

* Update DraggableWidget.tid

* Update modifier Variable.tid

* Update modifier Variable.tid

* Update eventcatcher.js

* Update dom.js

* Update dragndrop.js

* Update dragndrop.js

* Update DraggableWidget.tid

* add a space after //

* Update modifier Variable.tid
2022-04-15 13:46:09 +01:00
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
Jeremy Ruston
1d8c538e45
Eventcatcher widget: add "matchSelector" attribute (#6523)
* Initial Commit

* Allow matchSelector to be used even if selector attribute isn't used
2022-03-14 09:56:23 +00:00
jeremy@jermolene.com
29599baa3b Merge branch 'tiddlywiki-com' 2022-03-01 16:49:36 +00:00
Saq Imtiaz
615d8da64f
Docs: mention MessageCatcher widget in LinkCatcher tiddler (#6485) 2022-02-26 18:59:45 +00:00
Saq Imtiaz
4054566493
Extend $draggable to support an optional drag handle (#6480)
* 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
2022-02-24 11:06:18 +00:00
jeremy@jermolene.com
1a4766c5a1 Merge branch 'tiddlywiki-com' 2022-02-05 16:39:35 +00:00