-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddWindow.html
More file actions
53 lines (52 loc) · 1.44 KB
/
addWindow.html
File metadata and controls
53 lines (52 loc) · 1.44 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<form>
<div>
<label>Enter Item</label>
<input type="text" id="item" autofocus>
</div>
<button type="submit" id="submit">add item</button>
</form>
<script>
const electron = require('electron');
const{ipcRenderer} = electron;
//
// const form = document.querySelector('form');
// form.addEventListener('submit', submitForm);
//
// //append before prototype
//
// Element.prototype.appendBefore = function (element) {
// element.parentNode.insertBefore(this, element);
// },false;
//
// //Append after prototype
//
// Element.prototype.appendAfter = function (element) {
// element.parentNode.insertBefore(this, element.nextSibling);
// },false;
//
// // add item
// function submitForm(e){
// e.preventDefault();
// const item = document.querySelector('#item').value;
// const span = document.createElement('span');
// if(item == ''){
// const itemElement = document.querySelector('#item')
// span.textContent = 'Please enter name';
// span.appendAfter(itemElement);
// span.style.color = 'red';
// span.style.fontSize = '10px';
// }
// else{
// ipcRenderer.send('item:add', item);
// }
// }
</script>
</body>
</html>