Total Complexity | 8 |
Complexity/F | 1.14 |
Lines of Code | 40 |
Function Count | 7 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | jaxon.dialogs.pnotify = { |
||
|
|||
2 | alert: function(data) { |
||
3 | notice = new PNotify(data); |
||
4 | notice.get().click(function(){notice.remove();}); |
||
5 | }, |
||
6 | success: function(content, title) { |
||
7 | jaxon.dialogs.pnotify.alert({text: content, title: title, type: 'success'}); |
||
8 | }, |
||
9 | info: function(content, title) { |
||
10 | jaxon.dialogs.pnotify.alert({text: content, title: title, type: 'info'}); |
||
11 | }, |
||
12 | warning: function(content, title) { |
||
13 | jaxon.dialogs.pnotify.alert({text: content, title: title, type: 'notice'}); |
||
14 | }, |
||
15 | error: function(content, title) { |
||
16 | jaxon.dialogs.pnotify.alert({text: content, title: title, type: 'error'}); |
||
17 | }, |
||
18 | confirm: function(question, title, yesCallback, noCallback) { |
||
19 | PNotify.prototype.options.confirm.buttons[0].text = "<?php echo $this->yes ?>"; |
||
20 | PNotify.prototype.options.confirm.buttons[1].text = "<?php echo $this->no ?>"; |
||
21 | notice = new PNotify({ |
||
22 | title: title, |
||
23 | text: question, |
||
24 | hide: false, |
||
25 | confirm:{ |
||
26 | confirm: true |
||
27 | }, |
||
28 | buttons:{ |
||
29 | closer: false, |
||
30 | sticker: false, |
||
31 | labels: { |
||
32 | |||
33 | } |
||
34 | } |
||
35 | }); |
||
36 | notice.get().on("pnotify.confirm", yesCallback); |
||
37 | if(noCallback != undefined) |
||
38 | notice.get().on("pnotify.cancel", noCallback); |
||
39 | } |
||
40 | }; |
||
41 |
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.