1 | jaxon.dialogs.jconfirm = { |
||
0 ignored issues
–
show
|
|||
2 | dialog: null, |
||
3 | show: function(args) { |
||
4 | // Add buttons |
||
5 | for(key in args.data.buttons) |
||
0 ignored issues
–
show
|
|||
6 | { |
||
7 | button = args.data.buttons[key]; |
||
0 ignored issues
–
show
|
|||
8 | if(button.action === 'close') |
||
9 | { |
||
10 | button.action = function(){jaxon.dialogs.jconfirm.dialog.close();}; |
||
0 ignored issues
–
show
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. ![]() |
|||
11 | } |
||
12 | else |
||
13 | { |
||
14 | button.action = new Function(button.action); |
||
0 ignored issues
–
show
|
|||
15 | } |
||
16 | } |
||
17 | args.data.closeIcon = true; |
||
18 | if((jaxon.dialogs.jconfirm.dialog)) |
||
0 ignored issues
–
show
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. ![]() |
|||
19 | { |
||
20 | jaxon.dialogs.jconfirm.dialog.close(); |
||
21 | } |
||
22 | jaxon.dialogs.jconfirm.dialog = $.confirm(args.data); |
||
23 | }, |
||
24 | hide: function(args) { |
||
0 ignored issues
–
show
|
|||
25 | if((jaxon.dialogs.jconfirm.dialog)) |
||
0 ignored issues
–
show
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. ![]() |
|||
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) |
||
0 ignored issues
–
show
|
|||
45 | noCallback = function(){}; |
||
0 ignored issues
–
show
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.
Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later. Consider: if (a > 0)
b = 42;
If you or someone else later decides to put another statement in, only the first statement will be executed. if (a > 0)
console.log("a > 0");
b = 42;
In this case the statement if (a > 0) {
console.log("a > 0");
b = 42;
}
ensures that the proper code will be executed conditionally no matter how many statements are added or removed. ![]() |
|||
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.