1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 10:29:54 +00:00
Commit Graph

35 Commits

Author SHA1 Message Date
Jeremy Ruston
62bb8affa4
Add data attribute support to button and other widgets (#7769)
* 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>
2023-11-22 20:05:40 +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
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
btheado
7a50603d9d
Added MessageHandlerWidgets and TriggeringWidgets tags (#6161) 2021-11-01 12:56:52 +00:00
jeremy@jermolene.com
0d434583ec Merge branch 'tiddlywiki-com' 2020-11-19 10:01:23 +00:00
Robin Munn
d8d88c67e3
Fix minor mistake in ButtonWidget docs (#5050)
The ButtonWidget documentation refers to a "state" attribute, but this
should probably be "set". The name "state" appears to be an artifact
from when the setTitle, setField, and setIndex attributes were added to
the widget; at one time they were called stateTitle and so on, and then
they were renamed to setTitle instead, but not every instance of "state"
was found and renamed to "set". This is one such instance, now fixed.
2020-11-16 16:50:32 +00:00
saqimtiaz
71194d8767
Added disabled attribute support to ButtonWidget (#5010)
* Added disabled attribute to ButtonWidget

* Update ButtonWidget.tid
2020-11-08 22:32:27 +00:00
Simon Huber
00ff0d6fa0
Add modifier variable to button actionstring (#4671)
* Add modifier variable to button actionstring

* Update ButtonWidget.tid

* Update droppable.js

* Create getEventModifierKeyDescriptor method in keyboard.js

* Update droppable.js

* Update button.js
2020-07-14 17:04:06 +01:00
Jeremy Ruston
9ae2c15638 Merge branch 'tiddlywiki-com' 2020-03-30 14:29:55 +01:00
saqimtiaz
5b3443947e
Update documentation for tabindex support for ButtonWidget (#4465)
Documentation for changes introduced in https://github.com/Jermolene/TiddlyWiki5/pull/4442
2020-02-23 11:27:49 +00:00
Jeremy Ruston
b454e809f3 Docs: Fix typos in button widget docs 2020-01-31 17:15:09 +00:00
BurningTreeC
eea034c32d Docs: add state* documentation to button and reveal widgets (#3553)
* docs: add state* attributes to reveal widget

* docs: add state* attributes to button widget
2018-11-19 17:59:04 +00:00
Jermolene
33e636cbe7 Docs: Add popupmechanism link to Button widget docs
Fixes #3284
2018-05-16 16:23:57 +01:00
Jermolene
40a61ff2e7 The last batch of drag and drop docs 2017-04-06 10:15:22 +01:00
Myeongjin
80256b4dab Update document in tiddlywiki.com edition
* Add string '.htm' to 'Saving with TiddlyIE'
* Change external links to match locale with wiki language
* Add instructions for use to 'Saving on Android'
* Change string in 'task'
* Change instructions for use in 'Saving on iPad/iPhone'
* Add newline to 'TiddlyDesktop Releases'
* Remove caption from 'Serving TW5 from Android'
* Change link to external in tiddlers which tagged 'Editions'
* Remove string 'index.html' from 'Some of the things you can do with TiddlyWiki'
* Change link 'TiddlyWiki Groups' to 'Forums' in tiddlers which tagged 'Community'
* Remove CamelCase link 'TiddlyWiki' from tiddlers tagged 'Community'
* Change string 'done' to 'Upgrade' in 'UpgradeMechanism'
* Change buttons to images in 'How to export tiddlers'
* Add images about buttons to tiddlers
* Add quotation mark to text 'edit' in 'Signing the Contributor License Agreement'
* Rename 'UsingSVG' to 'Using SVG'
* Change link 'TypedBlockWikiText' to 'Typed Blocks in WikiText' in 'Using SVG'
* Add tiddler 'Using Stamp'
* Add 'rel="noopener noreferrer"' to external links
* Add description about 'rel="noreferrer"' to 'HTML in WikiText'
* Add link of prerelease version about translators edition, and how to translate on Node.js, in 'Translate TiddlyWiki into your language'
* Change string 'dropdown' to 'tab' in 'Installing a plugin from the plugin library'
* Add download button to 'Empty Edition'
2016-07-06 01:10:51 +09:00
Jermolene
3c20f2396e Add support for assigning action widgets via the actions attribute
This is quite a big change: a new way to invoke action widgets.

The advantage is that it solves #2217 and #1564, a long running problem
that prevented us from adding action widgets to widgets that modify the
store.

This commit adds the new technique for the button and keyboard widgets,
but also extends the select widget to trigger action widgets for the
first time
2016-04-29 18:54:44 +01:00
afeldspar
7492086f31 add explanation on 'set' attribute
Attempted a fix for the problem I raised in #2038, by adding an explanation of why a TextReference in a button widget's 'set' attribute will lack the curly braces seen nearly anywhere else a TextReference is used as a widget attribute.
2015-10-20 21:15:58 -04:00
Jermolene
4a30d8772c Update button widget docs 2015-06-19 12:12:41 +01:00
Jermolene
e518c0e88e Fix typo #1681
Thanks @Ishindri
2015-04-27 13:25:43 +01:00
Tobias Beer
2317840ce6 updated documentation for link-button 2014-12-16 15:36:20 +01:00
Tobias Beer
05a794d5b8 documentation for making buttons look like links
added instructions to button widget documentation
2014-12-15 17:55:56 +01:00
Jermolene
0dcf54c3b5 Add support for action widgets
This is part of the groundwork for fixing #336
2014-10-08 17:45:26 +01:00
Jermolene
3048b79a45 Update button widget docs
Fixes #927
2014-10-05 16:33:05 +01:00
Jermolene
bc985553ed More reference docs mangling 2014-09-11 15:52:47 +01:00
Jermolene
e20ef97c27 More mangling of reference docs 2014-09-11 00:06:19 +01:00
Jermolene
617963bd88 Update button widget docs 2014-06-17 10:49:13 +01:00
Jermolene
06b0f9adb7 Added aria-label attribute to link widget
And document it for the button widget
2014-06-17 07:54:10 +01:00
Jermolene
433ac8e96e Typo fix 2014-04-17 12:52:38 +01:00
Jermolene
f649b5b037 Extend button widget to set text references
Previously the `set` attribute could only be used to identify a
tiddler, not a full text reference.
2014-03-15 17:02:13 +00:00
Jermolene
2ab0facf3a Extend button widget to allow navigating to a tiddler
Fixes #327
2014-02-22 16:13:16 +00:00
Jermolene
2ffcbb76eb Remove modifier and creator fields from tiddlers in tw5.com
Keeps things tidier
2013-12-11 07:57:12 +00:00
Jeremy Ruston
ed6fd475ab Add 'default' attribute to button widget
This allows us to do things like tab controls properly.
2013-11-04 09:59:26 +00:00
Jeremy Ruston
fd70aa8c45 Get rid of the qualifyTiddlerTitles hack
Now, finally, we can implement qualifyTiddlerTitles as a macro.
2013-11-02 15:42:24 +00:00
Jeremy Ruston
fbc1f5e5f6 Lots and lots and lots of docs updates
Now we've got up-to-date skeleton documentation for all the widgets
2013-10-31 22:03:40 +00:00