-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples.html
107 lines (91 loc) · 3.14 KB
/
examples.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>Fomantic-UI Alert</title>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.js"></script>
<script src="./src/fui-alert.js"></script>
</head>
<body>
<button id="basic" class="ui primary button">Basic Alert</button>
<button id="titletext" class="ui primary button">A title with a text under</button>
<button id="confirm" class="ui primary button">A confirm dialog</button>
<button id="html" class="ui primary button">Some HTML content</button>
<button id="input" class="ui primary button">An input</button>
<style>
body {
padding: 1rem;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$('#basic').click(function() {
fuialert.fire({
title: 'Any fool can use a computer',
size: 'mini',
icon: 'exclamation',
});
});
$('#titletext').click(function() {
fuialert.fire({
title: 'The Internet?',
text: 'That thing is still around?',
size: 'large'
});
});
$('#confirm').click(function() {
fuialert.fire({
title: 'Are you sure?',
text: `You won't be able to revert this!`,
icon: 'exclamation',
showCancelButton: true,
cancelButtonIcon: 'times',
confirmButtonText: 'Yes, delete it!',
confirmButtonColor: 'red',
confirmButtonIcon: 'check',
position: 'top',
transition: 'vertical flip'
}).then((result) => {
console.log('retour', result);
if (result.value) {
fuialert.fire({
title: 'Your file has been deleted!',
size: 'mini',
icon: 'check',
});
} else {
fuialert.fire({
title: 'Your file has been preserved!',
size: 'mini',
icon: 'times'
});
}
});
});
$('#html').click(function() {
fuialert.fire({
title: '<u>Hello, world !</u>',
html: `<a href="https://fomantic-ui.com/">Fomantic UI</a> is the <b>best framework</b>, <i>isn't it ?</i>`
});
});
$('#input').click(function() {
fuialert.fire({
size: 'mini',
title: 'Please enter something:',
input: 'text'
}).then((result) => {
fuialert.fire({
title: 'Input value result',
html: `You have entered: <code>${result.value}</code>`,
size: 'mini'
});
});
});
});
</script>
</body>
</html>