Add support to py- events that map all js events available (#561)

* added the  py- events throughout pyscript.ts

* Integrated the py- event throughout the examples

* Fixed spelling error
This commit is contained in:
Leonardo Pliger
2022-06-29 17:49:21 -05:00
committed by GitHub
parent 506ac2574f
commit ee9b0960f7
6 changed files with 109 additions and 20 deletions

View File

@@ -106,7 +106,7 @@ pyscript.run_until_complete(start())
</py-script>
<div class="mb10">
<button id="trackbutton" class="bx--btn bx--btn--secondary" type="button" pys-onClick="toggle_video">
<button id="trackbutton" class="bx--btn bx--btn--secondary" type="button" py-onClick="toggle_video">
Toggle Video
</button>
<button id="nextimagebutton" class="mt10 bx--btn bx--btn--secondary" type="button" disabled>

View File

@@ -131,7 +131,7 @@ pyscript.run_until_complete(start())
<div class="mb10">
<p>Use < > to move, ↓ to crouch and x to jump. If video is enabled, say hi to jump as well! </p>
<button id="trackbutton" class="bx--btn bx--btn--secondary" type="button" pys-onClick="toggle_video">
<button id="trackbutton" class="bx--btn bx--btn--secondary" type="button" py-onClick="toggle_video">
Start Video
</button>
<div id="update-note" py-mount class="updatenote mt10">loading model ..</div>

View File

@@ -49,7 +49,7 @@
<div id="python-status">Python is currently starting. Please wait...</div>
</p>
<p>
<button id="run-all-button" class="btn btn-primary" type="submit" pys-onClick="run_all_micrograd_demo">Run All</button><br>
<button id="run-all-button" class="btn btn-primary" type="submit" py-onClick="run_all_micrograd_demo">Run All</button><br>
<py-script src="/micrograd_ai.py"></py-script>
<div id="micrograd-run-all-print-div"></div><br>
<div id="micrograd-run-all-fig1-div"></div>

View File

@@ -49,8 +49,8 @@
</div>
</div>
<div class="control">
<button id="run" type="button" class="button is-primary" pys-onClick="run">Run!</button>
<button id="clear" type="button" class="button is-danger" pys-onClick="clear">Clear</button>
<button id="run" type="button" class="button is-primary" py-onClick="run">Run!</button>
<button id="clear" type="button" class="button is-danger" py-onClick="clear">Clear</button>
</div>
</div>

View File

@@ -28,7 +28,7 @@
</div>
<div>
<input id="new-task-content" class="py-input" type="text">
<button id="new-task-btn" class="py-button" type="submit" pys-onClick="add_task">
<button id="new-task-btn" class="py-button" type="submit" py-onClick="add_task">
Add task
</button>
</div>