Skip to content

Commit 8d1ea42

Browse files
committed
[HTML] Add support for input and output files
Also allow links that pass `&inputType=json` or `&inputType=string`
1 parent 1c166e0 commit 8d1ea42

File tree

3 files changed

+203
-66
lines changed

3 files changed

+203
-66
lines changed

fiat-html/fiat-crypto.html

+66-19
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
<!DOCTYPE html>
22
<html lang="en">
3+
34
<head>
45
<meta charset="UTF-8">
56
<title>Fiat Cryptography Web Interface</title>
67
<style>
7-
.error { color: red; white-space: pre-wrap; }
8+
.error {
9+
color: red;
10+
white-space: pre-wrap;
11+
}
12+
813
/*code { display: block; white-space: pre-wrap; border: 1px solid #ddd; padding: 10px; position: relative; }*/
914
.code-container {
1015
position: relative;
@@ -16,7 +21,8 @@
1621
border: 1px solid #ddd;
1722
padding: 10px;
1823
position: relative;
19-
/*margin-bottom: 20px;*/ /* Space for the button, adjust as needed */
24+
/*margin-bottom: 20px;*/
25+
/* Space for the button, adjust as needed */
2026
}
2127

2228
.copy-button {
@@ -29,16 +35,44 @@
2935
cursor: pointer;
3036
z-index: 1;
3137
}
32-
.hidden { display: none; }
33-
#inputArgs { width: 100%; box-sizing: border-box; }
34-
.form-row { display: flex; flex-wrap: wrap; align-items: center; }
35-
.form-row label, .form-row button, .status-span, .permalink-span { margin-right: 10px; }
36-
.status-span, .permalink-span { flex-grow: 1; text-align: right; }
37-
.version { color: #333; }
38+
39+
.hidden {
40+
display: none;
41+
}
42+
43+
#inputArgs {
44+
width: 100%;
45+
box-sizing: border-box;
46+
}
47+
48+
.form-row {
49+
display: flex;
50+
flex-wrap: wrap;
51+
align-items: center;
52+
}
53+
54+
.form-row label,
55+
.form-row button,
56+
.status-span,
57+
.permalink-span {
58+
margin-right: 10px;
59+
}
60+
61+
.status-span,
62+
.permalink-span {
63+
flex-grow: 1;
64+
text-align: right;
65+
}
66+
67+
.version {
68+
color: #333;
69+
}
3870
</style>
3971
</head>
72+
4073
<body>
41-
<div id="versionContainer"><span class="version">Fiat Cryptography <span id="version"></span> (<a href="https://github.com/mit-plv/fiat-crypto">GitHub Source</a>)</span></div>
74+
<div id="versionContainer"><span class="version">Fiat Cryptography <span id="version"></span> (<a
75+
href="https://github.com/mit-plv/fiat-crypto">GitHub Source</a>)</span></div>
4276
<form id="inputForm" class="hidden">
4377
<div class="form-row">
4478
<input type="text" id="inputArgs" placeholder="Enter arguments">
@@ -51,7 +85,19 @@
5185
<input type="radio" name="inputType" value="string" checked> Input String
5286
</label>
5387
<label>
54-
<input type="checkbox" id="wasm" name="codeKind" value="wasm"> Use WASM <span id="extraWasmLabel"></span>
88+
<input type="checkbox" id="wasm" name="codeKind" value="wasm"> Use WASM <span
89+
id="extraWasmLabel"></span>
90+
</label>
91+
</div>
92+
<div class="form-row" class="hidden">
93+
<label class="hidden">Stdin
94+
<textarea id="stdin" class="hidden" placeholder="Enter stdin"></textarea>
95+
</label>
96+
<label class="hidden">Files
97+
<textarea id="files" class="hidden" placeholder="Enter files"></textarea>
98+
</label>
99+
<label class="hidden">Output Files
100+
<textarea id="outputFiles" class="hidden" placeholder="Output files"></textarea>
55101
</label>
56102
</div>
57103
<div class="form-row">
@@ -64,14 +110,14 @@
64110
</form>
65111
<div id="error" class="error hidden"></div>
66112
<div id="output" class="hidden">
67-
<div id="stdoutContainer" class="code-container">
68-
<code id="stdout" class="code"></code>
69-
<button class="copy-button" data-target="stdout">Copy</button>
70-
</div>
71-
<div id="stderrContainer" class="code-container hidden">
72-
<code id="stderr" class="code"></code>
73-
<button class="copy-button" data-target="stderr">Copy</button>
74-
</div>
113+
<div id="stdoutContainer" class="code-container">
114+
<code id="stdout" class="code"></code>
115+
<button class="copy-button" data-target="stdout">Copy</button>
116+
</div>
117+
<div id="stderrContainer" class="code-container hidden">
118+
<code id="stderr" class="code"></code>
119+
<button class="copy-button" data-target="stderr">Copy</button>
120+
</div>
75121
</div>
76122
<script src="version.js"></script>
77123
<script src="https://unpkg.com/wasm-feature-detect/dist/umd/index.js"></script>
@@ -80,4 +126,5 @@
80126
<script src="disable-wasm-option.js"></script>
81127
<script src="copy-button.js"></script>
82128
</body>
83-
</html>
129+
130+
</html>

0 commit comments

Comments
 (0)