-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
62 lines (49 loc) · 1.86 KB
/
index.html
File metadata and controls
62 lines (49 loc) · 1.86 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
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PurePopup v1.0</title>
<link rel="stylesheet" href="purePopup.css">
</head>
<body>
<div id="button">Click me</div>
<script>
document.getElementById('button').addEventListener('click', function(){
PurePopup.prompt({
title: 'Please, introduce yourself',
buttons: {
okButton: 'Continue',
cancelButton: 'Cancel'
},
inputs: {
nameInput: 'Name:',
emailInput: 'Email:'
}
}, function(result) {
if (result.confirm == 'okButton') {
PurePopup.alert({
title: 'Nice to meet you, ' + result.nameInput + ' ' + result.emailInput
});
} else if (result.confirm == 'cancelButton') {
PurePopup.confirm({
title: 'Do you really want to quit?',
buttons: {
yes: 'Yes, I do',
no: 'No'
},
}, function(result) {
if (result.confirm == 'yes') {
PurePopup.alert({title: 'So, goodbye'});
} else if (result.confirm == 'no') {
PurePopup.alert({title: 'Thank you'});
}
});
} else if (result.confirm == 'noActionCancel') {
// nothing to do
}
});
});
</script>
<script src="purePopup.js"></script>
</body>
</html>