8000 Attrs doc (#1125) · katv7/pyscript@41a8d80 · GitHub
[go: up one dir, main page]

Skip to content

Commit 41a8d80

Browse files
authored
Attrs doc (pyscript#1125)
* adds attr ref * lint * address comments * Addressing to Fabio's rewrite
1 parent 03e798a commit 41a8d80

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

docs/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Documentation
2727
- Fixed 'Direct usage of document is deprecated' warning in the getting started guide. ([#1052](https://github.com/pyscript/pyscript/pull/1052))
2828
- Added reference documentation for the `py-splashscreen` plugin ([#1138](https://github.com/pyscript/pyscript/pull/1138))
2929
- Adds doc for installing tests ([#1156](https://github.com/pyscript/pyscript/pull/1156))
30+
- Adds docs for custom Pyscript attributes (`py-*`) that allow you to add event listeners to an element ([#1125](https://github.com/pyscript/pyscript/pull/1125))
3031

3132
Deprecations and Removals
3233
-------------------------

docs/reference/API/attr_to_event.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# List of PyScript Attributes to Events:
2+
3+
PyScript provides a convenient syntax for mapping JavaScript events to PyScript events, making it easy to connect events to HTML tags.
4+
5+
For example, you can use the following code to connect the click event to a button:
6+
7+
```
8+
<button id="py-click" py-onClick="foo()">Click me</button>
9+
```
10+
11+
Here is a list of all the available event mappings:
12+
13+
| PyScript Event Name | DOM Event Name |
14+
|-------------------|----------------|
15+
| py-onClick | click |
16+
| py-onKeyDown | keydown |
17+
| py-afterprint | afterprint |
18+
| py-beforeprint | beforeprint |
19+
| py-beforeunload | beforeunload |
20+
| py-error | error |
21+
| py-hashchange | hashchange |
22+
| py-load | load |
23+
| py-message | message |
24+
| py-offline | offline |
25+
| py-online | online |
26+
| py-pagehide | pagehide |
27+
| py-pageshow | pageshow |
28+
| py-popstate | popstate |
29+
| py-resize | resize |
30+
| py-storage | storage |
31+
| py-unload | unload |
32+
| py-blur | blur |
33+
| py-change | change |
34+
| py-contextmenu | contextmenu |
35+
| py-focus | focus |
36+
| py-input | input |
37+
| py-invalid | invalid |
38+
| py-reset | reset |
39+
| py-search | search |
40+
| py-select | select |
41+
| py-submit | submit |
42+
| py-keydown | keydown |
43+
| py-keypress | keypress |
44+
| py-keyup | keyup |
45+
| py-click | click |
46+
| py-dblclick | dblclick |
47+
| py-mousedown | mousedown |
48+
| py-mousemove | mousemove |
49+
| py-mouseout | mouseout |
50+
| py-mouseover | mouseover |
51+
| py-mouseup | mouseup |
52+
| py-mousewheel | mousewheel |
53+
| py-wheel | wheel |
54+
| py-drag | drag |
55+
| py-dragend | dragend |
56+
| py-dragenter | dragenter |
57+
| py-dragleave | dragleave |
58+
| py-dragover | dragover |
59+
| py-dragstart | dragstart |
60+
| py-drop | drop |
61+
| py-scroll | scroll |
62+
| py-copy | copy |
63+
| py-cut | cut |
64+
| py-paste | paste |
65+
| py-abort | abort |
66+
| py-canplay | canplay |
67+
| py-canplaythrough | canplaythrough |
68+
| py-cuechange | cuechange |
69+
| py-durationchange | durationchange |
70+
| py-emptied | emptied |
71+
| py-ended | ended |
72+
| py-loadeddata | loadeddata |
73+
| py-loadedmetadata | loadedmetadata |
74+
| py-loadstart | loadstart |
75+
| py-pause | pause |
76+
| py-play | play |
77+
| py-playing | playing |
78+
| py-progress | progress |
79+
| py-ratechange | ratechange |
80+
| py-seeked | seeked |
81+
| py-seeking | seeking |
82+
| py-stalled | stalled |
83+
| py-suspend | suspend |
84+
| py-timeupdate | timeupdate |
85+
| py-volumechange | volumechange |
86+
| py-waiting | waiting |
87+
| py-toggle | toggle |

0 commit comments

Comments
 (0)
0