forked from pinokiocomputer/pinokio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prompt.html
30 lines (30 loc) · 904 Bytes
/
prompt.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<html>
<head>
<style>body {font-family: sans-serif;} button {float:right; margin-left: 10px;} label { display: block; margin-bottom: 5px; width: 100%; } input {margin-bottom: 10px; padding: 5px; width: 100%; display:block;}</style>
<script>
document.addEventListener("DOMContentLoaded" () => {
document.querySelector("#cancel").addEventListener("click", (e) => {
debugger
e.preventDefault()
e.stopPropagation()
window.close()
})
document.querySelector("form").addEventListener("submit", (e) => {
e.preventDefault()
e.stopPropagation()
debugger
window.electronAPI.send('prompt-response', document.querySelector("#val").value)
window.close()
})
})
</script>
</head>
<body>
<form>
<label for="val">${arg.title}</label>
<input id="val" value="${arg.val}" autofocus />
<button id='ok'>OK</button>
<button id='cancel'>Cancel</button>
</form>
</body>
</html>