Skip to content

Commit b957ae9

Browse files
committed
Merge pull request #328 from CodeSeven/develop
Bracing for 2.1.2 release
2 parents 5e74839 + 9b7d1f1 commit b957ae9

14 files changed

+248
-85
lines changed

.jshintrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656

5757
"globals": {
5858
"angular": false,
59-
"$": false
59+
"$": false,
60+
"module": false,
61+
"require": false
6062
}
61-
}
63+
}

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# 2.1.2 (2015-08-06)
2+
3+
## New Features
4+
- Added HTML escaping (use toastr.options.escapeHTML)
5+
- Added more options for overriding animations, specifically to closing a toast
6+
- Events are now passed into the onClick handler of the toast
7+
8+
## Bug Fixes
9+
- Resolved issue with centered toasts that would override top and bottom margins
10+
11+
## Dev Ops
12+
- Removed `module` and `require` from the `.jshintrc` file
13+
- Cleaned up the readme
14+
- Builds moved to the `builds` folder
15+
- Made href calls relative to the transport in the demo
16+
- CSS is now built by the included LESS file as part of a `gulp` call
17+
- Removed un-used deps
18+
119
# 2.1.1 (2015-02-19)
220

321
## New Features

README.md

Lines changed: 90 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
[![Build Status](https://travis-ci.org/CodeSeven/toastr.svg)](https://travis-ci.org/CodeSeven/toastr)
55

66
## Current Version
7-
2.1.1
7+
2.1.2
88

99
## Demo
1010
- Demo can be found at http://codeseven.github.io/toastr/demo.html
1111
- [Demo using FontAwesome icons with toastr](http://plnkr.co/edit/6W9URNyyp2ItO4aUWzBB?p=preview)
1212

13-
## CDNjs
13+
## [CDNjs](https://cdnjs.com/libraries/toastr.js)
1414
Toastr is hosted at CDN JS
1515

1616
#### Debug
@@ -20,13 +20,23 @@ Toastr is hosted at CDN JS
2020
#### Minified
2121
- [//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js](//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js)
2222
- [//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css](//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css)
23+
24+
## Install
2325

24-
## NuGet Gallery
25-
http://nuget.org/packages/toastr
26+
#### [NuGet Gallery](http://nuget.org/packages/toastr)
27+
```
28+
Install-Package toastr
29+
```
2630

27-
## [Bower](http://bower.io/)
28-
bower install toastr
31+
#### [Bower](http://bower.io/search/?q=toastr)
32+
```
33+
bower install toastr
34+
```
2935

36+
#### [npm](https://www.npmjs.com/package/toastr)
37+
```
38+
npm install --save toastr
39+
```
3040

3141
## Wiki and Change Log
3242
[Wiki including Change Log](https://github.com/CodeSeven/toastr/wiki)
@@ -43,95 +53,124 @@ The following animations options have been deprecated and should be replaced:
4353

4454
## Quick Start
4555

46-
###3 Easy Steps
56+
### 3 Easy Steps
4757
For other API calls, see the [demo](http://codeseven.github.io/toastr/demo.html).
4858

4959
1. Link to toastr.css `<link href="toastr.css" rel="stylesheet"/>`
5060

5161
2. Link to toastr.js `<script src="toastr.js"></script>`
5262

5363
3. use toastr to display a toast for info, success, warning or error
54-
55-
// Display an info toast with no title
56-
toastr.info('Are you the 6 fingered man?')
64+
```js
65+
// Display an info toast with no title
66+
toastr.info('Are you the 6 fingered man?')
67+
```
5768

5869
### Other Options
59-
// Display a warning toast, with no title
60-
toastr.warning('My name is Inigo Montoya. You killed my father, prepare to die!')
61-
62-
// Display a success toast, with a title
63-
toastr.success('Have fun storming the castle!', 'Miracle Max Says')
64-
65-
// Display an error toast, with a title
66-
toastr.error('I do not think that word means what you think it means.', 'Inconceivable!')
67-
68-
// Immediately remove current toasts without using animation
69-
toastr.remove()
70-
71-
// Remove current toasts using animation
72-
toastr.clear()
70+
```js
71+
// Display a warning toast, with no title
72+
toastr.warning('My name is Inigo Montoya. You killed my father, prepare to die!')
73+
74+
// Display a success toast, with a title
75+
toastr.success('Have fun storming the castle!', 'Miracle Max Says')
76+
77+
// Display an error toast, with a title
78+
toastr.error('I do not think that word means what you think it means.', 'Inconceivable!')
79+
80+
// Immediately remove current toasts without using animation
81+
toastr.remove()
7382

74-
// Override global options
75-
toastr.success('We do have the Kapua suite available.', 'Turtle Bay Resort', {timeOut: 5000})
83+
// Remove current toasts using animation
84+
toastr.clear()
85+
86+
// Override global options
87+
toastr.success('We do have the Kapua suite available.', 'Turtle Bay Resort', {timeOut: 5000})
88+
```
89+
90+
### Escape HTML characters
91+
In case you want to escape HTML charaters in title and message
92+
93+
toastr.options.escapeHtml = true;
7694

7795
### Close Button
7896
Optionally enable a close button
79-
80-
toastr.options.closeButton = true;
97+
```js
98+
toastr.options.closeButton = true;
99+
````
81100

82101
Optionally override the close button's HTML.
83102
84-
toastr.options.closeHtml = '<button><i class="icon-off"></i></button>';
103+
```js
104+
toastr.options.closeHtml = '<button><i class="icon-off"></i></button>';
105+
```
85106
86107
You can also override the CSS/LESS for `#toast-container .toast-close-button`
87108
109+
Optionally override the hide animation when the close button is clicked (falls back to hide configuration).
110+
```js
111+
toastr.options.closeMethod = 'fadeOut';
112+
toastr.options.closeDuration = 300;
113+
toastr.options.closeEasing = 'swing';
114+
```
115+
88116
### Display Sequence
89117
Show newest toast at bottom (top is default)
90-
91-
toastr.options.newestOnTop = false;
118+
```js
119+
toastr.options.newestOnTop = false;
120+
```
92121
93122
### Callbacks
94-
// Define a callback for when the toast is shown/hidden
95-
toastr.options.onShown = function() { console.log('hello'); }
96-
toastr.options.onHidden = function() { console.log('goodbye'); }
123+
```js
124+
// Define a callback for when the toast is shown/hidden
125+
toastr.options.onShown = function() { console.log('hello'); }
126+
toastr.options.onHidden = function() { console.log('goodbye'); }
127+
```
97128
98129
### Animation Options
99130
Toastr will supply default animations, so you do not have to provide any of these settings. However you have the option to override the animations if you like.
100131
101132
####Easings
102133
Optionally override the animation easing to show or hide the toasts. Default is swing. swing and linear are built into jQuery.
103-
104-
toastr.options.showEasing = 'swing';
105-
toastr.options.hideEasing = 'linear';
134+
```js
135+
toastr.options.showEasing = 'swing';
136+
toastr.options.hideEasing = 'linear';
137+
toastr.options.closeEasing = 'linear';
138+
```
106139
107140
Using the jQuery Easing plugin (http://www.gsgd.co.uk/sandbox/jquery/easing/)
108-
109-
toastr.options.showEasing = 'easeOutBounce';
110-
toastr.options.hideEasing = 'easeInBack';
141+
```js
142+
toastr.options.showEasing = 'easeOutBounce';
143+
toastr.options.hideEasing = 'easeInBack';
144+
toastr.options.closeEasing = 'easeInBack';
145+
```
111146
112147
####Animation Method
113148
Use the jQuery show/hide method of your choice. These default to fadeIn/fadeOut. The methods fadeIn/fadeOut, slideDown/slideUp, and show/hide are built into jQuery.
114-
115-
toastr.options.showMethod = 'slideDown';
116-
toastr.options.hideMethod = 'slideUp';
149+
```js
150+
toastr.options.showMethod = 'slideDown';
151+
toastr.options.hideMethod = 'slideUp';
152+
toastr.options.closeMethod = 'slideUp';
153+
```
117154
118155
###Prevent Duplicates
119156
Rather than having identical toasts stack, set the preventDuplicates property to true. Duplicates are matched to the previous toast based on their message content.
120-
121-
toastr.options.preventDuplicates = true;
122-
157+
```js
158+
toastr.options.preventDuplicates = true;
159+
```
123160
124161
###Timeouts
125162
Control how toastr interacts with users by setting timeouts appropriately. Timeouts can be disabled by setting them to 0.
126-
127-
toastr.options.timeOut = 30; // How long the toast will display without user interaction
128-
toastr.options.extendedTimeOut = 60; // How long the toast will display after a user hovers over it
163+
```js
164+
toastr.options.timeOut = 30; // How long the toast will display without user interaction
165+
toastr.options.extendedTimeOut = 60; // How long the toast will display after a user hovers over it
166+
```
129167
130168
131169
###Progress Bar
132170
Visually indicate how long before a toast expires.
133-
134-
toastr.options.progressBar = true;
171+
```js
172+
toastr.options.progressBar = true;
173+
```
135174
136175
## Building Toastr
137176
@@ -179,4 +218,3 @@ Copyright © 2012-2015
179218
180219
## License
181220
toastr is under MIT license - http://www.opensource.org/licenses/mit-license.php
182-

toastr.css renamed to build/toastr.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ button.toast-close-button {
8585
#toast-container {
8686
position: fixed;
8787
z-index: 999999;
88+
pointer-events: none;
8889
/*overrides*/
89-
9090
}
9191
#toast-container * {
9292
-moz-box-sizing: border-box;
@@ -95,6 +95,7 @@ button.toast-close-button {
9595
}
9696
#toast-container > div {
9797
position: relative;
98+
pointer-events: auto;
9899
overflow: hidden;
99100
margin: 0 0 6px;
100101
padding: 15px 15px 15px 50px;
@@ -136,12 +137,14 @@ button.toast-close-button {
136137
#toast-container.toast-top-center > div,
137138
#toast-container.toast-bottom-center > div {
138139
width: 300px;
139-
margin: auto;
140+
margin-left: auto;
141+
margin-right: auto;
140142
}
141143
#toast-container.toast-top-full-width > div,
142144
#toast-container.toast-bottom-full-width > div {
143145
width: 96%;
144-
margin: auto;
146+
margin-left: auto;
147+
margin-right: auto;
145148
}
146149
.toast {
147150
background-color: #030303;

build/toastr.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)