-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ d75d57d 🚀
- Loading branch information
1 parent
b804a0d
commit 8a98a52
Showing
11 changed files
with
2,759 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>t5.rs</title> | ||
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta charset="UTF-8" /> | ||
<link rel="stylesheet" href="./out/tailwind.css"> | ||
|
||
</head> | ||
<body> | ||
<div id="main"></div> | ||
<script type="module"> | ||
import init from "/./assets/dioxus/t5-rs.js"; | ||
init("/./assets/dioxus/t5-rs_bg.wasm").then(wasm => { | ||
if (wasm.__wbindgen_start == undefined) { | ||
wasm.main(); | ||
} | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
233 changes: 233 additions & 0 deletions
233
assets/dioxus/snippets/dioxus-interpreter-js-7c1300c6684e1811/inline0.js
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
assets/dioxus/snippets/dioxus-interpreter-js-7c1300c6684e1811/src/js/common.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
assets/dioxus/snippets/dioxus-web-84af743b887ebc54/inline0.js
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,11 @@ | ||
|
||
export function get_form_data(form) { | ||
let values = new Map(); | ||
const formData = new FormData(form); | ||
|
||
for (let name of formData.keys()) { | ||
values.set(name, formData.getAll(name)); | ||
} | ||
|
||
return values; | ||
} |
12 changes: 12 additions & 0 deletions
12
assets/dioxus/snippets/dioxus-web-84af743b887ebc54/inline1.js
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,12 @@ | ||
|
||
export function get_select_data(select) { | ||
let values = []; | ||
for (let i = 0; i < select.options.length; i++) { | ||
let option = select.options[i]; | ||
if (option.selected) { | ||
values.push(option.value.toString()); | ||
} | ||
} | ||
|
||
return values; | ||
} |
41 changes: 41 additions & 0 deletions
41
assets/dioxus/snippets/dioxus-web-84af743b887ebc54/src/eval.js
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,41 @@ | ||
export class Dioxus { | ||
constructor(sendCallback, returnCallback) { | ||
this.sendCallback = sendCallback; | ||
this.returnCallback = returnCallback; | ||
this.promiseResolve = null; | ||
this.received = []; | ||
} | ||
|
||
// Receive message from Rust | ||
recv() { | ||
return new Promise((resolve, _reject) => { | ||
// If data already exists, resolve immediately | ||
let data = this.received.shift(); | ||
if (data) { | ||
resolve(data); | ||
return; | ||
} | ||
|
||
// Otherwise set a resolve callback | ||
this.promiseResolve = resolve; | ||
}); | ||
} | ||
|
||
// Send message to rust. | ||
send(data) { | ||
this.sendCallback(data); | ||
} | ||
|
||
// Internal rust send | ||
rustSend(data) { | ||
// If a promise is waiting for data, resolve it, and clear the resolve callback | ||
if (this.promiseResolve) { | ||
this.promiseResolve(data); | ||
this.promiseResolve = null; | ||
return; | ||
} | ||
|
||
// Otherwise add the data to a queue | ||
this.received.push(data); | ||
} | ||
} |
Oops, something went wrong.