aboutsummaryrefslogtreecommitdiffstats
path: root/html/js/git-deps-noty.js
blob: 2639078b814dbe8c6a9123e78b85576525032c22 (plain) (blame)
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
require('noty');

// Different noty types:
// alert, success, error, warning, information, confirmation
function noty_error(text) {
    notyfication('error', text);
}

function noty_warn(text) {
    notyfication('warning', text);
}

function noty_success(text) {
    notyfication('success', text);
}

function noty_info(text) {
    notyfication('information', text);
}

function noty_debug(text) {
    notyfication('information', text);
}

// Haha, did you see what I did here?
function notyfication(type, text) {
    var n = window.noty({
        text: text,
        type: type,
        layout: 'topRight',
        theme: 'relax',
        timeout: 30000,  // ms
        animation: {
            open: 'animated bounceInUp',   // Animate.css class names
            close: 'animated bounceOutUp', // Animate.css class names
            easing: 'swing',               // unavailable - no need
            speed: 500                     // unavailable - no need
        }
    });
}

module.exports = {
    error: noty_error,
    warn: noty_warn,
    success: noty_success,
    info: noty_info,
    debug: noty_debug
};