-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdemo.html
45 lines (37 loc) · 1.2 KB
/
demo.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
<!DOCTYPE html>
<html>
<head>
<title>Material UI Dialogs</title>
<script src="./dist/material-ui-dialogs.js"></script>
<script>
window.showAlert = function (title, message) {
MuiDialogs.alert(title, message)
.then(() => alert('Alert has been dismissed'))
}
window.showConfirm = function (title, message) {
MuiDialogs.confirm(title, message)
.then(result => alert(`You elected to ${result ? 'proceed' : 'cancel'}.`))
}
window.showPrompt = function (title, message, defaultValue) {
MuiDialogs.prompt(title, message, defaultValue)
.then(alert)
}
</script>
</head>
<body>
<h1>Demo</h1>
<h2>Alert</h2>
<ul>
<li><a href="javascript: showAlert('Hey there')">Show alert with default title</a></li>
<li><a href="javascript: showAlert('My custom title', 'Hey there')">Show alert with custom title</a></li>
</ul>
<h2>Confirmation</h2>
<ul>
<li><a href="javascript: showConfirm('Please Confirm', 'Are you sure?')">Show confirmation</a></li>
</ul>
<h2>Prompt</h2>
<ul>
<li><a href="javascript: showPrompt('Please provide input', 'What would you like me to say?', '(type here)')">Show prompt</a></li>
</ul>
</body>
</html>