Passed
Push — master ( c9d535...a1a723 )
by Thierry
10:07 queued 02:14
created

templates/cutealert/alert.js   A

Complexity

Total Complexity 8
Complexity/F 1.33

Size

Lines of Code 32
Function Count 6

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 23
c 0
b 0
f 0
dl 0
loc 32
rs 10
wmc 8
mnd 2
bc 2
fnc 6
bpm 0.3333
cpm 1.3333
noi 1
1
jaxon.dialogs.cutealert = {
0 ignored issues
show
Bug introduced by
The variable jaxon seems to be never declared. If this is a global, consider adding a /** global: jaxon */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
2
    success: function(content, title = 'Success') {
3
        cuteAlert({message: content, title: title, type: 'green'});
4
    },
5
    info: function(content, title = 'Information') {
6
        cuteAlert({message: content, title: title, type: 'blue'});
7
    },
8
    warning: function(content, title = 'Warning') {
9
        cuteAlert({message: content, title: title, type: 'yellow'});
10
    },
11
    error: function(content, title = 'Error') {
12
        cuteAlert({message: content, title: title, type: 'red'});
13
    },
14
    confirm: function(question, title, yesCallback, noCallback) {
15
        cuteAlert({
16
            title: title,
17
            type: 'question',
18
            message: question,
19
            confirmText: "<?php echo $this->yes ?>",
20
            cancelText: "<?php echo $this->no ?>",
21
        }).then(e => {
22
            if(e === 'confirm')
23
            {
24
                yesCallback();
25
            }
26
            else if((noCallback))
27
            {
28
                noCallback();
29
            }
30
        });
31
    }
32
};
33