alert.html 1.88 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/EventEmitter.min.js"></script>
21
<script src="../js/qfq.debug.js"></script>
Rafael Ostertag's avatar
Rafael Ostertag committed
22
23
24
25

<script>
    $(function () {
        $('#showalert1').click(function () {
26
            var alert = new QfqNS.Alert("This is alert 1", 'error', [{label: "OK", eventName: "ok", focus: true},
27
28
                {label: "Cancel", eventName: "cancel"}]);
            alert.on('alert.ok', function () {
Rafael Ostertag's avatar
Rafael Ostertag committed
29
30
                console.log("OK button alert 1");
            });
31
            alert.on('alert.cancel', function () {
Rafael Ostertag's avatar
Rafael Ostertag committed
32
33
                console.log("Cancel button alert 1");
            });
Rafael Ostertag's avatar
Rafael Ostertag committed
34
35
36
37
            alert.show();
        });

        $('#showalert2').click(function () {
Rafael Ostertag's avatar
Rafael Ostertag committed
38
            var alert = new QfqNS.Alert("This is alert 2", 'warning');
Rafael Ostertag's avatar
Rafael Ostertag committed
39
40
41
42
43
44
45
46
            alert.show();
        });

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

        $('#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
58
59
60
61
    });
</script>
</body>
</html>