Initial Commit
This commit is contained in:
16
client/index.html
Normal file
16
client/index.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Printer</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<input class="input" id="name" type="text" placeholder="Your name">
|
||||
<input class="input" id="coords" type="text" placeholder="Your coordinates (lat,long)">
|
||||
<input class="update" id="update" type="submit" value="Submit" onclick="print();">
|
||||
<script src="main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
18
client/main.js
Normal file
18
client/main.js
Normal file
@@ -0,0 +1,18 @@
|
||||
async function print() {
|
||||
let name = document.getElementById('name').value;
|
||||
let coords = document.getElementById('coords').value;
|
||||
|
||||
if (name == '' || coords == '') {
|
||||
alert('One of the fields is empty');
|
||||
return;
|
||||
}
|
||||
|
||||
let http = new XMLHttpRequest();
|
||||
|
||||
let string = '/print?name=' + name + '&coords=' + coords;
|
||||
await http.open('GET', string, true);
|
||||
await http.send();
|
||||
|
||||
document.getElementById('coords').value = '';
|
||||
document.getElementById('name').value = '';
|
||||
}
|
||||
15
client/style.css
Normal file
15
client/style.css
Normal file
@@ -0,0 +1,15 @@
|
||||
input {
|
||||
|
||||
}
|
||||
|
||||
.input {
|
||||
|
||||
}
|
||||
|
||||
.update {
|
||||
|
||||
}
|
||||
|
||||
.update:hover {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user