55 lines
1.3 KiB
HTML
55 lines
1.3 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
|
||
|
<head>
|
||
|
<!-- Compiled and minified CSS -->
|
||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/css/materialize.min.css">
|
||
|
<meta charset="UTF-8">
|
||
|
|
||
|
<title>Add classes</title>
|
||
|
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<div class="container">
|
||
|
<form>
|
||
|
<div>
|
||
|
<h5 class="center">Enter class data</h3>
|
||
|
<br /> Professor:
|
||
|
<input type="text" id="professor" required autofocus/>
|
||
|
<br /> Class name:
|
||
|
<input type="text" id="name" required autofocus/>
|
||
|
<br /> Date:
|
||
|
<input type="datetime-local" id="date" class="c-datepicker-input" required autofocus/>
|
||
|
</div>
|
||
|
<br />
|
||
|
<button class="btn waves-effect waves-light" type="submit">Add</button>
|
||
|
</form>
|
||
|
</div>
|
||
|
|
||
|
<script>
|
||
|
const electron = require('electron');
|
||
|
const {
|
||
|
ipcRenderer
|
||
|
} = electron;
|
||
|
|
||
|
const form = document.querySelector("form");
|
||
|
form.addEventListener("submit", submitForm);
|
||
|
|
||
|
function submitForm(e) {
|
||
|
e.preventDefault();
|
||
|
|
||
|
var name = document.querySelector("#name").value;
|
||
|
var professor = document.querySelector("#professor").value;
|
||
|
var date = document.querySelector("#date").value;
|
||
|
|
||
|
var item = [name, professor, date];
|
||
|
|
||
|
ipcRenderer.send("item:add_class", item);
|
||
|
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
</body>
|
||
|
|
||
|
</html>
|