alert.html 1.99 KB
Newer Older
Rafael Ostertag's avatar
Rafael Ostertag committed
1
2
3
4
5
6
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/bootstrap-theme.min.css">
7
    <link rel="stylesheet" href="../css/qfq-bs.css">
Rafael Ostertag's avatar
Rafael Ostertag committed
8
9
10
11
12
13
14
    <title>Alert</title>
</head>
<body>

<button id="showalert1">Show Alert 1</button>
<button id="showalert2">Show Alert 2</button>
<button id="showalert3">Show Alert 3 primed</button>
15
<button id="showmanyalert1">Show Many Alert 1</button>
Rafael Ostertag's avatar
Rafael Ostertag committed
16
17
18
19


<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
20
<script src="../js/qfq.debug.js"></script>
Rafael Ostertag's avatar
Rafael Ostertag committed
21
22
23
24

<script>
    $(function () {
        $('#showalert1').click(function () {
Rafael Ostertag's avatar
Rafael Ostertag committed
25
26
27
28
29
30
31
            var alert = new QfqNS.Alert("This is alert 1", 'error', 'okcancel');
            alert.addOkButtonHandler(function () {
                console.log("OK button alert 1");
            });
            alert.addCancelButtonHandler(function () {
                console.log("Cancel button alert 1");
            });
Rafael Ostertag's avatar
Rafael Ostertag committed
32
33
34
35
            alert.show();
        });

        $('#showalert2').click(function () {
Rafael Ostertag's avatar
Rafael Ostertag committed
36
37
38
39
40
41
42
            var alert = new QfqNS.Alert("This is alert 2", 'warning');
            alert.addOkButtonHandler(function () {
                console.log("OK button alert 2");
            });
            alert.addCancelButtonHandler(function () {
                console.log("Cancel button alert 2");
            });
Rafael Ostertag's avatar
Rafael Ostertag committed
43
44
45
46
47
48
49
50
            alert.show();
        });

        $('#showalert3').click(function () {
            var alert = new QfqNS.Alert("This is alert 3. Disappears after 3 secs.");
            alert.timeout = 3000;
            alert.show();
        });
51
52
53
54
55
56
57
58
59
60
61

        $('#showmanyalert1').click(function () {
            var alert = new QfqNS.Alert("This is alert 1", "info");
            alert.show();

            alert = new QfqNS.Alert("This is alert 2", "warning");
            alert.show();

            alert = new QfqNS.Alert("This is alert 3", "error");
            alert.show();
        });
Rafael Ostertag's avatar
Rafael Ostertag committed
62
63
64
65
    });
</script>
</body>
</html>