1
|
|
|
jaxon.dialogs.jconfirm = { |
|
|
|
|
2
|
|
|
dialog: null, |
3
|
|
|
show: function(args) { |
4
|
|
|
// Add buttons |
5
|
|
|
for(key in args.data.buttons) |
|
|
|
|
6
|
|
|
{ |
7
|
|
|
button = args.data.buttons[key]; |
|
|
|
|
8
|
|
|
if(button.action === 'close') |
9
|
|
|
{ |
10
|
|
|
button.action = function(){jaxon.dialogs.jconfirm.dialog.close();}; |
|
|
|
|
11
|
|
|
} |
12
|
|
|
else |
13
|
|
|
{ |
14
|
|
|
button.action = new Function(button.action); |
|
|
|
|
15
|
|
|
} |
16
|
|
|
} |
17
|
|
|
args.data.closeIcon = true; |
18
|
|
|
if((jaxon.dialogs.jconfirm.dialog)) |
|
|
|
|
19
|
|
|
{ |
20
|
|
|
jaxon.dialogs.jconfirm.dialog.close(); |
21
|
|
|
} |
22
|
|
|
jaxon.dialogs.jconfirm.dialog = $.confirm(args.data); |
23
|
|
|
}, |
24
|
|
|
hide: function(args) { |
|
|
|
|
25
|
|
|
if((jaxon.dialogs.jconfirm.dialog)) |
|
|
|
|
26
|
|
|
{ |
27
|
|
|
jaxon.dialogs.jconfirm.dialog.close(); |
28
|
|
|
} |
29
|
|
|
jaxon.dialogs.jconfirm.dialog = null; |
30
|
|
|
}, |
31
|
|
|
success: function(content, title) { |
32
|
|
|
$.alert({content: content, title: title, type: 'green', icon: 'fa fa-success'}); |
33
|
|
|
}, |
34
|
|
|
info: function(content, title) { |
35
|
|
|
$.alert({content: content, title: title, type: 'blue', icon: 'fa fa-info'}); |
36
|
|
|
}, |
37
|
|
|
warning: function(content, title) { |
38
|
|
|
$.alert({content: content, title: title, type: 'orange', icon: 'fa fa-warning'}); |
39
|
|
|
}, |
40
|
|
|
error: function(content, title) { |
41
|
|
|
$.alert({content: content, title: title, type: 'red', icon: 'fa fa-error'}); |
42
|
|
|
}, |
43
|
|
|
confirm: function(question, title, yesCallback, noCallback) { |
44
|
|
|
if(noCallback == undefined) |
|
|
|
|
45
|
|
|
noCallback = function(){}; |
|
|
|
|
46
|
|
|
$.confirm({ |
47
|
|
|
title: title, |
48
|
|
|
content: question, |
49
|
|
|
buttons: { |
50
|
|
|
yes: { |
51
|
|
|
btnClass: "btn-blue", |
52
|
|
|
text: "<?php echo $this->yes ?>", |
53
|
|
|
action: yesCallback |
54
|
|
|
}, |
55
|
|
|
no: { |
56
|
|
|
text: "<?php echo $this->no ?>", |
57
|
|
|
action: noCallback |
58
|
|
|
} |
59
|
|
|
} |
60
|
|
|
}); |
61
|
|
|
} |
62
|
|
|
}; |
63
|
|
|
|
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.