-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for MVC and fix pylint errors
- Loading branch information
Showing
14 changed files
with
596 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# LTK - Copyright 2023 - All Rights Reserved - chrislaffra.com - See LICENSE | ||
|
||
import ltk | ||
|
||
class Product(ltk.Model): | ||
""" This is a model with two fields """ | ||
name: str = "" | ||
price: float = 0.0 | ||
|
||
product = Product() | ||
|
||
def clear(event): | ||
product.name = "" | ||
|
||
def create(): | ||
return ( | ||
ltk.VBox( | ||
ltk.Heading2("LTK Model-View Demo"), | ||
|
||
ltk.Label("Product Name (as ltk.Input):"), | ||
ltk.Input(product.name) | ||
.attr("placeholder", "Please enter a name") | ||
.css("border", "2px solid red"), | ||
|
||
ltk.Break(), | ||
|
||
ltk.Label("Product Name (as ltk.Text):"), | ||
ltk.Text(product.name) | ||
.css("border", "2px solid green") | ||
.css("height", 34), | ||
|
||
ltk.Break(), | ||
ltk.Button("Clear product.name", ltk.proxy(clear)), | ||
) | ||
.css("font-size", 24) | ||
.attr("name", "MVC") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,4 @@ function startTime() { | |
} | ||
|
||
setupRuntime() | ||
setupToggle() | ||
|
||
pyodide.setDebug(true) | ||
setupToggle() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
# LTK - Copyright 2023 - All Rights Reserved - chrislaffra.com - See LICENSE | ||
""" | ||
Copyright 2023 - All Rights Reserved - chrislaffra.com - See LICENSE | ||
LTK (Little Toolkit) is a library for building client-side web applications using Python and CSS. | ||
""" | ||
|
||
from ltk.jquery import * | ||
from ltk.widgets import * | ||
from ltk.pubsub import * | ||
from ltk.logger import * | ||
|
||
( | ||
ltk.Link("https://github.com/laffra/ltk", "built with LTK") | ||
ltk.Link("https://github.com/pyscript/ltk", "built with LTK") | ||
.addClass("ltk-built-with") | ||
.attr("target", "_blank") | ||
.appendTo(jQuery(window.document.body)) | ||
) | ||
.appendTo(window.jQuery(window.document.body)) | ||
) |
Oops, something went wrong.