Skip to content

Commit 0ac4f91

Browse files
committed
add bootstrap to bower and npm
1 parent 44fd185 commit 0ac4f91

File tree

4 files changed

+60
-43
lines changed

4 files changed

+60
-43
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
bower_components
22
dev
3+
node_modules

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
angular-pnotify
22
====================
33

4-
This is a simple wrapper for [PNotify](http://sciactive.com/pnotify/) as a [AngularJS](http://angularjs.org/) service.
4+
This is a simple wrapper for [PNotify](http://sciactive.com/pnotify/) as a [AngularJS](http://angularjs.org/) service.
55
This service provides several helper methods to display notifications on web applications.
66

7-
A PNotify 2.0 port heavily based on [angular-pines-notify](https://github.com/mykabam/angular-pines-notify) project.
7+
A PNotify 2.0 port heavily based on [angular-pines-notify](https://github.com/mykabam/angular-pines-notify) project.
88

99
### Dependencies
1010

@@ -46,7 +46,7 @@ Here is an example using Bootstrap 3.
4646

4747
<script src="bower_components/jquery/dist/jquery.min.js"></script>
4848
<script src="bower_components/angular/angular.js"></script>
49-
<script src="bower_components/pnotify/pnotify.core.js"></script>
49+
<script src="bower_components/pnotify/dist/pnotify.core.js"></script>
5050
<script src="bower_components/pnotify/pnotify.confirm.js"></script>
5151
<script src="bower_components/pnotify/pnotify.buttons.js"></script>
5252
<script src="bower_components/angular-pnotify/src/angular-pnotify.js"></script>
@@ -58,7 +58,7 @@ Add the angular-pnotify module as a dependency to your application module:
5858
angular.module('MyApp', ['jlareau.pnotify']);
5959
```
6060

61-
In order to use the API you need to inject the `notificationService` service into your controllers.
61+
In order to use the API you need to inject the `notificationService` service into your controllers.
6262

6363
```javascript
6464
angular.module('MyApp')
@@ -104,7 +104,7 @@ Display a generic PNotify notification with the options you pass to it. It ignor
104104

105105
#### notifyWithDefaults
106106

107-
Same as `notify` but will merge the options with defaults. Useful when you only want to override or add one options, without
107+
Same as `notify` but will merge the options with defaults. Useful when you only want to override or add one options, without
108108
clearing all defaults.
109109

110110
`notificationService.notifyWithDefaults(options, [stack name]);`
@@ -135,14 +135,14 @@ angular.module('MyApp')
135135
.config(['notificationServiceProvider', function(notificationServiceProvider) {
136136

137137
notificationServiceProvider
138-
138+
139139
.setDefaults({
140140
history: false,
141141
delay: 4000,
142142
closer: false,
143143
closer_hover: false
144144
})
145-
145+
146146
// Configure a stack named 'bottom_right' that append a call 'stack-bottomright'
147147
.setStack('bottom_right', 'stack-bottomright', {
148148
dir1: 'up',
@@ -157,7 +157,7 @@ angular.module('MyApp')
157157
dir2: 'right',
158158
push: 'top'
159159
})
160-
160+
161161
;
162162

163163
}])
@@ -167,7 +167,7 @@ angular.module('MyApp')
167167

168168
### PNotify Stacks
169169

170-
You can set the position and direction of notifications by using PNotify stacks. You can add stack information to the following methods:
170+
You can set the position and direction of notifications by using PNotify stacks. You can add stack information to the following methods:
171171

172172
* info
173173
* notice
@@ -185,7 +185,7 @@ angular.module('MyApp')
185185
dir1: 'down',
186186
dir2: 'right',
187187
push: 'top'
188-
});
188+
});
189189

190190
}])
191191
;

demo/index.html renamed to index.html

Lines changed: 46 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@
44

55
<meta charset="utf-8">
66

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-
<link rel="stylesheet" href="/bower_components/pnotify/pnotify.buttons.css">
10-
11-
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
12-
<script src="/bower_components/angular/angular.js"></script>
13-
<script src="/bower_components/pnotify/pnotify.core.js"></script>
14-
<script src="/bower_components/pnotify/pnotify.confirm.js"></script>
15-
<script src="/bower_components/pnotify/pnotify.buttons.js"></script>
16-
<script src="/src/angular-pnotify.js"></script>
17-
7+
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
8+
<link rel="stylesheet" href="node_modules/pnotify/dist/pnotify.css">
9+
<link rel="stylesheet" href="node_modules/pnotify/dist/pnotify.buttons.css">
10+
11+
<script src="node_modules/jquery/dist/jquery.min.js"></script>
12+
<script src="node_modules/angular/angular.js"></script>
13+
<script src="node_modules/pnotify/dist/pnotify.js"></script>
14+
<script src="node_modules/pnotify/dist/pnotify.confirm.js"></script>
15+
<script src="node_modules/pnotify/dist/pnotify.buttons.js"></script>
16+
<script src="src/angular-pnotify.js"></script>
17+
1818
</head>
1919

2020
<body ng-app="pnotify-demo">
2121

2222
<div ng-controller="MyCtrl">
23-
23+
2424
<div class="container-fluid">
25-
25+
2626
<div class="page-header">
2727
<h1>angular-pnotify demo</h1>
2828
</div>
29-
29+
3030
<p>View source for more details.</p>
3131
<hr>
3232

@@ -45,24 +45,24 @@ <h1>angular-pnotify demo</h1>
4545
<p><button ng-click="error()" class="btn btn-danger">Error</button></p>
4646
<p><pre>notificationService.error('Error text')</pre></p>
4747
<hr>
48-
48+
4949
<p>Use the generic PNotify object.</p>
5050
<p><button ng-click="generic()" class="btn btn-primary">Generic PNotify</button></p>
5151
<p>
5252
<pre>
5353
notificationService.notify({
54-
title: 'The notice title.',
54+
title: 'The notice title.',
5555
title_escape: false,
5656
text: 'The notice text.',
5757
text_escape: false,
5858
styling: "bootstrap3",
59-
type: "notice",
59+
type: "notice",
6060
icon: true
6161
});
6262
</pre>
6363
</p>
6464
<hr>
65-
65+
6666
<p><button ng-click="confirmDialog()" class="btn btn-primary">Confirm dialog</button></p>
6767
<p>
6868
<pre>
@@ -89,7 +89,7 @@ <h1>angular-pnotify demo</h1>
8989
</p>
9090
<hr>
9191

92-
<p><button ng-click="overrideDefaults()" class="btn btn-primary">Override defaults</button></p>
92+
<p><button ng-click="overrideDefaults()" class="btn btn-primary">Override defaults</button></p>
9393
<p>
9494
<pre>
9595
notificationService.notifyWithDefaults({
@@ -99,8 +99,8 @@ <h1>angular-pnotify demo</h1>
9999
</pre>
100100
</p>
101101
<hr>
102-
103-
<p><button ng-click="stackTopLeft()" class="btn btn-primary">Stack top left</button></p>
102+
103+
<p><button ng-click="stackTopLeft()" class="btn btn-primary">Stack top left</button></p>
104104
<p>
105105
In config:
106106
<pre>
@@ -109,16 +109,16 @@ <h1>angular-pnotify demo</h1>
109109
dir1: 'down',
110110
dir2: 'right',
111111
push: 'top'
112-
});
112+
});
113113
</pre>
114114
In controller:
115115
<pre>
116116
notificationService.info('Hello World : Top left', 'top_left');
117117
</pre>
118118
</p>
119119
<hr>
120-
121-
<p><button ng-click="stackBottomRight()" class="btn btn-primary">Stack bottom right</button></p>
120+
121+
<p><button ng-click="stackBottomRight()" class="btn btn-primary">Stack bottom right</button></p>
122122
<p>
123123
In config:
124124
<pre>
@@ -135,19 +135,30 @@ <h1>angular-pnotify demo</h1>
135135
notificationService.info('Hello World : Bottom right', 'bottom_right');
136136
</pre>
137137
</p>
138+
<hr>
139+
140+
<p><button ng-click="removeNotifications()" class="btn btn-primary">Remove all notifications</button></p>
141+
<p>
142+
In controller:
143+
<pre>
144+
notificationService.removeNotifications();
145+
</pre>
146+
</p>
138147

139148
</div>
149+
140150
</div>
141-
151+
142152
<script>
143153

144154
angular.module('pnotify-demo', ['jlareau.pnotify'])
145-
155+
146156
.config(['notificationServiceProvider', function(notificationServiceProvider) {
147157

148158
notificationServiceProvider
149-
159+
150160
.setDefaults({
161+
styling: 'bootstrap3',
151162
delay: 4000,
152163
buttons: {
153164
closer: false,
@@ -172,7 +183,7 @@ <h1>angular-pnotify demo</h1>
172183
dir2: 'right',
173184
push: 'top'
174185
})
175-
186+
176187
;
177188

178189
}])
@@ -199,12 +210,12 @@ <h1>angular-pnotify demo</h1>
199210

200211
// This is a sample using the generic PNotify object
201212
notificationService.notify({
202-
title: 'The notice title.',
213+
title: 'The notice title.',
203214
title_escape: false,
204215
text: 'The notice text.',
205216
text_escape: false,
206217
styling: 'bootstrap3',
207-
type: 'notice',
218+
type: 'notice',
208219
icon: true
209220
});
210221

@@ -231,7 +242,7 @@ <h1>angular-pnotify demo</h1>
231242
alert('Ok, cool.');
232243
}).on('pnotify.cancel', function() {
233244
alert('Oh ok. Chicken, I see.');
234-
});
245+
});
235246

236247
};
237248

@@ -250,6 +261,10 @@ <h1>angular-pnotify demo</h1>
250261
notificationService.info('Hello World : Bottom right', 'bottom_right');
251262
};
252263

264+
$scope.removeNotifications = function(){
265+
notificationService.removeNotifications();
266+
}
267+
253268
}]);
254269

255270
</script>

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
],
2525
"dependencies": {
2626
"angular": "~1.5.5",
27-
"pnotify": "~3.0.0",
28-
"jquery": ">=1.9"
27+
"bootstrap": "^3.3.6",
28+
"jquery": ">=1.9",
29+
"pnotify": "~3.0.0"
2930
}
3031
}

0 commit comments

Comments
 (0)