4
4
5
5
< meta charset ="utf-8 ">
6
6
7
- < link rel ="stylesheet " href ="//netdna.bootstrapcdn.com/ bootstrap/3.1.1 /css/bootstrap.min.css ">
8
- < link rel ="stylesheet " href ="//cdn.jsdelivr.net/ pnotify/2.0.0/ pnotify.all.min .css ">
7
+ < link rel ="stylesheet " href ="/bower_components/ bootstrap/dist /css/bootstrap.min.css ">
8
+ < link rel ="stylesheet " href ="/bower_components/ pnotify/pnotify.core .css ">
9
9
10
- < script src ="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js "> </ script >
11
- < script src ="//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js "> </ script >
12
- < script src ="//cdn.jsdelivr.net/pnotify/2.0.0/pnotify.all.min.js "> </ script >
13
- < script src ="https://cdn.rawgit.com/jacqueslareau/angular-pnotify/0.0.2/src/angular-pnotify.js "> </ script >
10
+ < script src ="/bower_components/jquery/dist/jquery.min.js "> </ script >
11
+ < script src ="/bower_components/angular/angular.min.js "> </ script >
12
+ < script src ="/bower_components/pnotify/pnotify.core.js "> </ script >
13
+ < script src ="/bower_components/pnotify/pnotify.confirm.js "> </ script >
14
+ < script src ="/src/angular-pnotify.js "> </ script >
14
15
15
16
</ head >
16
17
@@ -27,40 +28,65 @@ <h1>angular-pnotify demo</h1>
27
28
< p > View source for more details.</ p >
28
29
< hr >
29
30
30
- < p > < code > notificationService.success('Successing text')</ code > </ p >
31
+ < p > < pre > notificationService.success('Successing text')</ pre > </ p >
31
32
< p > < button ng-click ="success() " class ="btn btn-success "> Success</ button > </ p >
32
33
< hr >
33
34
34
- < p > < code > notificationService.info('Infomative text')</ code > </ p >
35
+ < p > < pre > notificationService.info('Infomative text')</ pre > </ p >
35
36
< p > < button ng-click ="info() " class ="btn btn-info "> Info</ button > </ p >
36
37
< hr >
37
38
38
- < p > < code > notificationService.notice('Notice text')</ code > </ p >
39
+ < p > < pre > notificationService.notice('Notice text')</ pre > </ p >
39
40
< p > < button ng-click ="notice() " class ="btn btn-warning "> Notice</ button > </ p >
40
41
< hr >
41
42
42
- < p > < code > notificationService.error('Error text')</ code > </ p >
43
+ < p > < pre > notificationService.error('Error text')</ pre > </ p >
43
44
< p > < button ng-click ="error() " class ="btn btn-danger "> Error</ button > </ p >
44
45
< hr >
45
46
46
47
< p > Use the generic PNotify object.</ p >
47
48
< p >
48
- < code >
49
- notificationService.notify({
50
- title: 'The notice title.',
51
- title_escape: false,
52
- text: 'The notice text.',
53
- text_escape: false,
54
- styling: "bootstrap3",
55
- type: "notice",
56
- icon: true
57
- });
58
- </ code >
49
+ < pre >
50
+ notificationService.notify({
51
+ title: 'The notice title.',
52
+ title_escape: false,
53
+ text: 'The notice text.',
54
+ text_escape: false,
55
+ styling: "bootstrap3",
56
+ type: "notice",
57
+ icon: true
58
+ });
59
+ </ pre >
59
60
</ p >
60
61
< p > < button ng-click ="generic() " class ="btn btn-primary "> Generic PNotify</ button > </ p >
61
-
62
- </ div >
63
-
62
+ < hr >
63
+
64
+ < p >
65
+ < pre >
66
+ notificationService.notify({
67
+ title: 'Confirmation Needed',
68
+ text: 'Are you sure?',
69
+ hide: false,
70
+ confirm: {
71
+ confirm: true
72
+ },
73
+ buttons: {
74
+ closer: false,
75
+ sticker: false
76
+ },
77
+ history: {
78
+ history: false
79
+ }
80
+ }).get().on('pnotify.confirm', function() {
81
+ alert('Ok, cool.');
82
+ }).on('pnotify.cancel', function() {
83
+ alert('Oh ok. Chicken, I see.');
84
+ });
85
+ </ pre >
86
+
87
+ </ p >
88
+ < p > < button ng-click ="confirmDialog() " class ="btn btn-primary "> Confirm dialog</ button > </ p >
89
+
64
90
</ div >
65
91
66
92
< script >
@@ -102,6 +128,30 @@ <h1>angular-pnotify demo</h1>
102
128
103
129
} ;
104
130
131
+ $scope . confirmDialog = function ( ) {
132
+
133
+ notificationService . notify ( {
134
+ title : 'Confirmation Needed' ,
135
+ text : 'Are you sure?' ,
136
+ hide : false ,
137
+ confirm : {
138
+ confirm : true
139
+ } ,
140
+ buttons : {
141
+ closer : false ,
142
+ sticker : false
143
+ } ,
144
+ history : {
145
+ history : false
146
+ }
147
+ } ) . get ( ) . on ( 'pnotify.confirm' , function ( ) {
148
+ alert ( 'Ok, cool.' ) ;
149
+ } ) . on ( 'pnotify.cancel' , function ( ) {
150
+ alert ( 'Oh ok. Chicken, I see.' ) ;
151
+ } ) ;
152
+
153
+ } ;
154
+
105
155
} ] ) ;
106
156
107
157
</ script >
0 commit comments