| Total Complexity | 12 |
| Complexity/F | 2 |
| Lines of Code | 38 |
| Function Count | 6 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | jaxon.dialogs.swal = { |
||
|
|
|||
| 2 | options: { |
||
| 3 | allowEscapeKey: true, |
||
| 4 | allowOutsideClick: true |
||
| 5 | }, |
||
| 6 | success: function(content, title) { |
||
| 7 | if(title == undefined) title = 'Success'; |
||
| 8 | swal({text: content, title: title, type: 'success'}); |
||
| 9 | }, |
||
| 10 | info: function(content, title) { |
||
| 11 | if(title == undefined) title = 'Information'; |
||
| 12 | swal({text: content, title: title, type: 'info'}); |
||
| 13 | }, |
||
| 14 | warning: function(content, title) { |
||
| 15 | if(title == undefined) title = 'Warning'; |
||
| 16 | swal({text: content, title: title, type: 'warning'}); |
||
| 17 | }, |
||
| 18 | error: function(content, title) { |
||
| 19 | if(title == undefined) title = 'Error'; |
||
| 20 | swal({text: content, title: title, type: 'error'}); |
||
| 21 | }, |
||
| 22 | confirm: function(question, title, yesCallback, noCallback) { |
||
| 23 | swal({ |
||
| 24 | type: "warning", |
||
| 25 | title: title, |
||
| 26 | confirmButtonText: "<?php echo $this->yes ?>", |
||
| 27 | cancelButtonText: "<?php echo $this->no ?>", |
||
| 28 | showCancelButton: true, |
||
| 29 | text: question |
||
| 30 | }, |
||
| 31 | function(res){ |
||
| 32 | if(res) |
||
| 33 | yesCallback(); |
||
| 34 | else if(noCallback != undefined) |
||
| 35 | noCallback(); |
||
| 36 | }); |
||
| 37 | } |
||
| 38 | }; |
||
| 39 |
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.