-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apprun-play: add attr: code, hide_button
- Loading branch information
Showing
8 changed files
with
192 additions
and
165 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>AppRun Play</title> | ||
<link rel="stylesheet" href="demo/lib/codemirror.css"> | ||
<script src="demo/lib/codemirror.js"></script> | ||
<script src="demo/mode/javascript/javascript.js"></script> | ||
<script src="demo/mode/xml/xml.js"></script> | ||
<script src="demo/mode/jsx/jsx.js"></script> | ||
<script src="dist/apprun-play.js"></script> | ||
</head> | ||
<body> | ||
<textarea style="width:100%; height:300px"> | ||
const state = 0; | ||
const view = state => { | ||
return `<div> | ||
<h1>${state}</h1> | ||
<button onclick='app.run("-1")'>-1</button> | ||
<button onclick='app.run("+1")'>+1</button> | ||
</div>`; | ||
}; | ||
const update = { | ||
'+1': state => state + 1, | ||
'-1': state => state - 1 | ||
}; | ||
app.start(document.body, state, view, update); | ||
</textarea> | ||
<apprun-play></apprun-play> | ||
|
||
<textarea> | ||
<html> | ||
<body> | ||
<script src="https://unpkg.com/apprun/dist/apprun-html.js"></script> | ||
<script> | ||
const view = state => `<div>${state}</div>`; | ||
app.start(document.body, 'hello world', view); | ||
</script> | ||
</body> | ||
</html> | ||
</textarea> | ||
<p> | ||
<apprun-play></apprun-play> | ||
</p> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.