Passed
Push — v5.x ( 0160d0 )
by Thierry
09:10
created

templates/jalert/alert.js   A

Complexity

Total Complexity 7
Complexity/F 1.17

Size

Lines of Code 27
Function Count 6

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 20
c 0
b 0
f 0
dl 0
loc 27
rs 10
wmc 7
mnd 1
bc 1
fnc 6
bpm 0.1666
cpm 1.1666
noi 2
1
jaxon.dialogs.jalert = {
2
    success: (content, title = 'Success') => $.jAlert({content: content, title: title, theme: 'green'}),
3
    info: (content, title = 'Information') => $.jAlert({content: content, title: title, theme: 'blue'}),
4
    warning: (content, title = 'Warning') => $.jAlert({content: content, title: title, theme: 'yellow'}),
5
    error: (content, title = 'Error') => $.jAlert({content: content, title: title, theme: 'red'}),
6
    confirm: (question, title, yesCallback, noCallback) => $.jAlert({
7
        title: title,
8
        type: "confirm",
9
        confirmQuestion: question,
10
        confirmBtnText: "<?php echo $this->yes ?>",
11
        denyBtnText: "<?php echo $this->no ?>",
12
        onConfirm: yesCallback,
13
        onDeny: noCallback ?? (() => {}),
14
    }),
15
};
16