2019-12-16 18:42:21 +01:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/css/materialize.min.css">
|
|
|
|
<meta charset="UTF-8">
|
2020-03-09 23:37:20 +01:00
|
|
|
<title>Studenci</title>
|
2019-12-16 18:42:21 +01:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<nav>
|
|
|
|
<div class="nav-wrapper">
|
2020-01-13 17:39:09 +01:00
|
|
|
<a class="brand-logo center">@CHECK</a>
|
2019-12-16 18:42:21 +01:00
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
</ul>
|
|
|
|
<script>
|
|
|
|
const electron = require('electron');
|
|
|
|
const {ipcRenderer} = electron;
|
|
|
|
const ul = document.querySelector("ul");
|
|
|
|
|
|
|
|
ipcRenderer.on("item:add",function(e,item) {
|
|
|
|
console.log(item);
|
|
|
|
ul.className = "collection";
|
|
|
|
|
|
|
|
const li = document.createElement('li');
|
|
|
|
|
|
|
|
li.className = "collection-item";
|
|
|
|
|
|
|
|
var date = item[3] ? item[3] : Date.now();
|
|
|
|
|
|
|
|
const itemText = document.createTextNode(item[0] + " " + item[1] + " " + item[2] + " " + date);
|
|
|
|
|
|
|
|
li.appendChild(itemText);
|
|
|
|
li.id = item[2];
|
|
|
|
|
|
|
|
ul.appendChild(li);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
ul.addEventListener('dblclick',removeItem);
|
|
|
|
|
|
|
|
function removeItem(item) {
|
|
|
|
|
|
|
|
ipcRenderer.send("item:delete",item.target.id);
|
|
|
|
|
|
|
|
item.target.remove();
|
|
|
|
|
|
|
|
if (ul.children.length == 0) {
|
|
|
|
ul.className = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</html>
|