This repository has been archived by the owner on Oct 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
warning.html
50 lines (46 loc) · 1.78 KB
/
warning.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html lang="en">
<head>
<title>Notification</title>
<link rel="stylesheet" href="reset.css">
<link rel="stylesheet" href="warning.css">
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
</head>
<body>
<div class="topBarWarning">
<img src="./assets/tray/tray-title-icon.png">
<p>YouTube Music by DM</p>
</div>
<div class="warning-body">
<h1 class="warning-text">Do you want to quit the app?</h1>
</div>
<div class="warning-buttons">
<button id="no-button">No</button>
<button id="close">Yes</button>
</div>
<script defer>
const { ipcRenderer } = require('electron')
ipcRenderer.on('data-warning', function(event, arg){
if (arg === 'In order to change this option you are going to have to restart the app.'){
document.querySelector('.warning-text').innerText=arg
document.getElementById('no-button').innerText='Not now'
document.getElementById('close').innerText='Restart now'
document.getElementById('close').addEventListener('click', function(){
ipcRenderer.send('relaunch-app:confirmed')
})
document.getElementById('no-button').addEventListener('click', function(){
window.close()
})
} else {
document.querySelector('.warning-text').innerText=arg
}
});
document.getElementById('close').addEventListener('click', function(){
ipcRenderer.send('closeApp:close')
})
document.getElementById('no-button').addEventListener('click', function(){
window.close()
})
</script>
</body>
</html>