├── toastr-icon.png ├── nuget ├── toastr.1.0.0.nupkg ├── toastr.1.0.1.nupkg ├── toastr.1.0.1.nuspec ├── toastr.1.0.2.nupkg ├── toastr.1.0.2.nuspec ├── toastr.1.0.3.nupkg ├── toastr.1.1.0.nupkg ├── toastr.1.1.1.nupkg ├── toastr.1.1.2.nupkg ├── toastr.1.1.3.nupkg ├── toastr.1.1.4.nupkg ├── toastr.1.1.5.nupkg ├── toastr.1.2.0.nupkg ├── toastr.1.2.1.nupkg ├── toastr.1.2.2.nupkg ├── toastr.1.3.0.nupkg ├── toastr.1.3.1.nupkg ├── toastr.2.0.1.nupkg ├── toastr.2.0.2.nupkg ├── toastr.2.0.3.nupkg ├── toastr.1.1.4.1.nupkg ├── toastr.1.1.4.2.nupkg ├── toastr.2.0.0-rc1.nupkg ├── toastr.1.0.0.nuspec ├── toastr.1.1.0.nuspec ├── toastr.1.1.1.nuspec ├── toastr.1.1.2.nuspec ├── toastr.1.1.5.nuspec ├── toastr.1.0.3.nuspec ├── toastr.1.2.0.nuspec ├── toastr.1.2.1.nuspec ├── toastr.1.2.2.nuspec ├── toastr.2.0.2.nuspec ├── toastr.2.0.3.nuspec ├── toastr.1.1.4.1.nuspec ├── toastr.1.1.4.nuspec ├── toastr.1.1.4.2.nuspec ├── toastr.1.3.0.nuspec ├── toastr.2.0.1.nuspec ├── toastr.2.0.0-rc1.nuspec ├── toastr.1.3.1.nuspec └── content │ ├── scripts │ ├── toastr.min.js │ ├── toastr.min.js.map │ └── toastr.js │ └── content │ ├── toastr.min.css │ ├── toastr.less │ ├── toastr.css │ └── toastr.scss ├── tests ├── unit │ ├── x.js │ ├── qunit-helper.js │ └── toastr-tests.js ├── toastr-tests.html └── qunit │ └── qunit.css ├── .gitattributes ├── release checklist.md ├── .gitignore ├── .travis.yml ├── LICENSE ├── .jshintrc ├── package.json ├── karma.conf.js ├── .jscsrc ├── gulpfile.js ├── CHANGELOG.md ├── toastr.scss ├── toastr.less ├── README.md ├── demo.html └── toastr.js /toastr-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/toastr-icon.png -------------------------------------------------------------------------------- /nuget/toastr.1.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.0.0.nupkg -------------------------------------------------------------------------------- /nuget/toastr.1.0.1.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.0.1.nupkg -------------------------------------------------------------------------------- /nuget/toastr.1.0.1.nuspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.0.1.nuspec -------------------------------------------------------------------------------- /nuget/toastr.1.0.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.0.2.nupkg -------------------------------------------------------------------------------- /nuget/toastr.1.0.2.nuspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.0.2.nuspec -------------------------------------------------------------------------------- /nuget/toastr.1.0.3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.0.3.nupkg -------------------------------------------------------------------------------- /nuget/toastr.1.1.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.1.0.nupkg -------------------------------------------------------------------------------- /nuget/toastr.1.1.1.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.1.1.nupkg -------------------------------------------------------------------------------- /nuget/toastr.1.1.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.1.2.nupkg -------------------------------------------------------------------------------- /nuget/toastr.1.1.3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.1.3.nupkg -------------------------------------------------------------------------------- /nuget/toastr.1.1.4.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.1.4.nupkg -------------------------------------------------------------------------------- /nuget/toastr.1.1.5.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.1.5.nupkg -------------------------------------------------------------------------------- /nuget/toastr.1.2.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.2.0.nupkg -------------------------------------------------------------------------------- /nuget/toastr.1.2.1.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.2.1.nupkg -------------------------------------------------------------------------------- /nuget/toastr.1.2.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.2.2.nupkg -------------------------------------------------------------------------------- /nuget/toastr.1.3.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.3.0.nupkg -------------------------------------------------------------------------------- /nuget/toastr.1.3.1.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.3.1.nupkg -------------------------------------------------------------------------------- /nuget/toastr.2.0.1.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.2.0.1.nupkg -------------------------------------------------------------------------------- /nuget/toastr.2.0.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.2.0.2.nupkg -------------------------------------------------------------------------------- /nuget/toastr.2.0.3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.2.0.3.nupkg -------------------------------------------------------------------------------- /nuget/toastr.1.1.4.1.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.1.4.1.nupkg -------------------------------------------------------------------------------- /nuget/toastr.1.1.4.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.1.1.4.2.nupkg -------------------------------------------------------------------------------- /nuget/toastr.2.0.0-rc1.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeSeven/toastr/HEAD/nuget/toastr.2.0.0-rc1.nupkg -------------------------------------------------------------------------------- /tests/unit/x.js: -------------------------------------------------------------------------------- 1 | test('test test', 1, function () { 2 | ok(1 === 1, '1 equals 1'); 3 | }); 4 | -------------------------------------------------------------------------------- /tests/unit/qunit-helper.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Hack to expose spec count from QUnit to Karma 3 | */ 4 | 5 | var testCount = 0; 6 | var qunitTest = QUnit.test; 7 | QUnit.test = window.test = function () { 8 | testCount += 1; 9 | qunitTest.apply(this, arguments); 10 | }; 11 | QUnit.begin(function (args) { 12 | args.totalTests = testCount; 13 | }); 14 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behaviour, in case users don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Explicitly declare text files we want to always be normalized and converted 5 | # to native line endings on checkout. 6 | *.c text 7 | *.h text 8 | 9 | # Declare files that will always have CRLF line endings on checkout. 10 | *.sln text eol=crlf 11 | *.csproj text eol=crlf 12 | 13 | # Denote all files that are truly binary and should not be modified. 14 | *.png binary 15 | *.jpg binary -------------------------------------------------------------------------------- /release checklist.md: -------------------------------------------------------------------------------- 1 | Toastr Release Checklist 2 | 3 | 1. Update Toastr Version 4 | * toastr.js 5 | * bower.json (toastr-bower repo) 6 | * package.json 7 | * nuget versions and dependency versions 8 | * readme file for github repo 9 | * Consider HotTowel VSIX 10 | 2. Gulp 11 | * run main demo 12 | * `gulp analyze` 13 | * `gulp test` 14 | * `gulp` 15 | 3. Nuget 16 | * Copy new files in 17 | * Build 18 | * Test 19 | 4. CDNJS 20 | * Update CDNJS 21 | 5. Update Website with New Downloads 22 | 6. Publish Bower 23 | * Include License and Readme 24 | * Test Locally 25 | * Update Github repo toastr-bower 26 | * Github tag 27 | * Register with Bower 28 | 7. Publish Nugets 29 | 8. Release on Github 30 | * Tag with semver 31 | * Attach all artifacts 32 | 9. Blog post -------------------------------------------------------------------------------- /tests/toastr-tests.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr QUnit Tests 5 | 6 | 7 | 8 | 9 |
10 |

toastr QUnit Tests

11 |

12 |
13 |

14 |
    15 |
    test markup, will be hidden
    16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | bower_components 3 | 4 | # Ignore Visual Studio Project # 5 | ################### 6 | *.config 7 | *.user 8 | *.csproj 9 | *.gpState 10 | *.sln 11 | *.suo 12 | /bin 13 | /obj 14 | /packages 15 | /Properties 16 | /Scripts 17 | /report 18 | /tests/coverage 19 | 20 | 21 | # Compiled source # 22 | ################### 23 | *.com 24 | *.class 25 | *.dll 26 | *.exe 27 | *.o 28 | *.so 29 | 30 | # Packages # 31 | ############ 32 | # it's better to unpack these files and commit the raw source 33 | # git has its own built in compression methods 34 | *.7z 35 | *.dmg 36 | *.gz 37 | *.iso 38 | *.jar 39 | *.rar 40 | *.tar 41 | *.zip 42 | 43 | # Logs and databases # 44 | ###################### 45 | *.log 46 | *.sql 47 | *.sqlite 48 | 49 | # OS generated files # 50 | ###################### 51 | .DS_Store* 52 | ehthumbs.db 53 | Icon? 54 | Thumbs.db 55 | 56 | # WebStorm # 57 | ###################### 58 | .idea/ -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "6.12.1" 4 | 5 | install: 6 | - npm install -g gulp karma-cli 7 | - npm install 8 | 9 | script: 10 | - npm test 11 | 12 | cache: 13 | directories: 14 | - node_modules 15 | - travis_phantomjs 16 | 17 | branches: 18 | only: 19 | - develop 20 | - master 21 | 22 | before_install: 23 | # Upgrade PhantomJS to v2.1.1. 24 | - "export PHANTOMJS_VERSION=2.1.1" 25 | - "export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH" 26 | - "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi" 27 | - "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; fi" 28 | - "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi" 29 | - "phantomjs --version" 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Toastr Maintainers 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise": true, 3 | "camelcase": true, 4 | "curly": true, 5 | "eqeqeq": true, 6 | "es3": false, 7 | "forin": true, 8 | "freeze": true, 9 | "immed": true, 10 | "indent": 4, 11 | "latedef": "nofunc", 12 | "newcap": true, 13 | "noarg": true, 14 | "noempty": true, 15 | "nonbsp": true, 16 | "nonew": true, 17 | "plusplus": false, 18 | "quotmark": "single", 19 | "undef": true, 20 | "unused": false, 21 | "strict": false, 22 | "maxparams": 10, 23 | "maxdepth": 5, 24 | "maxstatements": 40, 25 | "maxcomplexity": 8, 26 | "maxlen": 120, 27 | 28 | "asi": false, 29 | "boss": false, 30 | "debug": false, 31 | "eqnull": true, 32 | "esnext": false, 33 | "evil": false, 34 | "expr": false, 35 | "funcscope": false, 36 | "globalstrict": false, 37 | "iterator": false, 38 | "lastsemic": false, 39 | "laxbreak": false, 40 | "laxcomma": false, 41 | "loopfunc": true, 42 | "maxerr": false, 43 | "moz": false, 44 | "multistr": false, 45 | "notypeof": false, 46 | "proto": false, 47 | "scripturl": false, 48 | "shadow": false, 49 | "sub": true, 50 | "supernew": false, 51 | "validthis": false, 52 | "noyield": false, 53 | 54 | "browser": true, 55 | "node": true, 56 | 57 | "globals": { 58 | "angular": false, 59 | "$": false, 60 | "module": false, 61 | "require": false 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /nuget/toastr.1.0.0.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1.0.0 5 | John Papa,Hans Fjällemark 6 | John Papa,Hans Fjällemark 7 | http://www.opensource.org/licenses/mit-license.php 8 | https://github.com/CodeSeven/toastr 9 | 10 | 11 | 12 | toastr 13 | toastr 14 | false 15 | 3 Easy Steps: 16 | 17 | 1) Link to toastr.css and toastr-responsive.css 18 | 2) Link to toastr.js 19 | 3) Use toastr to display a toast for info, success, warning or error 20 | 21 | // Display an info toast with no title 22 | toastr.info('Are you the 6 fingered man?') 23 | 24 | *** For other API calls, see the demo 25 | toastr is a Javascript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 26 | Copyright © 2012 Hans Fjällemark & John Papa. 27 | en-US 28 | toastr, toast, notification, dialog, jquery 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /nuget/toastr.1.1.0.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 1.1.0 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | https://github.com/CodeSeven/toastr 11 | false 12 | 3 Easy Steps: 13 | 14 | (1) Link to toastr.css 15 | (2) Link to toastr.js 16 | (3) Use toastr to display a toast for info, success, warning or error 17 | 18 | // Display an info toast with no title 19 | toastr.info('Are you the 6 fingered man?') 20 | 21 | *** For other API calls, see the demo 22 | toastr is a Javascript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 23 | Added AMD support (and backwards compat with non AMD), toastr.clear() method, optionsOverride API to be able to override options for each toast, added onclick callback option which fires when a user clicks the toast. Also cleaned CSS, merged CSS files into 1 file, and reduced jQuery dependency to v1.6.3 24 | Copyright © 2012 Hans Fjällemark & John Papa. 25 | en-US 26 | toastr, toast, notification, dialog, jquery 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /nuget/toastr.1.1.1.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 1.1.1 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | https://github.com/CodeSeven/toastr 11 | false 12 | 3 Easy Steps: 13 | 14 | (1) Link to toastr.css 15 | (2) Link to toastr.js 16 | (3) Use toastr to display a toast for info, success, warning or error 17 | 18 | // Display an info toast with no title 19 | toastr.info('Are you the 6 fingered man?') 20 | 21 | *** For other API calls, see the demo 22 | toastr is a Javascript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 23 | Added AMD support (and backwards compat with non AMD), toastr.clear() method, optionsOverride API to be able to override options for each toast, added onclick callback option which fires when a user clicks the toast. Also cleaned CSS, merged CSS files into 1 file, and reduced jQuery dependency to v1.6.3 24 | Copyright © 2012 Hans Fjällemark & John Papa. 25 | en-US 26 | toastr, toast, notification, dialog, jquery 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /nuget/toastr.1.1.2.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 1.1.2 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | https://github.com/CodeSeven/toastr 11 | false 12 | 3 Easy Steps: 13 | 14 | (1) Link to toastr.css 15 | (2) Link to toastr.js 16 | (3) Use toastr to display a toast for info, success, warning or error 17 | 18 | // Display an info toast with no title 19 | toastr.info('Are you the 6 fingered man?') 20 | 21 | *** For other API calls, see the demo 22 | toastr is a Javascript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 23 | Added AMD support (and backwards compat with non AMD), toastr.clear() method clears 1 or all toasts, optionsOverride API to be able to override options for each toast, added onclick callback option which fires when a user clicks the toast. Also cleaned CSS, merged CSS files into 1 file, and reduced jQuery dependency to v1.6.3 24 | Copyright © 2012 Hans Fjällemark & John Papa. 25 | en-US 26 | toastr, toast, notification, dialog, jquery 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /nuget/toastr.1.1.5.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 1.1.5 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | https://github.com/CodeSeven/toastr 11 | http://johnpapa.net/wp-content/images/toastr-icon.png 12 | false 13 | 3 Easy Steps: 14 | 15 | (1) Link to toastr.css 16 | (2) Link to toastr.js 17 | (3) Use toastr to display a toast for info, success, warning or error 18 | 19 | // Display an info toast with no title 20 | toastr.info('Are you the 6 fingered man?') 21 | 22 | *** For other API calls, see the demo 23 | toastr is a Javascript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 24 | Now using SemVer for JavaScript files. 25 | Copyright © 2012 Hans Fjällemark & John Papa. 26 | en-US 27 | toastr, toast, notification, dialog, jquery 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /nuget/toastr.1.0.3.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 1.0.2 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | https://github.com/CodeSeven/toastr 11 | false 12 | 3 Easy Steps: 13 | 14 | 1) Link to toastr.css and toastr-responsive.css 15 | 2) Link to toastr.js 16 | 3) Use toastr to display a toast for info, success, warning or error 17 | 18 | // Display an info toast with no title 19 | toastr.info('Are you the 6 fingered man?') 20 | 21 | *** For other API calls, see the demo 22 | toastr is a Javascript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 23 | Minor updates for long unbroken string going outside toast and new feature to keep the toast around after hover-off for an extended timeout. 24 | 25 | Set extendedTimeOut and timeOut to 0 to avoid toastr from fading away. 26 | Copyright © 2012 Hans Fjällemark & John Papa. 27 | en-US 28 | toastr, toast, notification, dialog, jquery 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /nuget/toastr.1.2.0.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 1.2.0 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | https://github.com/CodeSeven/toastr 11 | http://johnpapa.net/wp-content/images/toastr-icon.png 12 | false 13 | 3 Easy Steps: 14 | 15 | (1) Link to toastr.css 16 | (2) Link to toastr.js 17 | (3) Use toastr to display a toast for info, success, warning or error 18 | 19 | // Display an info toast with no title 20 | toastr.info('Are you the 6 fingered man?') 21 | 22 | *** For other API calls, see the demo 23 | toastr is a Javascript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 24 | Added getContainer(). 25 | Fixed clear() bug. 26 | Removed semver from file name. 27 | Copyright © 2012 Hans Fjällemark & John Papa. 28 | en-US 29 | toastr, toast, notification, dialog, jquery 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /nuget/toastr.1.2.1.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 1.2.1 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | https://github.com/CodeSeven/toastr 11 | http://johnpapa.net/wp-content/images/toastr-icon.png 12 | false 13 | 3 Easy Steps: 14 | 15 | (1) Link to toastr.css 16 | (2) Link to toastr.js 17 | (3) Use toastr to display a toast for info, success, warning or error 18 | 19 | // Display an info toast with no title 20 | toastr.info('Are you the 6 fingered man?') 21 | 22 | *** For other API calls, see the demo 23 | toastr is a Javascript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 24 | Added getContainer(). 25 | Fixed clear() bug. 26 | Removed semver from file name. 27 | Copyright © 2012 Hans Fjällemark & John Papa. 28 | en-US 29 | toastr, toast, notification, dialog, jquery 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /nuget/toastr.1.2.2.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 1.2.2 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | https://github.com/CodeSeven/toastr 11 | http://johnpapa.net/wp-content/images/toastr-icon.png 12 | false 13 | 3 Easy Steps: 14 | 15 | (1) Link to toastr.css 16 | (2) Link to toastr.js 17 | (3) Use toastr to display a toast for info, success, warning or error 18 | 19 | // Display an info toast with no title 20 | toastr.info('Are you the 6 fingered man?') 21 | 22 | *** For other API calls, see the demo 23 | toastr is a Javascript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 24 | Added getContainer(). 25 | Fixed clear() bug. 26 | Removed semver from file name. 27 | Copyright © 2012 Hans Fjällemark & John Papa. 28 | en-US 29 | toastr, toast, notification, dialog, jquery 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "toastr", 3 | "filename": "build/toastr.min.js", 4 | "main": "toastr.js", 5 | "style": "build/toastr.min.css", 6 | "version": "2.1.4", 7 | "description": "ToastrJS is a JavaScript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended.", 8 | "homepage": "http://www.toastrjs.com", 9 | "keywords": [ 10 | "Toastr", 11 | "ToastrJS", 12 | "toastr.js" 13 | ], 14 | "maintainers": [ 15 | { 16 | "name": "John Papa", 17 | "web": "http://www.johnpapa.net", 18 | "twitter": "@john_papa" 19 | }, 20 | { 21 | "name": "Tim Ferrell", 22 | "web": "https://twitter.com/ferrell_tim", 23 | "twitter": "@ferrell_tim" 24 | } 25 | ], 26 | "repository": { 27 | "type": "git", 28 | "url": "git://github.com/CodeSeven/toastr.git" 29 | }, 30 | "bugs": "http://stackoverflow.com/questions/tagged/toastr", 31 | "licenses": [ 32 | { 33 | "type": "MIT", 34 | "url": "http://www.opensource.org/licenses/mit-license.php" 35 | } 36 | ], 37 | "dependencies": { 38 | "jquery": ">=1.12.0" 39 | }, 40 | "devDependencies": { 41 | "gulp": "^3.8.10", 42 | "gulp-bytediff": "^0.2.0", 43 | "gulp-jscs": "^1.3.0", 44 | "gulp-jshint": "^1.9.0", 45 | "gulp-less": "^3.0.3", 46 | "gulp-load-plugins": "^0.7.1", 47 | "gulp-load-utils": "0.0.4", 48 | "gulp-minify-css": "^0.3.11", 49 | "gulp-rename": "^1.2.0", 50 | "gulp-sourcemaps": "^1.2.8", 51 | "gulp-task-listing": "^0.3.0", 52 | "gulp-uglify": "^1.0.1", 53 | "gulp-util": "^3.0.1", 54 | "jquery": ">=1.12.0", 55 | "jshint-stylish": "^1.0.0", 56 | "karma": "^1.7.0", 57 | "karma-coverage": "^1.1.1", 58 | "karma-phantomjs-launcher": "^1.0.4", 59 | "karma-qunit": "^0.1.3", 60 | "merge-stream": "^0.1.6", 61 | "phantomjs-prebuilt": "^2.1.14", 62 | "plato": "^1.2.2", 63 | "qunitjs": "~1.14.0" 64 | }, 65 | "scripts": { 66 | "test": "gulp test" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /nuget/toastr.2.0.2.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 2.0.2 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | http://toastrjs.com/ 11 | http://johnpapa.net/wp-content/images/toastr-icon.png 12 | false 13 | 3 Easy Steps: 14 | 15 | (1) Link to toastr.css 16 | (2) Link to toastr.js 17 | (3) Use toastr to display a toast for info, success, warning or error 18 | 19 | // Display an info toast with no title 20 | toastr.info('Are you the 6 fingered man?') 21 | 22 | *** For other API calls, see the demo 23 | Toastr is a JavaScript library for non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 24 | Change log: https://github.com/CodeSeven/toastr/blob/master/CHANGELOG.md 25 | Copyright © 2012-2014 Hans Fjällemark & John Papa. 26 | en-US 27 | toastr, toast, notification, dialog, jquery 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /nuget/toastr.2.0.3.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 2.0.3 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | http://toastrjs.com/ 11 | http://johnpapa.net/wp-content/images/toastr-icon.png 12 | false 13 | 3 Easy Steps: 14 | 15 | (1) Link to toastr.css 16 | (2) Link to toastr.js 17 | (3) Use toastr to display a toast for info, success, warning or error 18 | 19 | // Display an info toast with no title 20 | toastr.info('Are you the 6 fingered man?') 21 | 22 | *** For other API calls, see the demo 23 | Toastr is a JavaScript library for non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 24 | Change log: https://github.com/CodeSeven/toastr/blob/master/CHANGELOG.md 25 | Copyright © 2012-2014 Hans Fjällemark & John Papa. 26 | en-US 27 | toastr, toast, notification, dialog, jquery 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /nuget/toastr.1.1.4.1.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 1.1.4.1 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | https://github.com/CodeSeven/toastr 11 | http://johnpapa.net/wp-content/images/toastr-icon.png 12 | false 13 | 3 Easy Steps: 14 | 15 | (1) Link to toastr.css 16 | (2) Link to toastr.js 17 | (3) Use toastr to display a toast for info, success, warning or error 18 | 19 | // Display an info toast with no title 20 | toastr.info('Are you the 6 fingered man?') 21 | 22 | *** For other API calls, see the demo 23 | toastr is a Javascript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 24 | Added AMD support (and backwards compat with non AMD), toastr.clear() method clears 1 or all toasts, optionsOverride API to be able to override options for each toast, added onclick callback option which fires when a user clicks the toast. Also cleaned CSS, merged CSS files into 1 file, and reduced jQuery dependency to v1.6.3 25 | 26 | Fix to the toastr.min.js file 27 | Copyright © 2012 Hans Fjällemark & John Papa. 28 | en-US 29 | toastr, toast, notification, dialog, jquery 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /nuget/toastr.1.1.4.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 1.1.4 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | https://github.com/CodeSeven/toastr 11 | http://johnpapa.net/wp-content/images/toastr-icon.png 12 | false 13 | 3 Easy Steps: 14 | 15 | (1) Link to toastr.css 16 | (2) Link to toastr.js 17 | (3) Use toastr to display a toast for info, success, warning or error 18 | 19 | // Display an info toast with no title 20 | toastr.info('Are you the 6 fingered man?') 21 | 22 | *** For other API calls, see the demo 23 | toastr is a Javascript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 24 | Added AMD support (and backwards compat with non AMD), toastr.clear() method clears 1 or all toasts, optionsOverride API to be able to override options for each toast, added onclick callback option which fires when a user clicks the toast. Also cleaned CSS, merged CSS files into 1 file, and reduced jQuery dependency to v1.6.3 25 | 26 | Fix to the toastr.min.js file 27 | Copyright © 2012 Hans Fjällemark & John Papa. 28 | en-US 29 | toastr, toast, notification, dialog, jquery 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration 2 | // Generated on Thu Sep 04 2014 07:41:43 GMT-0400 (EDT) 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | 7 | // base path that will be used to resolve all patterns (eg. files, exclude) 8 | basePath: '', 9 | 10 | 11 | // frameworks to use 12 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter 13 | frameworks: ['qunit'], 14 | 15 | // list of files / patterns to load in the browser 16 | files: [ 17 | 'node_modules/jquery/dist/jquery.min.js', 18 | 'build/toastr.css', 19 | 'toastr.js', 20 | 'node_modules/qunitjs/qunit/qunit.js', 21 | 'tests/unit/qunit-helper.js', 22 | 'tests/unit/toastr-tests.js' 23 | ], 24 | 25 | 26 | // list of files to exclude 27 | exclude: [], 28 | 29 | 30 | // preprocess matching files before serving them to the browser 31 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 32 | preprocessors: { 33 | 'toastr.js': 'coverage' 34 | }, 35 | 36 | 37 | // test results reporter to use 38 | // possible values: 'dots', 'progress' 39 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter 40 | reporters: ['progress', 'coverage'], 41 | 42 | coverageReporter: { 43 | type: 'lcov', 44 | dir: 'tests/coverage' 45 | }, 46 | 47 | // web server port 48 | port: 9876, 49 | 50 | 51 | // enable / disable colors in the output (reporters and logs) 52 | colors: true, 53 | 54 | 55 | // level of logging 56 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 57 | logLevel: config.LOG_INFO, 58 | 59 | 60 | // enable / disable watching file and executing tests whenever any file changes 61 | autoWatch: false, 62 | 63 | 64 | // start these browsers 65 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 66 | browsers: ['PhantomJS'], 67 | 68 | 69 | // Continuous Integration mode 70 | // if true, Karma captures browsers, runs the tests and exits 71 | singleRun: true 72 | }); 73 | }; 74 | -------------------------------------------------------------------------------- /nuget/toastr.1.1.4.2.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 1.1.4.2 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | https://github.com/CodeSeven/toastr 11 | http://johnpapa.net/wp-content/images/toastr-icon.png 12 | false 13 | 3 Easy Steps: 14 | 15 | (1) Link to toastr.css 16 | (2) Link to toastr.js 17 | (3) Use toastr to display a toast for info, success, warning or error 18 | 19 | // Display an info toast with no title 20 | toastr.info('Are you the 6 fingered man?') 21 | 22 | *** For other API calls, see the demo 23 | toastr is a Javascript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 24 | Added AMD support (and backwards compat with non AMD), toastr.clear() method clears 1 or all toasts, optionsOverride API to be able to override options for each toast, added onclick callback option which fires when a user clicks the toast. Also cleaned CSS, merged CSS files into 1 file, and reduced jQuery dependency to v1.6.3 25 | 26 | Fix to the toastr.min.js file 27 | Copyright © 2012 Hans Fjällemark & John Papa. 28 | en-US 29 | toastr, toast, notification, dialog, jquery 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /nuget/toastr.1.3.0.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 1.3.0 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | https://github.com/CodeSeven/toastr 11 | http://johnpapa.net/wp-content/images/toastr-icon.png 12 | false 13 | 3 Easy Steps: 14 | 15 | (1) Link to toastr.css 16 | (2) Link to toastr.js 17 | (3) Use toastr to display a toast for info, success, warning or error 18 | 19 | // Display an info toast with no title 20 | toastr.info('Are you the 6 fingered man?') 21 | 22 | *** For other API calls, see the demo 23 | toastr is a Javascript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 24 | Added onFadeIn and onFadeOut callbacks. 25 | toastr.options.onFadeIn = function() { console.log('hello'); } 26 | Added option <code>newestOnTop</code> to show toasts in oldest or newest first order. 27 | toastr.options.newestOnTop = false; 28 | Fixed margins on full width toasts 29 | Added LESS file. 30 | Added min file for JS and CSS 31 | Added missing vendor prefixes in CSS. 32 | Various minor bug fixes. 33 | Added unit tests for new features. 34 | Copyright © 2012 Hans Fjällemark & John Papa. 35 | en-US 36 | toastr, toast, notification, dialog, jquery 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /nuget/toastr.2.0.1.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 2.0.1 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | http://toastrjs.com/ 11 | http://johnpapa.net/wp-content/images/toastr-icon.png 12 | false 13 | 3 Easy Steps: 14 | 15 | (1) Link to toastr.css 16 | (2) Link to toastr.js 17 | (3) Use toastr to display a toast for info, success, warning or error 18 | 19 | // Display an info toast with no title 20 | toastr.info('Are you the 6 fingered man?') 21 | 22 | *** For other API calls, see the demo 23 | Toastr is a JavaScript library for non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 24 | The following animations options have been deprecated and should be replaced: 25 | 26 | Replace options.fadeIn with options.showDuration 27 | Replace options.onFadeIn with options.onShown 28 | Replace options.fadeOut with options.hideDuration 29 | Replace options.onFadeOut with options.onHidden 30 | 31 | Optional 'close' button, bug fixes, and improved responsive design. 32 | 33 | For other changes, see http://toastrjs.com 34 | Copyright © 2012 Hans Fjällemark & John Papa. 35 | en-US 36 | toastr, toast, notification, dialog, jquery 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /nuget/toastr.2.0.0-rc1.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 2.0.0-rc1 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | http://toastrjs.com/ 11 | http://johnpapa.net/wp-content/images/toastr-icon.png 12 | false 13 | 3 Easy Steps: 14 | 15 | (1) Link to toastr.css 16 | (2) Link to toastr.js 17 | (3) Use toastr to display a toast for info, success, warning or error 18 | 19 | // Display an info toast with no title 20 | toastr.info('Are you the 6 fingered man?') 21 | 22 | *** For other API calls, see the demo 23 | Toastr is a JavaScript library for non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 24 | The following animations options have been deprecated and should be replaced: 25 | 26 | Replace options.fadeIn with options.showDuration 27 | Replace options.onFadeIn with options.onShown 28 | Replace options.fadeOut with options.hideDuration 29 | Replace options.onFadeOut with options.onHidden 30 | 31 | Optional 'close' button, bug fixes, and improved responsive design. 32 | 33 | For other changes, see http://toastrjs.com 34 | Copyright © 2012 Hans Fjällemark & John Papa. 35 | en-US 36 | toastr, toast, notification, dialog, jquery 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /.jscsrc: -------------------------------------------------------------------------------- 1 | { 2 | "excludeFiles": ["node_modules/**", "bower_components/**"], 3 | 4 | 5 | "requireCurlyBraces": [ 6 | "if", 7 | "else", 8 | "for", 9 | "while", 10 | "do", 11 | "try", 12 | "catch" 13 | ], 14 | "requireOperatorBeforeLineBreak": true, 15 | "requireCamelCaseOrUpperCaseIdentifiers": true, 16 | "maximumLineLength": { 17 | "value": 80, 18 | "allowComments": true, 19 | "allowRegex": true 20 | }, 21 | "validateIndentation": 2, 22 | "validateQuoteMarks": "'", 23 | 24 | "disallowMultipleLineStrings": true, 25 | "disallowMixedSpacesAndTabs": true, 26 | "disallowTrailingWhitespace": true, 27 | "disallowSpaceAfterPrefixUnaryOperators": true, 28 | "disallowMultipleVarDecl": null, 29 | 30 | "requireSpaceAfterKeywords": [ 31 | "if", 32 | "else", 33 | "for", 34 | "while", 35 | "do", 36 | "switch", 37 | "return", 38 | "try", 39 | "catch" 40 | ], 41 | "requireSpaceBeforeBinaryOperators": [ 42 | "=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", 43 | "&=", "|=", "^=", "+=", 44 | 45 | "+", "-", "*", "/", "%", "<<", ">>", ">>>", "&", 46 | "|", "^", "&&", "||", "===", "==", ">=", 47 | "<=", "<", ">", "!=", "!==" 48 | ], 49 | "requireSpaceAfterBinaryOperators": true, 50 | "requireSpacesInConditionalExpression": true, 51 | "requireSpaceBeforeBlockStatements": true, 52 | "requireLineFeedAtFileEnd": true, 53 | "disallowSpacesInsideObjectBrackets": "all", 54 | "disallowSpacesInsideArrayBrackets": "all", 55 | "disallowSpacesInsideParentheses": true, 56 | 57 | 58 | "validateJSDoc": { 59 | "checkParamNames": true, 60 | "requireParamTypes": true 61 | }, 62 | 63 | "disallowMultipleLineBreaks": true, 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | "requireLineFeedAtFileEnd": null, 72 | "disallowCommaBeforeLineBreak": null, 73 | "disallowDanglingUnderscores": null, 74 | "disallowEmptyBlocks": null, 75 | "disallowMixedSpacesAndTabs": null, 76 | "disallowMultipleLineStrings": null, 77 | "disallowTrailingComma": null, 78 | "disallowTrailingWhitespace": null, 79 | "maximumLineLength": null, 80 | "requireCamelCaseOrUpperCaseIdentifiers": null, 81 | "requireCapitalizedConstructors": null, 82 | "requireCommaBeforeLineBreak": null, 83 | "requireCurlyBraces": null, 84 | "requireDotNotation": null, 85 | "requireMultipleVarDecl": null, 86 | "requireOperatorBeforeLineBreak": null, 87 | "requireParenthesesAroundIIFE": true, 88 | "validateIndentation": 4, 89 | "validateQuoteMarks": null 90 | } -------------------------------------------------------------------------------- /nuget/toastr.1.3.1.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | toastr 5 | 1.3.1 6 | toastr 7 | John Papa,Hans Fjällemark 8 | John Papa,Hans Fjällemark 9 | http://www.opensource.org/licenses/mit-license.php 10 | https://github.com/CodeSeven/toastr 11 | http://johnpapa.net/wp-content/images/toastr-icon.png 12 | false 13 | 3 Easy Steps: 14 | 15 | (1) Link to toastr.css 16 | (2) Link to toastr.js 17 | (3) Use toastr to display a toast for info, success, warning or error 18 | 19 | // Display an info toast with no title 20 | toastr.info('Are you the 6 fingered man?') 21 | 22 | *** For other API calls, see the demo 23 | toastr is a Javascript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 24 | v.1.3.1 25 | Added new API for toastr.subscribe so you can be alerted when toasts appear and disappear. 26 | 27 | toastr.subscribe(function (args) { 28 | // args contains the toast options and data 29 | } 30 | 31 | Added support for glimpse.toastr.js plugin. https://github.com/johnpapa/glimpse.toastr 32 | 33 | Added toastId, state (visible/hidden), startTime and endTime to the toastr info response (available in the coneol, glimpse.toastr plugin, or via the subscribe callback). 34 | 35 | Fixed bug with stacking toasts when clear all toasts occurs first. 36 | 37 | v1.2.2 38 | 39 | Added onFadeIn and onFadeOut callbacks. 40 | toastr.options.onFadeIn = function() { console.log('hello'); } 41 | Added option <code>newestOnTop</code> to show toasts in oldest or newest first order. 42 | toastr.options.newestOnTop = false; 43 | Fixed margins on full width toasts 44 | Added LESS file. 45 | Added min file for JS and CSS 46 | Added missing vendor prefixes in CSS. 47 | Various minor bug fixes. 48 | Added unit tests for new features. 49 | Copyright © 2012 Hans Fjällemark & John Papa. 50 | en-US 51 | toastr, toast, notification, dialog, jquery 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /nuget/content/scripts/toastr.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a(["jquery"],function(a){return function(){function b(a,b,c){return o({type:u.error,iconClass:p().iconClasses.error,message:a,optionsOverride:c,title:b})}function c(b,c){return b||(b=p()),r=a("#"+b.containerId),r.length?r:(c&&(r=l(b)),r)}function d(a,b,c){return o({type:u.info,iconClass:p().iconClasses.info,message:a,optionsOverride:c,title:b})}function e(a){s=a}function f(a,b,c){return o({type:u.success,iconClass:p().iconClasses.success,message:a,optionsOverride:c,title:b})}function g(a,b,c){return o({type:u.warning,iconClass:p().iconClasses.warning,message:a,optionsOverride:c,title:b})}function h(a){var b=p();r||c(b),k(a,b)||j(b)}function i(b){var d=p();return r||c(d),b&&0===a(":focus",b).length?void q(b):void(r.children().length&&r.remove())}function j(b){for(var c=r.children(),d=c.length-1;d>=0;d--)k(a(c[d]),b)}function k(b,c){return b&&0===a(":focus",b).length?(b[c.hideMethod]({duration:c.hideDuration,easing:c.hideEasing,complete:function(){q(b)}}),!0):!1}function l(b){return r=a("
    ").attr("id",b.containerId).addClass(b.positionClass).attr("aria-live","polite").attr("role","alert"),r.appendTo(a(b.target)),r}function m(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",target:"body",closeHtml:"",newestOnTop:!0}}function n(a){s&&s(a)}function o(b){function d(b){return!a(":focus",j).length||b?j[g.hideMethod]({duration:g.hideDuration,easing:g.hideEasing,complete:function(){q(j),g.onHidden&&"hidden"!==o.state&&g.onHidden(),o.state="hidden",o.endTime=new Date,n(o)}}):void 0}function e(){(g.timeOut>0||g.extendedTimeOut>0)&&(i=setTimeout(d,g.extendedTimeOut))}function f(){clearTimeout(i),j.stop(!0,!0)[g.showMethod]({duration:g.showDuration,easing:g.showEasing})}var g=p(),h=b.iconClass||g.iconClass;"undefined"!=typeof b.optionsOverride&&(g=a.extend(g,b.optionsOverride),h=b.optionsOverride.iconClass||h),t++,r=c(g,!0);var i=null,j=a("
    "),k=a("
    "),l=a("
    "),m=a(g.closeHtml),o={toastId:t,state:"visible",startTime:new Date,options:g,map:b};return b.iconClass&&j.addClass(g.toastClass).addClass(h),b.title&&(k.append(b.title).addClass(g.titleClass),j.append(k)),b.message&&(l.append(b.message).addClass(g.messageClass),j.append(l)),g.closeButton&&(m.addClass("toast-close-button").attr("role","button"),j.prepend(m)),j.hide(),g.newestOnTop?r.prepend(j):r.append(j),j[g.showMethod]({duration:g.showDuration,easing:g.showEasing,complete:g.onShown}),g.timeOut>0&&(i=setTimeout(d,g.timeOut)),j.hover(f,e),!g.onclick&&g.tapToDismiss&&j.click(d),g.closeButton&&m&&m.click(function(a){a.stopPropagation?a.stopPropagation():void 0!==a.cancelBubble&&a.cancelBubble!==!0&&(a.cancelBubble=!0),d(!0)}),g.onclick&&j.click(function(){g.onclick(),d()}),n(o),g.debug&&console&&console.log(o),j}function p(){return a.extend({},m(),v.options)}function q(a){r||(r=c()),a.is(":visible")||(a.remove(),a=null,0===r.children().length&&r.remove())}var r,s,t=0,u={error:"error",info:"info",success:"success",warning:"warning"},v={clear:h,remove:i,error:b,getContainer:c,info:d,options:{},subscribe:e,success:f,version:"2.0.3",warning:g};return v}()})}("function"==typeof define&&define.amd?define:function(a,b){"undefined"!=typeof module&&module.exports?module.exports=b(require("jquery")):window.toastr=b(window.jQuery)}); -------------------------------------------------------------------------------- /nuget/content/content/toastr.min.css: -------------------------------------------------------------------------------- 1 | .toast-title{font-weight:bold}.toast-message{-ms-word-wrap:break-word;word-wrap:break-word}.toast-message a,.toast-message label{color:#fff}.toast-message a:hover{color:#ccc;text-decoration:none}.toast-close-button{position:relative;right:-0.3em;top:-0.3em;float:right;font-size:20px;font-weight:bold;color:#fff;-webkit-text-shadow:0 1px 0 #fff;text-shadow:0 1px 0 #fff;opacity:.8;-ms-filter:alpha(opacity=80);filter:alpha(opacity=80)}.toast-close-button:hover,.toast-close-button:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.4;-ms-filter:alpha(opacity=40);filter:alpha(opacity=40)}button.toast-close-button{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.toast-top-full-width{top:0;right:0;width:100%}.toast-bottom-full-width{bottom:0;right:0;width:100%}.toast-top-left{top:12px;left:12px}.toast-top-right{top:12px;right:12px}.toast-bottom-right{right:12px;bottom:12px}.toast-bottom-left{bottom:12px;left:12px}#toast-container{position:fixed;z-index:999999}#toast-container *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#toast-container>div{margin:0 0 6px;padding:15px 15px 15px 50px;width:300px;-moz-border-radius:3px 3px 3px 3px;-webkit-border-radius:3px 3px 3px 3px;border-radius:3px 3px 3px 3px;background-position:15px center;background-repeat:no-repeat;-moz-box-shadow:0 0 12px #999;-webkit-box-shadow:0 0 12px #999;box-shadow:0 0 12px #999;color:#fff;opacity:.8;-ms-filter:alpha(opacity=80);filter:alpha(opacity=80)}#toast-container>:hover{-moz-box-shadow:0 0 12px #000;-webkit-box-shadow:0 0 12px #000;box-shadow:0 0 12px #000;opacity:1;-ms-filter:alpha(opacity=100);filter:alpha(opacity=100);cursor:pointer}#toast-container>.toast-info{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=")!important}#toast-container>.toast-error{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=")!important}#toast-container>.toast-success{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==")!important}#toast-container>.toast-warning{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=")!important}#toast-container.toast-top-full-width>div,#toast-container.toast-bottom-full-width>div{width:96%;margin:auto}.toast{background-color:#030303}.toast-success{background-color:#51a351}.toast-error{background-color:#bd362f}.toast-info{background-color:#2f96b4}.toast-warning{background-color:#f89406}@media all and (max-width:240px){#toast-container>div{padding:8px 8px 8px 50px;width:11em}#toast-container .toast-close-button{right:-0.2em;top:-0.2em}}@media all and (min-width:241px) and (max-width:480px){#toast-container>div{padding:8px 8px 8px 50px;width:18em}#toast-container .toast-close-button{right:-0.2em;top:-0.2em}}@media all and (min-width:481px) and (max-width:768px){#toast-container>div{padding:15px 15px 15px 50px;width:25em}} -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | /* jshint node:true, camelcase:false */ 2 | var gulp = require('gulp'); 3 | var karma = require('karma').server; 4 | var merge = require('merge-stream'); 5 | var plug = require('gulp-load-plugins')(); 6 | 7 | var paths = { 8 | js: './toastr.js', 9 | less: './toastr.less', 10 | report: './report', 11 | build: './build' 12 | }; 13 | 14 | var log = plug.util.log; 15 | 16 | /** 17 | * List the available gulp tasks 18 | */ 19 | gulp.task('help', plug.taskListing); 20 | 21 | /** 22 | * Lint the code, create coverage report, and a visualizer 23 | * @return {Stream} 24 | */ 25 | gulp.task('analyze', function () { 26 | log('Analyzing source with JSHint and JSCS'); 27 | 28 | var jshint = analyzejshint([paths.js]); 29 | var jscs = analyzejscs([paths.js]); 30 | 31 | return merge(jshint, jscs); 32 | }); 33 | 34 | /** 35 | * Minify and bundle the app's JavaScript 36 | * @return {Stream} 37 | */ 38 | gulp.task('js', function () { 39 | log('Bundling, minifying, and copying the app\'s JavaScript'); 40 | 41 | return gulp 42 | .src(paths.js) 43 | .pipe(plug.sourcemaps.init()) 44 | .pipe(plug.bytediff.start()) 45 | .pipe(plug.uglify({})) 46 | .pipe(plug.bytediff.stop(bytediffFormatter)) 47 | .pipe(plug.sourcemaps.write('.')) 48 | .pipe(plug.rename(function (path) { 49 | if (path.extname === '.js') { 50 | path.basename += '.min'; 51 | } 52 | })) 53 | .pipe(gulp.dest(paths.build)); 54 | }); 55 | 56 | /** 57 | * Minify and bundle the CSS 58 | * @return {Stream} 59 | */ 60 | gulp.task('css', function () { 61 | log('Bundling, minifying, and copying the app\'s CSS'); 62 | 63 | return gulp.src(paths.less) 64 | .pipe(plug.less()) 65 | .pipe(gulp.dest(paths.build)) 66 | .pipe(plug.bytediff.start()) 67 | .pipe(plug.minifyCss({})) 68 | .pipe(plug.bytediff.stop(bytediffFormatter)) 69 | .pipe(plug.rename('toastr.min.css')) 70 | .pipe(gulp.dest(paths.build)); 71 | }); 72 | 73 | /** 74 | * Build js and css 75 | */ 76 | gulp.task('default', ['js', 'css'], function () { 77 | log('Analyze, Build CSS and JS'); 78 | }); 79 | 80 | /** 81 | * Remove all files from the build folder 82 | * One way to run clean before all tasks is to run 83 | * from the cmd line: gulp clean && gulp build 84 | * @return {Stream} 85 | */ 86 | gulp.task('clean', function (cb) { 87 | log('Cleaning: ' + plug.util.colors.blue(paths.report)); 88 | log('Cleaning: ' + plug.util.colors.blue(paths.build)); 89 | 90 | var delPaths = [paths.build, paths.report]; 91 | del(delPaths, cb); 92 | }); 93 | 94 | /** 95 | * Run specs once and exit 96 | * To start servers and run midway specs as well: 97 | * gulp test --startServers 98 | * @return {Stream} 99 | */ 100 | gulp.task('test', function (done) { 101 | startTests(true /*singleRun*/, done); 102 | }); 103 | 104 | //////////////// 105 | 106 | /** 107 | * Execute JSHint on given source files 108 | * @param {Array} sources 109 | * @param {String} overrideRcFile 110 | * @return {Stream} 111 | */ 112 | function analyzejshint(sources, overrideRcFile) { 113 | var jshintrcFile = overrideRcFile || './.jshintrc'; 114 | log('Running JSHint'); 115 | return gulp 116 | .src(sources) 117 | .pipe(plug.jshint(jshintrcFile)) 118 | .pipe(plug.jshint.reporter('jshint-stylish')); 119 | } 120 | 121 | /** 122 | * Execute JSCS on given source files 123 | * @param {Array} sources 124 | * @return {Stream} 125 | */ 126 | function analyzejscs(sources) { 127 | log('Running JSCS'); 128 | return gulp 129 | .src(sources) 130 | .pipe(plug.jscs('./.jscsrc')); 131 | } 132 | 133 | /** 134 | * Start the tests using karma. 135 | * @param {boolean} singleRun - True means run once and end (CI), or keep running (dev) 136 | * @param {Function} done - Callback to fire when karma is done 137 | * @return {undefined} 138 | */ 139 | function startTests(singleRun, done) { 140 | karma.start({ 141 | configFile: __dirname + '/karma.conf.js', 142 | singleRun: !!singleRun 143 | }, karmaCompleted); 144 | 145 | //////////////// 146 | 147 | function karmaCompleted(exitCode) { 148 | if (exitCode === 0) { 149 | done(); 150 | } else { 151 | process.exit(exitCode); 152 | } 153 | } 154 | } 155 | 156 | /** 157 | * Formatter for bytediff to display the size changes after processing 158 | * @param {Object} data - byte data 159 | * @return {String} Difference in bytes, formatted 160 | */ 161 | function bytediffFormatter(data) { 162 | var difference = (data.savings > 0) ? ' smaller.' : ' larger.'; 163 | return data.fileName + ' went from ' + 164 | (data.startSize / 1000).toFixed(2) + ' kB to ' + (data.endSize / 1000).toFixed(2) + ' kB' + 165 | ' and is ' + formatPercent(1 - data.percent, 2) + '%' + difference; 166 | } 167 | 168 | /** 169 | * Format a number as a percentage 170 | * @param {Number} num Number to format as a percent 171 | * @param {Number} precision Precision of the decimal 172 | * @return {Number} Formatted perentage 173 | */ 174 | function formatPercent(num, precision) { 175 | return (num * 100).toFixed(precision); 176 | } 177 | -------------------------------------------------------------------------------- /tests/qunit/qunit.css: -------------------------------------------------------------------------------- 1 | /** 2 | * QUnit v1.12.0 - A JavaScript Unit Testing Framework 3 | * 4 | * http://qunitjs.com 5 | * 6 | * Copyright 2012 jQuery Foundation and other contributors 7 | * Released under the MIT license. 8 | * http://jquery.org/license 9 | */ 10 | 11 | /** Font Family and Sizes */ 12 | 13 | #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { 14 | font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; 15 | } 16 | 17 | #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } 18 | #qunit-tests { font-size: smaller; } 19 | 20 | 21 | /** Resets */ 22 | 23 | #qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter { 24 | margin: 0; 25 | padding: 0; 26 | } 27 | 28 | 29 | /** Header */ 30 | 31 | #qunit-header { 32 | padding: 0.5em 0 0.5em 1em; 33 | 34 | color: #8699a4; 35 | background-color: #0d3349; 36 | 37 | font-size: 1.5em; 38 | line-height: 1em; 39 | font-weight: normal; 40 | 41 | border-radius: 5px 5px 0 0; 42 | -moz-border-radius: 5px 5px 0 0; 43 | -webkit-border-top-right-radius: 5px; 44 | -webkit-border-top-left-radius: 5px; 45 | } 46 | 47 | #qunit-header a { 48 | text-decoration: none; 49 | color: #c2ccd1; 50 | } 51 | 52 | #qunit-header a:hover, 53 | #qunit-header a:focus { 54 | color: #fff; 55 | } 56 | 57 | #qunit-testrunner-toolbar label { 58 | display: inline-block; 59 | padding: 0 .5em 0 .1em; 60 | } 61 | 62 | #qunit-banner { 63 | height: 5px; 64 | } 65 | 66 | #qunit-testrunner-toolbar { 67 | padding: 0.5em 0 0.5em 2em; 68 | color: #5E740B; 69 | background-color: #eee; 70 | overflow: hidden; 71 | } 72 | 73 | #qunit-userAgent { 74 | padding: 0.5em 0 0.5em 2.5em; 75 | background-color: #2b81af; 76 | color: #fff; 77 | text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; 78 | } 79 | 80 | #qunit-modulefilter-container { 81 | float: right; 82 | } 83 | 84 | /** Tests: Pass/Fail */ 85 | 86 | #qunit-tests { 87 | list-style-position: inside; 88 | } 89 | 90 | #qunit-tests li { 91 | padding: 0.4em 0.5em 0.4em 2.5em; 92 | border-bottom: 1px solid #fff; 93 | list-style-position: inside; 94 | } 95 | 96 | #qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { 97 | display: none; 98 | } 99 | 100 | #qunit-tests li strong { 101 | cursor: pointer; 102 | } 103 | 104 | #qunit-tests li a { 105 | padding: 0.5em; 106 | color: #c2ccd1; 107 | text-decoration: none; 108 | } 109 | #qunit-tests li a:hover, 110 | #qunit-tests li a:focus { 111 | color: #000; 112 | } 113 | 114 | #qunit-tests li .runtime { 115 | float: right; 116 | font-size: smaller; 117 | } 118 | 119 | .qunit-assert-list { 120 | margin-top: 0.5em; 121 | padding: 0.5em; 122 | 123 | background-color: #fff; 124 | 125 | border-radius: 5px; 126 | -moz-border-radius: 5px; 127 | -webkit-border-radius: 5px; 128 | } 129 | 130 | .qunit-collapsed { 131 | display: none; 132 | } 133 | 134 | #qunit-tests table { 135 | border-collapse: collapse; 136 | margin-top: .2em; 137 | } 138 | 139 | #qunit-tests th { 140 | text-align: right; 141 | vertical-align: top; 142 | padding: 0 .5em 0 0; 143 | } 144 | 145 | #qunit-tests td { 146 | vertical-align: top; 147 | } 148 | 149 | #qunit-tests pre { 150 | margin: 0; 151 | white-space: pre-wrap; 152 | word-wrap: break-word; 153 | } 154 | 155 | #qunit-tests del { 156 | background-color: #e0f2be; 157 | color: #374e0c; 158 | text-decoration: none; 159 | } 160 | 161 | #qunit-tests ins { 162 | background-color: #ffcaca; 163 | color: #500; 164 | text-decoration: none; 165 | } 166 | 167 | /*** Test Counts */ 168 | 169 | #qunit-tests b.counts { color: black; } 170 | #qunit-tests b.passed { color: #5E740B; } 171 | #qunit-tests b.failed { color: #710909; } 172 | 173 | #qunit-tests li li { 174 | padding: 5px; 175 | background-color: #fff; 176 | border-bottom: none; 177 | list-style-position: inside; 178 | } 179 | 180 | /*** Passing Styles */ 181 | 182 | #qunit-tests li li.pass { 183 | color: #3c510c; 184 | background-color: #fff; 185 | border-left: 10px solid #C6E746; 186 | } 187 | 188 | #qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } 189 | #qunit-tests .pass .test-name { color: #366097; } 190 | 191 | #qunit-tests .pass .test-actual, 192 | #qunit-tests .pass .test-expected { color: #999999; } 193 | 194 | #qunit-banner.qunit-pass { background-color: #C6E746; } 195 | 196 | /*** Failing Styles */ 197 | 198 | #qunit-tests li li.fail { 199 | color: #710909; 200 | background-color: #fff; 201 | border-left: 10px solid #EE5757; 202 | white-space: pre; 203 | } 204 | 205 | #qunit-tests > li:last-child { 206 | border-radius: 0 0 5px 5px; 207 | -moz-border-radius: 0 0 5px 5px; 208 | -webkit-border-bottom-right-radius: 5px; 209 | -webkit-border-bottom-left-radius: 5px; 210 | } 211 | 212 | #qunit-tests .fail { color: #000000; background-color: #EE5757; } 213 | #qunit-tests .fail .test-name, 214 | #qunit-tests .fail .module-name { color: #000000; } 215 | 216 | #qunit-tests .fail .test-actual { color: #EE5757; } 217 | #qunit-tests .fail .test-expected { color: green; } 218 | 219 | #qunit-banner.qunit-fail { background-color: #EE5757; } 220 | 221 | 222 | /** Result */ 223 | 224 | #qunit-testresult { 225 | padding: 0.5em 0.5em 0.5em 2.5em; 226 | 227 | color: #2b81af; 228 | background-color: #D2E0E6; 229 | 230 | border-bottom: 1px solid white; 231 | } 232 | #qunit-testresult .module-name { 233 | font-weight: bold; 234 | } 235 | 236 | /** Fixture */ 237 | 238 | #qunit-fixture { 239 | position: absolute; 240 | top: -10000px; 241 | left: -10000px; 242 | width: 1000px; 243 | height: 1000px; 244 | } 245 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 6454acf14 (2017-12-08) 2 | _No official release because there are only CI changes._ 3 | 4 | - Resolving CI issues by manually merging in JLHwung's fork. (https://github.com/easyops-cn/toastr) 5 | 6 | # 2.1.4 (2017-12-07) 7 | - Same as 2.1.3, except 2.1.4 is on NPM 8 | 9 | # 2.1.3 (2016-07-22) 10 | 11 | ## New Features 12 | - Right to left text support 13 | - Added callbacks for click events on close button 14 | 15 | ## Bug Fixes 16 | - Fixed some CSS that prevented touch events from propagating on iOS devices 17 | - Removed role attribute because it duplicated voice over on text-to-speech readers; kept aria-live. 18 | - Consistent line-heights for close button to resolve issues with Bootstrap. 19 | 20 | ## Dev Ops 21 | - Removed Plato from gulp 22 | 23 | # 2.1.2 (2015-08-06) 24 | 25 | ## New Features 26 | - Added HTML escaping (use toastr.options.escapeHTML) 27 | - Added more options for overriding animations, specifically to closing a toast 28 | - Events are now passed into the onClick handler of the toast 29 | 30 | ## Bug Fixes 31 | - Resolved issue with centered toasts that would override top and bottom margins 32 | 33 | ## Dev Ops 34 | - Removed `module` and `require` from the `.jshintrc` file 35 | - Cleaned up the readme 36 | - Builds moved to the `builds` folder 37 | - Made href calls relative to the transport in the demo 38 | - CSS is now built by the included LESS file as part of a `gulp` call 39 | - Removed un-used deps 40 | 41 | # 2.1.1 (2015-02-19) 42 | 43 | ## New Features 44 | - Support for explicitly clearing a toast [jstawski](https://github.com/jstawski) | [PR 226](https://github.com/CodeSeven/toastr/pull/226) 45 | 46 | ## Dev Ops 47 | - Refactor to use gulp 48 | 49 | # 2.1.0 (2014-10-15) 50 | 51 | ## New Features 52 | - Prevent duplicate sequential toasts [SBero](https://github.com/sbero) | [aa083d8](https://github.com/CodeSeven/toastr/commit/ccb377b6015d557dbb987df74750b97b3aa083d8) 53 | - Add support for top-center and bottom-center toasts [showwin](https://github.com/showwin) | [86a4798](https://github.com/CodeSeven/toastr/commit/86a4798e76c7d8516521780b7bd085d6bb4c371b) 54 | - Add feature allowing progress bars to be shown for toasts [TravisTX](https://github.com/TravisTX) | [PR 189](https://github.com/CodeSeven/toastr/pull/189) 55 | 56 | `toastr.options.preventDuplicates = true;` 57 | 58 | `toastr.options.progressBar = true;` 59 | 60 | ## Bug Fixes 61 | - None 62 | 63 | ## Breaking Changes 64 | - None 65 | 66 | ## Dev Ops 67 | 68 | - Add karma test runner 69 | - Added Travis CI hooks 70 | 71 | # 2.0.3 (2014-05-17) 72 | 73 | ## New Features 74 | - None 75 | 76 | ## Bug Fixes 77 | - positionClass changes were not being honored due to 2.0.2 release changes. Refactored getContainer to only get the container, unless a 2nd boolean parameter is passed in in which case it will also create it if the container did not exist [871c2a6](https://github.com/CodeSeven/toastr/commit/871c2a6e438bb6b996cfb80286720604a4cf00fd) 78 | 79 | ## Breaking Changes 80 | - None 81 | 82 | # 2.0.2 (2014-04-29) 83 | 84 | ## New Features 85 | - Added simple ARIA reader support ([45c6362](https://github.com/CodeSeven/toastr/commit/45c63628476f6b085a6579dc681f4fe61ba5820c)) 86 | - Added SASS support (direct port of CSS for now) ([b4c8b34](https://github.com/CodeSeven/toastr/commit/b4c8b3460efb8aa51c730dd38c35ef6b025db2cc)) 87 | 88 | ## Bug Fixes 89 | - Added sourcemap for the min file ([1da4bd1](https://github.com/CodeSeven/toastr/commit/1da4bd1dad21bcfc7fcfe73da1abb185cf2c3f9f)) 90 | - IE 8 does not support stopPropagation on the event ([6989573](https://github.com/CodeSeven/toastr/commit/698957325a8e7bf63990f71ee409b911d69bc8ec)) 91 | - Media query width fixes ([ea2f5db](https://github.com/CodeSeven/toastr/commit/ea2f5db6e5314dcfe48eb34176583849c177c00e)) 92 | - Fix of onHidden firing twice when clicking on it then moving mouse out of toast ([ad613b9](https://github.com/CodeSeven/toastr/commit/ad613b9f18feeec630497590b85ca75c52141ea3) , [#105](https://github.com/CodeSeven/toastr/issues/105)) 93 | - Clear all toasts followed by a new toast now displays correctly ([3126a53](https://github.com/CodeSeven/toastr/commit/3126a533e0ab12ec3ff374e155a37fd38bd23bb6) , [#149](https://github.com/CodeSeven/toastr/issues/149) , [#118](https://github.com/CodeSeven/toastr/issues/118)) 94 | 95 | ## Breaking Changes 96 | - None 97 | 98 | # 2.0.1 (2013-09-01) 99 | 100 | ## New Features 101 | 102 | ### Close Button 103 | Optionally enable a close button 104 | 105 | toastr.options.closeButton = true; 106 | 107 | Optionally override the close button's HTML. 108 | 109 | toastr.options.closeHtml = ''; 110 | 111 | You can also override the CSS/LESS for `#toast-container .toast-close-button` 112 | 113 | ### Callbacks 114 | // Define a callback for when the toast is shown/hidden 115 | toastr.options.onShown = function() { console.log('hello'); } 116 | toastr.options.onHidden = function() { console.log('goodbye'); } 117 | 118 | ### Animation Options 119 | 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. 120 | 121 | ####Easings 122 | Optionally override the animation easing to show or hide the toasts. Default is swing. swing and linear are built into jQuery. 123 | 124 | toastr.options.showEasing = 'swing'; 125 | toastr.options.hideEasing = 'linear'; 126 | 127 | Using the jQuery Easing plugin (http://www.gsgd.co.uk/sandbox/jquery/easing/) 128 | 129 | toastr.options.showEasing = 'easeOutBounce'; 130 | toastr.options.hideEasing = 'easeInBack'; 131 | 132 | ####Animation Method 133 | 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. 134 | 135 | toastr.options.showMethod = 'slideDown'; 136 | toastr.options.hideMethod = 'slideUp'; 137 | 138 | 139 | ###Timeouts 140 | Control how toastr interacts with users by setting timeouts appropriately. 141 | 142 | toastr.options.timeout = 30; // How long the toast will display without user interaction 143 | toastr.options.extendedTimeOut = 60; // How long the toast will display after a user hovers over it 144 | 145 | ## Breaking Changes 146 | 147 | ###Animation Changes 148 | The following animations options have been deprecated and should be replaced: 149 | 150 | - Replace `options.fadeIn` with `options.showDuration` 151 | - Replace `options.onFadeIn` with `options.onShown` 152 | - Replace `options.fadeOut` with `options.hideDuration` 153 | - Replace `options.onFadeOut` with `options.onHidden` 154 | 155 | # Version 1.3.1 156 | 157 | ## Display Sequence 158 | Show newest toast at bottom (top is default) 159 | 160 | toastr.options.newestOnTop = false; 161 | -------------------------------------------------------------------------------- /nuget/content/scripts/toastr.min.js.map: -------------------------------------------------------------------------------- 1 | { 2 | "version":3, 3 | "file":"toastr.min.js", 4 | "lineCount":1, 5 | "mappings":"CAWG,QAAS,CAACA,CAAD,CAAS,CACpBA,CAAM,CAAC,CAAC,QAAD,CAAU,CAAE,QAAS,CAACC,CAAD,CAAI,CAC/B,OAAQ,QAAS,CAAA,CAAG,CA2BnBC,SAASA,CAAK,CAACC,CAAO,CAAEC,CAAK,CAAEC,CAAjB,CAAkC,CAC/C,OAAOC,CAAM,CAAC,CACb,IAAI,CAAEC,CAASL,MAAM,CACrB,SAAS,CAAEM,CAAU,CAAA,CAAEC,YAAYP,MAAM,CACzC,OAAO,CAAEC,CAAO,CAChB,eAAe,CAAEE,CAAe,CAChC,KAAK,CAAED,CALM,CAAD,CADkC,CAUhDM,SAASA,CAAI,CAACP,CAAO,CAAEC,CAAK,CAAEC,CAAjB,CAAkC,CAC9C,OAAOC,CAAM,CAAC,CACb,IAAI,CAAEC,CAASG,KAAK,CACpB,SAAS,CAAEF,CAAU,CAAA,CAAEC,YAAYC,KAAK,CACxC,OAAO,CAAEP,CAAO,CAChB,eAAe,CAAEE,CAAe,CAChC,KAAK,CAAED,CALM,CAAD,CADiC,CAU/CO,SAASA,CAAS,CAACC,CAAD,CAAW,CAC5BC,CAAS,CAAED,CADiB,CAI7BE,SAASA,CAAO,CAACX,CAAO,CAAEC,CAAK,CAAEC,CAAjB,CAAkC,CACjD,OAAOC,CAAM,CAAC,CACb,IAAI,CAAEC,CAASO,QAAQ,CACvB,SAAS,CAAEN,CAAU,CAAA,CAAEC,YAAYK,QAAQ,CAC3C,OAAO,CAAEX,CAAO,CAChB,eAAe,CAAEE,CAAe,CAChC,KAAK,CAAED,CALM,CAAD,CADoC,CAUlDW,SAASA,CAAO,CAACZ,CAAO,CAAEC,CAAK,CAAEC,CAAjB,CAAkC,CACjD,OAAOC,CAAM,CAAC,CACb,IAAI,CAAEC,CAASQ,QAAQ,CACvB,SAAS,CAAEP,CAAU,CAAA,CAAEC,YAAYM,QAAQ,CAC3C,OAAO,CAAEZ,CAAO,CAChB,eAAe,CAAEE,CAAe,CAChC,KAAK,CAAED,CALM,CAAD,CADoC,CAUlDY,SAASA,CAAK,CAACC,CAAD,CAAgB,CAC7B,IAAIC,EAAUV,CAAU,CAAA,CAAE,CAE1B,GADKW,C,EAAcC,CAAY,CAACF,CAAD,CAAS,CACpCD,CAAc,EAAGhB,CAAC,CAAC,QAAQ,CAAEgB,CAAX,CAAyBI,OAAQ,GAAI,EAAG,CAC7DJ,CAAc,CAAAC,CAAOI,WAAP,CAAmB,CAAC,CACjC,QAAQ,CAAEJ,CAAOK,aAAa,CAC9B,MAAM,CAAEL,CAAOM,WAAW,CAC1B,QAAQ,CAAEC,QAAS,CAAA,CAAG,CAAEC,CAAW,CAACT,CAAD,CAAb,CAHW,CAAD,CAI/B,CACF,MAN6D,CAQ1DE,CAAUQ,SAAS,CAAA,CAAEN,O,EACxBF,CAAW,CAAAD,CAAOI,WAAP,CAAmB,CAAC,CAC9B,QAAQ,CAAEJ,CAAOK,aAAa,CAC9B,MAAM,CAAEL,CAAOM,WAAW,CAC1B,QAAQ,CAAEC,QAAS,CAAA,CAAG,CAAEN,CAAUS,OAAO,CAAA,CAAnB,CAHQ,CAAD,CAZF,CAuB9BC,SAASA,CAAW,CAAA,CAAG,CACtB,MAAO,CACN,YAAY,CAAE,CAAA,CAAI,CAClB,UAAU,CAAE,OAAO,CACnB,WAAW,CAAE,iBAAiB,CAC9B,KAAK,CAAE,CAAA,CAAK,CAEZ,UAAU,CAAE,QAAQ,CACpB,YAAY,CAAE,GAAG,CACjB,UAAU,CAAE,OAAO,CACnB,OAAO,CAAEC,SAAS,CAClB,UAAU,CAAE,SAAS,CACrB,YAAY,CAAE,GAAI,CAClB,UAAU,CAAE,OAAO,CACnB,QAAQ,CAAEA,SAAS,CAEnB,eAAe,CAAE,GAAI,CACrB,WAAW,CAAE,CACZ,KAAK,CAAE,aAAa,CACpB,IAAI,CAAE,YAAY,CAClB,OAAO,CAAE,eAAe,CACxB,OAAO,CAAE,eAJG,CAKZ,CACD,SAAS,CAAE,YAAY,CACvB,aAAa,CAAE,iBAAiB,CAChC,OAAO,CAAE,GAAI,CACb,UAAU,CAAE,aAAa,CACzB,YAAY,CAAE,eAAe,CAC7B,MAAM,CAAE,MAAM,CACd,SAAS,CAAE,2BAA0B,CACrC,WAAW,CAAE,CAAA,CA7BP,CADe,CAkCvBC,SAASA,CAAO,CAACC,CAAD,CAAO,CACjBnB,C,EAGLA,CAAQ,CAACmB,CAAD,CAJc,CAOvB1B,SAASA,CAAM,CAAC2B,CAAD,CAAM,CAuFpBC,SAASA,CAAS,CAACC,CAAD,CAAW,C,GACxB,CAAAlC,CAAC,CAAC,QAAQ,CAAEgB,CAAX,CAAyBI,OAAQ,EAAIc,E,OAGnClB,CAAc,CAAAC,CAAOI,WAAP,CAAmB,CAAC,CACxC,QAAQ,CAAEJ,CAAOK,aAAa,CAC9B,MAAM,CAAEL,CAAOM,WAAW,CAC1B,QAAQ,CAAEC,QAAS,CAAA,CAAG,CACrBC,CAAW,CAACT,CAAD,CAAe,CACtBC,CAAOkB,S,EACVlB,CAAOkB,SAAS,CAAA,CAAE,CAEnBC,CAAQC,MAAO,CAAE,QAAQ,CACzBD,CAAQE,QAAS,CAAE,IAAIC,I,CACvBT,CAAO,CAACM,CAAD,CAPc,CAHkB,CAAD,CAJZ,CAmB7BI,SAASA,CAAgB,CAAA,CAAG,EACvBvB,CAAOwB,QAAS,CAAE,CAAE,EAAGxB,CAAOyB,gBAAiB,CAAE,E,GACpDC,CAAW,CAAEC,UAAU,CAACX,CAAS,CAAEhB,CAAOyB,gBAAnB,EAFG,CAM5BG,SAASA,CAAW,CAAA,CAAG,CACtBC,YAAY,CAACH,CAAD,CAAY,CACxB3B,CAAa+B,KAAK,CAAC,CAAA,CAAD,CAAO,CAAA,CAAP,CAAa,CAAA9B,CAAO+B,WAAP,CAAmB,CACjD,CAAE,QAAQ,CAAE/B,CAAOgC,aAAa,CAAE,MAAM,CAAEhC,CAAOiC,WAAjD,CADiD,CAF5B,CA/GvB,IACCjC,EAAUV,CAAU,CAAA,EACpB4C,EAAYnB,CAAGmB,UAAW,EAAGlC,CAAOkC,UAAU,CAE3C,OAAQnB,CAAG5B,gBAAkB,EAAI,W,GACpCa,CAAQ,CAAEjB,CAACoD,OAAO,CAACnC,CAAO,CAAEe,CAAG5B,gBAAb,CAA8B,CAChD+C,CAAU,CAAEnB,CAAG5B,gBAAgB+C,UAAW,EAAGA,EAAS,CAGvDE,CAAO,EAAE,CAETnC,CAAW,CAAEC,CAAY,CAACF,CAAD,CAAS,CAClC,IACC0B,EAAa,KACb3B,EAAgBhB,CAAC,CAAC,QAAD,EACjBsD,EAAgBtD,CAAC,CAAC,QAAD,EACjBuD,EAAkBvD,CAAC,CAAC,QAAD,EACnBwD,EAAgBxD,CAAC,CAACiB,CAAOwC,UAAR,EACjBrB,EAAW,CACV,OAAO,CAAEiB,CAAO,CAChB,KAAK,CAAE,SAAS,CAChB,SAAS,CAAE,IAAId,IAAM,CACrB,OAAO,CAAEtB,CAAO,CAChB,GAAG,CAAEe,CALK,CAMV,CA4DF,OA1DIA,CAAGmB,U,EACNnC,CAAa0C,SAAS,CAACzC,CAAO0C,WAAR,CAAoBD,SAAS,CAACP,CAAD,CAAW,CAG3DnB,CAAG7B,M,GACNmD,CAAaM,OAAO,CAAC5B,CAAG7B,MAAJ,CAAWuD,SAAS,CAACzC,CAAO4C,WAAR,CAAoB,CAC5D7C,CAAa4C,OAAO,CAACN,CAAD,EAAe,CAGhCtB,CAAG9B,Q,GACNqD,CAAeK,OAAO,CAAC5B,CAAG9B,QAAJ,CAAawD,SAAS,CAACzC,CAAO6C,aAAR,CAAsB,CAClE9C,CAAa4C,OAAO,CAACL,CAAD,EAAiB,CAGlCtC,CAAO8C,Y,GACVP,CAAaE,SAAS,CAAC,oBAAD,CAAsB,CAC5C1C,CAAagD,QAAQ,CAACR,CAAD,EAAe,CAGrCxC,CAAaiD,KAAK,CAAA,CAAE,CAChBhD,CAAOiD,YAAX,CACChD,CAAU8C,QAAQ,CAAChD,CAAD,CADnB,CAGCE,CAAU0C,OAAO,CAAC5C,CAAD,C,CAIlBA,CAAc,CAAAC,CAAO+B,WAAP,CAAmB,CAChC,CAAE,QAAQ,CAAE/B,CAAOgC,aAAa,CAAE,MAAM,CAAEhC,CAAOiC,WAAW,CAAE,QAAQ,CAAEjC,CAAOkD,QAA/E,CADgC,CAEhC,CACGlD,CAAOwB,QAAS,CAAE,C,GACrBE,CAAW,CAAEC,UAAU,CAACX,CAAS,CAAEhB,CAAOwB,QAAnB,EAA4B,CAGpDzB,CAAaoD,MAAM,CAACvB,CAAW,CAAEL,CAAd,CAA+B,CAC9C,CAACvB,CAAOoD,QAAS,EAAGpD,CAAOqD,a,EAC9BtD,CAAauD,MAAM,CAACtC,CAAD,CAAW,CAE3BhB,CAAO8C,YAAa,EAAGP,C,EAC1BA,CAAae,MAAM,CAAC,QAAS,CAACC,CAAD,CAAQ,CACpCA,CAAKC,gBAAgB,CAAA,CAAE,CACvBxC,CAAS,CAAC,CAAA,CAAD,CAF2B,CAAlB,CAGjB,CAGChB,CAAOoD,Q,EACVrD,CAAauD,MAAM,CAAC,QAAS,CAAA,CAAG,CAC/BtD,CAAOoD,QAAQ,CAAA,CAAE,CACjBpC,CAAS,CAAA,CAFsB,CAAb,CAGjB,CAGHH,CAAO,CAACM,CAAD,CAAU,CAEbnB,CAAOyD,MAAO,EAAGC,O,EACpBA,OAAOC,IAAI,CAACxC,CAAD,CAAU,CAGfpB,CArFa,CAuHrBG,SAASA,CAAY,CAACF,CAAD,CAAU,CAU9B,OATKA,C,GAAWA,CAAQ,CAAEV,CAAU,CAAA,EAAE,CACtCW,CAAW,CAAElB,CAAC,CAAC,GAAI,CAAEiB,CAAO4D,YAAd,CAA2B,CACrC3D,CAAUE,Q,CACNF,C,EAERA,CAAW,CAAElB,CAAC,CAAC,QAAD,CACb8E,KAAK,CAAC,IAAI,CAAE7D,CAAO4D,YAAd,CACLnB,SAAS,CAACzC,CAAO8D,cAAR,CAAuB,CACjC7D,CAAU8D,SAAS,CAAChF,CAAC,CAACiB,CAAOgE,OAAR,CAAF,CAAmB,CAC/B/D,EAVuB,CAa/BX,SAASA,CAAU,CAAA,CAAG,CACrB,OAAOP,CAACoD,OAAO,CAAC,CAAA,CAAE,CAAExB,CAAW,CAAA,CAAE,CAAEsD,CAAMjE,QAA1B,CADM,CAItBQ,SAASA,CAAW,CAACT,CAAD,CAAgB,EAC9BE,C,GAAcA,CAAW,CAAEC,CAAY,CAAA,EAAE,CAC1CH,CAAamE,GAAG,CAAC,UAAD,E,GAGpBnE,CAAaW,OAAO,CAAA,CAAE,CACtBX,CAAc,CAAE,IAAI,CAChBE,CAAUQ,SAAS,CAAA,CAAEN,OAAQ,GAAI,C,EACpCF,CAAUS,OAAO,CAAA,EARiB,CA9QpC,IACIT,EACAN,EACAyC,EAAU,EACV/C,EAAY,CACf,KAAK,CAAE,OAAO,CACd,IAAI,CAAE,MAAM,CACZ,OAAO,CAAE,SAAS,CAClB,OAAO,CAAE,SAJM,EAOZ4E,EAAS,CACZ,KAAK,CAAEnE,CAAK,CACZ,KAAK,CAAEd,CAAK,CACZ,YAAY,CAAEkB,CAAY,CAC1B,IAAI,CAAEV,CAAI,CACV,OAAO,CAAE,CAAA,CAAE,CACX,SAAS,CAAEC,CAAS,CACpB,OAAO,CAAEG,CAAO,CAChB,OAAO,CAnBM,OAmBG,CAChB,OAAO,CAAEC,CATG,CAXQ,CAuBrB,OAAOoE,CAxBY,CA4RlB,CAAA,CA7R6B,CAA1B,CADc,EAgSpB,CAAC,OAAOnF,MAAO,EAAI,UAAW,EAAGA,MAAMqF,IAAK,CAAErF,MAAO,CAAE,QAAS,CAACsF,CAAI,CAAEC,CAAP,CAAgB,CAC5E,OAAOC,MAAO,EAAI,WAAY,EAAGA,MAAMC,QAA3C,CACCD,MAAMC,QAAS,CAAEF,CAAO,CAACG,OAAO,CAACJ,CAAK,CAAA,CAAA,CAAN,CAAR,CADzB,CAGCK,MAAOR,OAAU,CAAEI,CAAO,CAACI,MAAOC,OAAR,CAJqD,CAAhF,C", 6 | "sources":["toastr.js"], 7 | "names":["define","$","error","message","title","optionsOverride","notify","toastType","getOptions","iconClasses","info","subscribe","callback","listener","success","warning","clear","$toastElement","options","$container","getContainer","length","hideMethod","hideDuration","hideEasing","complete","removeToast","children","remove","getDefaults","undefined","publish","args","map","hideToast","override","onHidden","response","state","endTime","Date","delayedhideToast","timeOut","extendedTimeOut","intervalId","setTimeout","stickAround","clearTimeout","stop","showMethod","showDuration","showEasing","iconClass","extend","toastId","$titleElement","$messageElement","$closeElement","closeHtml","addClass","toastClass","append","titleClass","messageClass","closeButton","prepend","hide","newestOnTop","onShown","hover","onclick","tapToDismiss","click","event","stopPropagation","debug","console","log","containerId","attr","positionClass","appendTo","target","toastr","is","amd","deps","factory","module","exports","require","window","jQuery"] 8 | } 9 | -------------------------------------------------------------------------------- /nuget/content/content/toastr.less: -------------------------------------------------------------------------------- 1 | // Mix-ins 2 | .borderRadius(@radius) { 3 | -moz-border-radius: @radius; 4 | -webkit-border-radius: @radius; 5 | border-radius: @radius; 6 | } 7 | 8 | .boxShadow(@boxShadow) { 9 | -moz-box-shadow: @boxShadow; 10 | -webkit-box-shadow: @boxShadow; 11 | box-shadow: @boxShadow; 12 | } 13 | 14 | .opacity(@opacity) { 15 | @opacityPercent: @opacity * 100; 16 | opacity: @opacity; 17 | -ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(Opacity=@{opacityPercent})"; 18 | filter: ~"alpha(opacity=@{opacityPercent})"; 19 | } 20 | 21 | .wordWrap(@wordWrap: break-word) { 22 | -ms-word-wrap: @wordWrap; 23 | word-wrap: @wordWrap; 24 | } 25 | 26 | // Variables 27 | @black: #000000; 28 | @grey: #999999; 29 | @light-grey: #CCCCCC; 30 | @white: #FFFFFF; 31 | @near-black: #030303; 32 | @green: #51A351; 33 | @red: #BD362F; 34 | @blue: #2F96B4; 35 | @orange: #F89406; 36 | 37 | // Styles 38 | .toast-title { 39 | font-weight: bold; 40 | } 41 | 42 | .toast-message { 43 | .wordWrap(); 44 | 45 | a, 46 | label { 47 | color: @white; 48 | } 49 | 50 | a:hover { 51 | color: @light-grey; 52 | text-decoration: none; 53 | } 54 | } 55 | 56 | .toast-close-button { 57 | position: relative; 58 | right: -0.3em; 59 | top: -0.3em; 60 | float: right; 61 | font-size: 20px; 62 | font-weight: bold; 63 | color: @white; 64 | -webkit-text-shadow: 0 1px 0 rgba(255,255,255,1); 65 | text-shadow: 0 1px 0 rgba(255,255,255,1); 66 | .opacity(0.8); 67 | 68 | &:hover, 69 | &:focus { 70 | color: @black; 71 | text-decoration: none; 72 | cursor: pointer; 73 | .opacity(0.4); 74 | } 75 | } 76 | 77 | /*Additional properties for button version 78 | iOS requires the button element instead of an anchor tag. 79 | If you want the anchor version, it requires `href="#"`.*/ 80 | button.toast-close-button { 81 | padding: 0; 82 | cursor: pointer; 83 | background: transparent; 84 | border: 0; 85 | -webkit-appearance: none; 86 | } 87 | 88 | //#endregion 89 | 90 | .toast-top-full-width { 91 | top: 0; 92 | right: 0; 93 | width: 100%; 94 | } 95 | 96 | .toast-bottom-full-width { 97 | bottom: 0; 98 | right: 0; 99 | width: 100%; 100 | } 101 | 102 | .toast-top-left { 103 | top: 12px; 104 | left: 12px; 105 | } 106 | 107 | .toast-top-right { 108 | top: 12px; 109 | right: 12px; 110 | } 111 | 112 | .toast-bottom-right { 113 | right: 12px; 114 | bottom: 12px; 115 | } 116 | 117 | .toast-bottom-left { 118 | bottom: 12px; 119 | left: 12px; 120 | } 121 | 122 | #toast-container { 123 | position: fixed; 124 | z-index: 999999; 125 | 126 | * { 127 | -moz-box-sizing: border-box; 128 | -webkit-box-sizing: border-box; 129 | box-sizing: border-box; 130 | } 131 | 132 | > div { 133 | margin: 0 0 6px; 134 | padding: 15px 15px 15px 50px; 135 | width: 300px; 136 | .borderRadius(3px 3px 3px 3px); 137 | background-position: 15px center; 138 | background-repeat: no-repeat; 139 | .boxShadow(0 0 12px @grey); 140 | color: @white; 141 | .opacity(0.8); 142 | } 143 | 144 | > :hover { 145 | .boxShadow(0 0 12px @black); 146 | .opacity(1); 147 | cursor: pointer; 148 | } 149 | 150 | > .toast-info { 151 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=") !important; 152 | } 153 | 154 | > .toast-error { 155 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=") !important; 156 | } 157 | 158 | > .toast-success { 159 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==") !important; 160 | } 161 | 162 | > .toast-warning { 163 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=") !important; 164 | } 165 | 166 | /*overrides*/ 167 | &.toast-top-full-width > div, 168 | &.toast-bottom-full-width > div { 169 | width: 96%; 170 | margin: auto; 171 | } 172 | } 173 | 174 | .toast { 175 | background-color: @near-black; 176 | } 177 | 178 | .toast-success { 179 | background-color: @green; 180 | } 181 | 182 | .toast-error { 183 | background-color: @red; 184 | } 185 | 186 | .toast-info { 187 | background-color: @blue; 188 | } 189 | 190 | .toast-warning { 191 | background-color: @orange; 192 | } 193 | 194 | /*Responsive Design*/ 195 | 196 | @media all and (max-width: 240px) { 197 | #toast-container { 198 | 199 | > div { 200 | padding: 8px 8px 8px 50px; 201 | width: 11em; 202 | } 203 | 204 | & .toast-close-button { 205 | right: -0.2em; 206 | top: -0.2em; 207 | } 208 | } 209 | } 210 | 211 | @media all and (min-width: 241px) and (max-width: 480px) { 212 | #toast-container { 213 | > div { 214 | padding: 8px 8px 8px 50px; 215 | width: 18em; 216 | } 217 | 218 | & .toast-close-button { 219 | right: -0.2em; 220 | top: -0.2em; 221 | } 222 | } 223 | } 224 | 225 | @media all and (min-width: 481px) and (max-width: 768px) { 226 | #toast-container { 227 | > div { 228 | padding: 15px 15px 15px 50px; 229 | width: 25em; 230 | } 231 | } 232 | } -------------------------------------------------------------------------------- /nuget/content/content/toastr.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Toastr 3 | * Copyright 2012-2014 John Papa and Hans Fjällemark. 4 | * All Rights Reserved. 5 | * Use, reproduction, distribution, and modification of this code is subject to the terms and 6 | * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php 7 | * 8 | * Author: John Papa and Hans Fjällemark 9 | * Project: https://github.com/CodeSeven/toastr 10 | */ 11 | .toast-title { 12 | font-weight: bold; 13 | } 14 | .toast-message { 15 | -ms-word-wrap: break-word; 16 | word-wrap: break-word; 17 | } 18 | .toast-message a, 19 | .toast-message label { 20 | color: #ffffff; 21 | } 22 | .toast-message a:hover { 23 | color: #cccccc; 24 | text-decoration: none; 25 | } 26 | .toast-close-button { 27 | position: relative; 28 | right: -0.3em; 29 | top: -0.3em; 30 | float: right; 31 | font-size: 20px; 32 | font-weight: bold; 33 | color: #ffffff; 34 | -webkit-text-shadow: 0 1px 0 #ffffff; 35 | text-shadow: 0 1px 0 #ffffff; 36 | opacity: 0.8; 37 | -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); 38 | filter: alpha(opacity=80); 39 | } 40 | .toast-close-button:hover, 41 | .toast-close-button:focus { 42 | color: #000000; 43 | text-decoration: none; 44 | cursor: pointer; 45 | opacity: 0.4; 46 | -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40); 47 | filter: alpha(opacity=40); 48 | } 49 | /*Additional properties for button version 50 | iOS requires the button element instead of an anchor tag. 51 | If you want the anchor version, it requires `href="#"`.*/ 52 | button.toast-close-button { 53 | padding: 0; 54 | cursor: pointer; 55 | background: transparent; 56 | border: 0; 57 | -webkit-appearance: none; 58 | } 59 | .toast-top-full-width { 60 | top: 0; 61 | right: 0; 62 | width: 100%; 63 | } 64 | .toast-bottom-full-width { 65 | bottom: 0; 66 | right: 0; 67 | width: 100%; 68 | } 69 | .toast-top-left { 70 | top: 12px; 71 | left: 12px; 72 | } 73 | .toast-top-right { 74 | top: 12px; 75 | right: 12px; 76 | } 77 | .toast-bottom-right { 78 | right: 12px; 79 | bottom: 12px; 80 | } 81 | .toast-bottom-left { 82 | bottom: 12px; 83 | left: 12px; 84 | } 85 | #toast-container { 86 | position: fixed; 87 | z-index: 999999; 88 | /*overrides*/ 89 | 90 | } 91 | #toast-container * { 92 | -moz-box-sizing: border-box; 93 | -webkit-box-sizing: border-box; 94 | box-sizing: border-box; 95 | } 96 | #toast-container > div { 97 | margin: 0 0 6px; 98 | padding: 15px 15px 15px 50px; 99 | width: 300px; 100 | -moz-border-radius: 3px 3px 3px 3px; 101 | -webkit-border-radius: 3px 3px 3px 3px; 102 | border-radius: 3px 3px 3px 3px; 103 | background-position: 15px center; 104 | background-repeat: no-repeat; 105 | -moz-box-shadow: 0 0 12px #999999; 106 | -webkit-box-shadow: 0 0 12px #999999; 107 | box-shadow: 0 0 12px #999999; 108 | color: #ffffff; 109 | opacity: 0.8; 110 | -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); 111 | filter: alpha(opacity=80); 112 | } 113 | #toast-container > :hover { 114 | -moz-box-shadow: 0 0 12px #000000; 115 | -webkit-box-shadow: 0 0 12px #000000; 116 | box-shadow: 0 0 12px #000000; 117 | opacity: 1; 118 | -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); 119 | filter: alpha(opacity=100); 120 | cursor: pointer; 121 | } 122 | #toast-container > .toast-info { 123 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=") !important; 124 | } 125 | #toast-container > .toast-error { 126 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=") !important; 127 | } 128 | #toast-container > .toast-success { 129 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==") !important; 130 | } 131 | #toast-container > .toast-warning { 132 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=") !important; 133 | } 134 | #toast-container.toast-top-full-width > div, 135 | #toast-container.toast-bottom-full-width > div { 136 | width: 96%; 137 | margin: auto; 138 | } 139 | .toast { 140 | background-color: #030303; 141 | } 142 | .toast-success { 143 | background-color: #51a351; 144 | } 145 | .toast-error { 146 | background-color: #bd362f; 147 | } 148 | .toast-info { 149 | background-color: #2f96b4; 150 | } 151 | .toast-warning { 152 | background-color: #f89406; 153 | } 154 | /*Responsive Design*/ 155 | @media all and (max-width: 240px) { 156 | #toast-container > div { 157 | padding: 8px 8px 8px 50px; 158 | width: 11em; 159 | } 160 | #toast-container .toast-close-button { 161 | right: -0.2em; 162 | top: -0.2em; 163 | } 164 | } 165 | @media all and (min-width: 241px) and (max-width: 480px) { 166 | #toast-container > div { 167 | padding: 8px 8px 8px 50px; 168 | width: 18em; 169 | } 170 | #toast-container .toast-close-button { 171 | right: -0.2em; 172 | top: -0.2em; 173 | } 174 | } 175 | @media all and (min-width: 481px) and (max-width: 768px) { 176 | #toast-container > div { 177 | padding: 15px 15px 15px 50px; 178 | width: 25em; 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /nuget/content/content/toastr.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Toastr 3 | * Version 2.0.1 4 | * Copyright 2012 John Papa and Hans Fjällemark. 5 | * All Rights Reserved. 6 | * Use, reproduction, distribution, and modification of this code is subject to the terms and 7 | * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php 8 | * 9 | * Author: John Papa and Hans Fjällemark 10 | * Project: https://github.com/CodeSeven/toastr 11 | */ 12 | .toast-title { 13 | font-weight: bold; 14 | } 15 | .toast-message { 16 | -ms-word-wrap: break-word; 17 | word-wrap: break-word; 18 | } 19 | .toast-message a, 20 | .toast-message label { 21 | color: #ffffff; 22 | } 23 | .toast-message a:hover { 24 | color: #cccccc; 25 | text-decoration: none; 26 | } 27 | 28 | .toast-close-button { 29 | position: relative; 30 | right: -0.3em; 31 | top: -0.3em; 32 | float: right; 33 | font-size: 20px; 34 | font-weight: bold; 35 | color: #ffffff; 36 | -webkit-text-shadow: 0 1px 0 #ffffff; 37 | text-shadow: 0 1px 0 #ffffff; 38 | opacity: 0.8; 39 | -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); 40 | filter: alpha(opacity=80); 41 | } 42 | .toast-close-button:hover, 43 | .toast-close-button:focus { 44 | color: #000000; 45 | text-decoration: none; 46 | cursor: pointer; 47 | opacity: 0.4; 48 | -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40); 49 | filter: alpha(opacity=40); 50 | } 51 | 52 | /*Additional properties for button version 53 | iOS requires the button element instead of an anchor tag. 54 | If you want the anchor version, it requires `href="#"`.*/ 55 | button.toast-close-button { 56 | padding: 0; 57 | cursor: pointer; 58 | background: transparent; 59 | border: 0; 60 | -webkit-appearance: none; 61 | } 62 | .toast-top-full-width { 63 | top: 0; 64 | right: 0; 65 | width: 100%; 66 | } 67 | .toast-bottom-full-width { 68 | bottom: 0; 69 | right: 0; 70 | width: 100%; 71 | } 72 | .toast-top-left { 73 | top: 12px; 74 | left: 12px; 75 | } 76 | .toast-top-right { 77 | top: 12px; 78 | right: 12px; 79 | } 80 | .toast-bottom-right { 81 | right: 12px; 82 | bottom: 12px; 83 | } 84 | .toast-bottom-left { 85 | bottom: 12px; 86 | left: 12px; 87 | } 88 | #toast-container { 89 | position: fixed; 90 | z-index: 999999; 91 | /*overrides*/ 92 | 93 | } 94 | #toast-container * { 95 | -moz-box-sizing: border-box; 96 | -webkit-box-sizing: border-box; 97 | box-sizing: border-box; 98 | } 99 | #toast-container > div { 100 | margin: 0 0 6px; 101 | padding: 15px 15px 15px 50px; 102 | width: 300px; 103 | -moz-border-radius: 3px 3px 3px 3px; 104 | -webkit-border-radius: 3px 3px 3px 3px; 105 | border-radius: 3px 3px 3px 3px; 106 | background-position: 15px center; 107 | background-repeat: no-repeat; 108 | -moz-box-shadow: 0 0 12px #999999; 109 | -webkit-box-shadow: 0 0 12px #999999; 110 | box-shadow: 0 0 12px #999999; 111 | color: #ffffff; 112 | opacity: 0.8; 113 | -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); 114 | filter: alpha(opacity=80); 115 | } 116 | #toast-container > :hover { 117 | -moz-box-shadow: 0 0 12px #000000; 118 | -webkit-box-shadow: 0 0 12px #000000; 119 | box-shadow: 0 0 12px #000000; 120 | opacity: 1; 121 | -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); 122 | filter: alpha(opacity=100); 123 | cursor: pointer; 124 | } 125 | #toast-container > .toast-info { 126 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=") !important; 127 | } 128 | #toast-container > .toast-error { 129 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=") !important; 130 | } 131 | #toast-container > .toast-success { 132 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==") !important; 133 | } 134 | #toast-container > .toast-warning { 135 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=") !important; 136 | } 137 | #toast-container.toast-top-full-width > div, 138 | #toast-container.toast-bottom-full-width > div { 139 | width: 96%; 140 | margin: auto; 141 | } 142 | .toast { 143 | background-color: #030303; 144 | } 145 | .toast-success { 146 | background-color: #51a351; 147 | } 148 | .toast-error { 149 | background-color: #bd362f; 150 | } 151 | .toast-info { 152 | background-color: #2f96b4; 153 | } 154 | .toast-warning { 155 | background-color: #f89406; 156 | } 157 | /*Responsive Design*/ 158 | @media all and (max-width: 239px) { 159 | #toast-container > div { 160 | padding: 8px 8px 8px 50px; 161 | width: 11em; 162 | } 163 | #toast-container .toast-close-button { 164 | right: -0.2em; 165 | top: -0.2em; 166 | } 167 | } 168 | @media all and (min-width: 240px) and (max-width: 479px) { 169 | #toast-container > div { 170 | padding: 8px 8px 8px 50px; 171 | width: 18em; 172 | } 173 | #toast-container .toast-close-button { 174 | right: -0.2em; 175 | top: -0.2em; 176 | } 177 | } 178 | @media all and (min-width: 480px) and (max-width: 767px) { 179 | #toast-container > div { 180 | padding: 15px 15px 15px 50px; 181 | width: 25em; 182 | } 183 | } -------------------------------------------------------------------------------- /toastr.scss: -------------------------------------------------------------------------------- 1 | .toast-title { 2 | font-weight: bold; 3 | } 4 | .toast-message { 5 | -ms-word-wrap: break-word; 6 | word-wrap: break-word; 7 | } 8 | .toast-message a, 9 | .toast-message label { 10 | color: #ffffff; 11 | } 12 | .toast-message a:hover { 13 | color: #cccccc; 14 | text-decoration: none; 15 | } 16 | .toast-close-button { 17 | position: relative; 18 | right: -0.3em; 19 | top: -0.3em; 20 | float: right; 21 | font-size: 20px; 22 | font-weight: bold; 23 | color: #ffffff; 24 | -webkit-text-shadow: 0 1px 0 #ffffff; 25 | text-shadow: 0 1px 0 #ffffff; 26 | opacity: 0.8; 27 | -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); 28 | filter: alpha(opacity=80); 29 | } 30 | .toast-close-button:hover, 31 | .toast-close-button:focus { 32 | color: #000000; 33 | text-decoration: none; 34 | cursor: pointer; 35 | opacity: 0.4; 36 | -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40); 37 | filter: alpha(opacity=40); 38 | } 39 | /*Additional properties for button version 40 | iOS requires the button element instead of an anchor tag. 41 | If you want the anchor version, it requires `href="#"`.*/ 42 | button.toast-close-button { 43 | padding: 0; 44 | cursor: pointer; 45 | background: transparent; 46 | border: 0; 47 | -webkit-appearance: none; 48 | } 49 | .toast-top-center { 50 | top: 0; 51 | right: 0; 52 | width: 100%; 53 | } 54 | .toast-bottom-center { 55 | bottom: 0; 56 | right: 0; 57 | width: 100%; 58 | } 59 | .toast-top-full-width { 60 | top: 0; 61 | right: 0; 62 | width: 100%; 63 | } 64 | .toast-bottom-full-width { 65 | bottom: 0; 66 | right: 0; 67 | width: 100%; 68 | } 69 | .toast-top-left { 70 | top: 12px; 71 | left: 12px; 72 | } 73 | .toast-top-right { 74 | top: 12px; 75 | right: 12px; 76 | } 77 | .toast-bottom-right { 78 | right: 12px; 79 | bottom: 12px; 80 | } 81 | .toast-bottom-left { 82 | bottom: 12px; 83 | left: 12px; 84 | } 85 | #toast-container { 86 | position: fixed; 87 | z-index: 999999; 88 | /*overrides*/ 89 | 90 | } 91 | #toast-container * { 92 | -moz-box-sizing: border-box; 93 | -webkit-box-sizing: border-box; 94 | box-sizing: border-box; 95 | } 96 | #toast-container > div { 97 | position: relative; 98 | overflow: hidden; 99 | margin: 0 0 6px; 100 | padding: 15px 15px 15px 50px; 101 | width: 300px; 102 | -moz-border-radius: 3px 3px 3px 3px; 103 | -webkit-border-radius: 3px 3px 3px 3px; 104 | border-radius: 3px 3px 3px 3px; 105 | background-position: 15px center; 106 | background-repeat: no-repeat; 107 | -moz-box-shadow: 0 0 12px #999999; 108 | -webkit-box-shadow: 0 0 12px #999999; 109 | box-shadow: 0 0 12px #999999; 110 | color: #ffffff; 111 | opacity: 0.8; 112 | -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); 113 | filter: alpha(opacity=80); 114 | } 115 | #toast-container > div:hover { 116 | -moz-box-shadow: 0 0 12px #000000; 117 | -webkit-box-shadow: 0 0 12px #000000; 118 | box-shadow: 0 0 12px #000000; 119 | opacity: 1; 120 | -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); 121 | filter: alpha(opacity=100); 122 | cursor: pointer; 123 | } 124 | #toast-container > .toast-info { 125 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=") !important; 126 | } 127 | #toast-container > .toast-error { 128 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=") !important; 129 | } 130 | #toast-container > .toast-success { 131 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==") !important; 132 | } 133 | #toast-container > .toast-warning { 134 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=") !important; 135 | } 136 | #toast-container.toast-top-center > div, 137 | #toast-container.toast-bottom-center > div { 138 | width: 300px; 139 | margin-left: auto; 140 | margin-right: auto; 141 | } 142 | #toast-container.toast-top-full-width > div, 143 | #toast-container.toast-bottom-full-width > div { 144 | width: 96%; 145 | margin-left: auto; 146 | margin-right: auto; 147 | } 148 | .toast { 149 | background-color: #030303; 150 | } 151 | .toast-success { 152 | background-color: #51a351; 153 | } 154 | .toast-error { 155 | background-color: #bd362f; 156 | } 157 | .toast-info { 158 | background-color: #2f96b4; 159 | } 160 | .toast-warning { 161 | background-color: #f89406; 162 | } 163 | 164 | .toast-progress { 165 | position: absolute; 166 | left: 0; 167 | bottom: 0; 168 | height: 4px; 169 | background-color: #000000; 170 | opacity: 0.4; 171 | -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40); 172 | filter: alpha(opacity=40); 173 | } 174 | 175 | /*Responsive Design*/ 176 | @media all and (max-width: 240px) { 177 | #toast-container > div { 178 | padding: 8px 8px 8px 50px; 179 | width: 11em; 180 | } 181 | #toast-container .toast-close-button { 182 | right: -0.2em; 183 | top: -0.2em; 184 | } 185 | } 186 | @media all and (min-width: 241px) and (max-width: 480px) { 187 | #toast-container > div { 188 | padding: 8px 8px 8px 50px; 189 | width: 18em; 190 | } 191 | #toast-container .toast-close-button { 192 | right: -0.2em; 193 | top: -0.2em; 194 | } 195 | } 196 | @media all and (min-width: 481px) and (max-width: 768px) { 197 | #toast-container > div { 198 | padding: 15px 15px 15px 50px; 199 | width: 25em; 200 | } 201 | } 202 | -------------------------------------------------------------------------------- /toastr.less: -------------------------------------------------------------------------------- 1 | // Mix-ins 2 | .borderRadius(@radius) { 3 | -moz-border-radius: @radius; 4 | -webkit-border-radius: @radius; 5 | border-radius: @radius; 6 | } 7 | 8 | .boxShadow(@boxShadow) { 9 | -moz-box-shadow: @boxShadow; 10 | -webkit-box-shadow: @boxShadow; 11 | box-shadow: @boxShadow; 12 | } 13 | 14 | .opacity(@opacity) { 15 | @opacityPercent: (@opacity * 100); 16 | opacity: @opacity; 17 | -ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(Opacity=@{opacityPercent})"; 18 | filter: ~"alpha(opacity=@{opacityPercent})"; 19 | } 20 | 21 | .wordWrap(@wordWrap: break-word) { 22 | -ms-word-wrap: @wordWrap; 23 | word-wrap: @wordWrap; 24 | } 25 | 26 | // Variables 27 | @black: #000000; 28 | @grey: #999999; 29 | @light-grey: #CCCCCC; 30 | @white: #FFFFFF; 31 | @near-black: #030303; 32 | @green: #51A351; 33 | @red: #BD362F; 34 | @blue: #2F96B4; 35 | @orange: #F89406; 36 | @default-container-opacity: .8; 37 | 38 | // Styles 39 | .toast-title { 40 | font-weight: bold; 41 | } 42 | 43 | .toast-message { 44 | .wordWrap(); 45 | 46 | a, 47 | label { 48 | color: @white; 49 | } 50 | 51 | a:hover { 52 | color: @light-grey; 53 | text-decoration: none; 54 | } 55 | } 56 | 57 | .toast-close-button { 58 | position: relative; 59 | right: -0.3em; 60 | top: -0.3em; 61 | float: right; 62 | font-size: 20px; 63 | font-weight: bold; 64 | color: @white; 65 | -webkit-text-shadow: 0 1px 0 rgba(255,255,255,1); 66 | text-shadow: 0 1px 0 rgba(255,255,255,1); 67 | .opacity(0.8); 68 | line-height: 1; 69 | 70 | &:hover, 71 | &:focus { 72 | color: @black; 73 | text-decoration: none; 74 | cursor: pointer; 75 | .opacity(0.4); 76 | } 77 | } 78 | 79 | .rtl .toast-close-button { 80 | left: -0.3em; 81 | float: left; 82 | right: 0.3em; 83 | } 84 | 85 | /*Additional properties for button version 86 | iOS requires the button element instead of an anchor tag. 87 | If you want the anchor version, it requires `href="#"`.*/ 88 | button.toast-close-button { 89 | padding: 0; 90 | cursor: pointer; 91 | background: transparent; 92 | border: 0; 93 | -webkit-appearance: none; 94 | } 95 | 96 | //#endregion 97 | 98 | .toast-top-center { 99 | top: 0; 100 | right: 0; 101 | width: 100%; 102 | } 103 | 104 | .toast-bottom-center { 105 | bottom: 0; 106 | right: 0; 107 | width: 100%; 108 | } 109 | 110 | .toast-top-full-width { 111 | top: 0; 112 | right: 0; 113 | width: 100%; 114 | } 115 | 116 | .toast-bottom-full-width { 117 | bottom: 0; 118 | right: 0; 119 | width: 100%; 120 | } 121 | 122 | .toast-top-left { 123 | top: 12px; 124 | left: 12px; 125 | } 126 | 127 | .toast-top-right { 128 | top: 12px; 129 | right: 12px; 130 | } 131 | 132 | .toast-bottom-right { 133 | right: 12px; 134 | bottom: 12px; 135 | } 136 | 137 | .toast-bottom-left { 138 | bottom: 12px; 139 | left: 12px; 140 | } 141 | 142 | #toast-container { 143 | position: fixed; 144 | z-index: 999999; 145 | // The container should not be clickable. 146 | pointer-events: none; 147 | * { 148 | -moz-box-sizing: border-box; 149 | -webkit-box-sizing: border-box; 150 | box-sizing: border-box; 151 | } 152 | 153 | > div { 154 | position: relative; 155 | // The toast itself should be clickable. 156 | pointer-events: auto; 157 | overflow: hidden; 158 | margin: 0 0 6px; 159 | padding: 15px 15px 15px 50px; 160 | width: 300px; 161 | .borderRadius(3px 3px 3px 3px); 162 | background-position: 15px center; 163 | background-repeat: no-repeat; 164 | .boxShadow(0 0 12px @grey); 165 | color: @white; 166 | .opacity(@default-container-opacity); 167 | } 168 | 169 | > div.rtl { 170 | direction: rtl; 171 | padding: 15px 50px 15px 15px; 172 | background-position: right 15px center; 173 | } 174 | 175 | > div:hover { 176 | .boxShadow(0 0 12px @black); 177 | .opacity(1); 178 | cursor: pointer; 179 | } 180 | 181 | > .toast-info { 182 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=") !important; 183 | } 184 | 185 | > .toast-error { 186 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=") !important; 187 | } 188 | 189 | > .toast-success { 190 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==") !important; 191 | } 192 | 193 | > .toast-warning { 194 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=") !important; 195 | } 196 | 197 | /*overrides*/ 198 | &.toast-top-center > div, 199 | &.toast-bottom-center > div { 200 | width: 300px; 201 | margin-left: auto; 202 | margin-right: auto; 203 | } 204 | 205 | &.toast-top-full-width > div, 206 | &.toast-bottom-full-width > div { 207 | width: 96%; 208 | margin-left: auto; 209 | margin-right: auto; 210 | } 211 | } 212 | 213 | .toast { 214 | background-color: @near-black; 215 | } 216 | 217 | .toast-success { 218 | background-color: @green; 219 | } 220 | 221 | .toast-error { 222 | background-color: @red; 223 | } 224 | 225 | .toast-info { 226 | background-color: @blue; 227 | } 228 | 229 | .toast-warning { 230 | background-color: @orange; 231 | } 232 | 233 | .toast-progress { 234 | position: absolute; 235 | left: 0; 236 | bottom: 0; 237 | height: 4px; 238 | background-color: @black; 239 | .opacity(0.4); 240 | } 241 | 242 | /*Responsive Design*/ 243 | 244 | @media all and (max-width: 240px) { 245 | #toast-container { 246 | 247 | > div { 248 | padding: 8px 8px 8px 50px; 249 | width: 11em; 250 | } 251 | 252 | > div.rtl { 253 | padding: 8px 50px 8px 8px; 254 | } 255 | 256 | & .toast-close-button { 257 | right: -0.2em; 258 | top: -0.2em; 259 | } 260 | 261 | & .rtl .toast-close-button { 262 | left: -0.2em; 263 | right: 0.2em; 264 | } 265 | } 266 | } 267 | 268 | @media all and (min-width: 241px) and (max-width: 480px) { 269 | #toast-container { 270 | > div { 271 | padding: 8px 8px 8px 50px; 272 | width: 18em; 273 | } 274 | 275 | > div.rtl { 276 | padding: 8px 50px 8px 8px; 277 | } 278 | 279 | & .toast-close-button { 280 | right: -0.2em; 281 | top: -0.2em; 282 | } 283 | 284 | & .rtl .toast-close-button { 285 | left: -0.2em; 286 | right: 0.2em; 287 | } 288 | } 289 | } 290 | 291 | @media all and (min-width: 481px) and (max-width: 768px) { 292 | #toast-container { 293 | > div { 294 | padding: 15px 15px 15px 50px; 295 | width: 25em; 296 | } 297 | 298 | > div.rtl { 299 | padding: 15px 50px 15px 15px; 300 | } 301 | } 302 | } 303 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # toastr 2 | **toastr** is a Javascript library for non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended. 3 | 4 | [![Build Status](https://travis-ci.org/CodeSeven/toastr.svg)](https://travis-ci.org/CodeSeven/toastr) 5 | Browser testing provided by BrowserStack. 6 | 7 | ## Current Version 8 | 2.1.4 9 | 10 | ## Demo 11 | - Demo can be found at http://codeseven.github.io/toastr/demo.html 12 | - [Demo using FontAwesome icons with toastr](http://plnkr.co/edit/6W9URNyyp2ItO4aUWzBB?p=preview) 13 | 14 | ## CDNs 15 | [![cdnjs](https://img.shields.io/cdnjs/v/toastr.js.svg)](https://cdnjs.com/libraries/toastr.js) 16 | [![jsdelivr](https://data.jsdelivr.com/v1/package/npm/toastr/badge)](https://www.jsdelivr.com/package/npm/toastr) 17 | 18 | Toastr is hosted at cdnjs and jsdelivr 19 | 20 | #### Debug 21 | - [//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.css](//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.css) 22 | 23 | #### Minified 24 | - [//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js](//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js) 25 | - [//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css](//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css) 26 | 27 | ## Install 28 | 29 | #### [NuGet Gallery](http://nuget.org/packages/toastr) 30 | ``` 31 | Install-Package toastr 32 | ``` 33 | 34 | #### [Bower](http://bower.io/search/?q=toastr) 35 | ``` 36 | bower install toastr 37 | ``` 38 | 39 | #### [npm](https://www.npmjs.com/package/toastr) 40 | ``` 41 | npm install --save toastr 42 | ``` 43 | 44 | #### [yarn](https://yarnpkg.com/en/package/toastr) 45 | ``` 46 | yarn add toastr 47 | ``` 48 | 49 | #### [Ruby on Rails](https://github.com/tylergannon/toastr-rails) 50 | ```ruby 51 | # Gemfile 52 | 53 | gem 'toastr-rails' 54 | ``` 55 | 56 | ```coffee 57 | # application.coffee 58 | 59 | #= require toastr 60 | ``` 61 | 62 | ```scss 63 | // application.scss 64 | 65 | @import "toastr"; 66 | ``` 67 | 68 | 69 | 70 | 71 | ## Wiki and Change Log 72 | [Wiki including Change Log](https://github.com/CodeSeven/toastr/wiki) 73 | 74 | ## Breaking Changes 75 | 76 | #### Animation Changes 77 | The following animations options have been deprecated and should be replaced: 78 | 79 | - Replace `options.fadeIn` with `options.showDuration` 80 | - Replace `options.onFadeIn` with `options.onShown` 81 | - Replace `options.fadeOut` with `options.hideDuration` 82 | - Replace `options.onFadeOut` with `options.onHidden` 83 | 84 | ## Quick Start 85 | 86 | ### 3 Easy Steps 87 | For other API calls, see the [demo](http://codeseven.github.io/toastr/demo.html). 88 | 89 | 1. Link to toastr.css `` 90 | 91 | 2. Link to toastr.js `` 92 | 93 | 3. use toastr to display a toast for info, success, warning or error 94 | ```js 95 | // Display an info toast with no title 96 | toastr.info('Are you the 6 fingered man?') 97 | ``` 98 | 99 | ### Other Options 100 | ```js 101 | // Display a warning toast, with no title 102 | toastr.warning('My name is Inigo Montoya. You killed my father, prepare to die!') 103 | 104 | // Display a success toast, with a title 105 | toastr.success('Have fun storming the castle!', 'Miracle Max Says') 106 | 107 | // Display an error toast, with a title 108 | toastr.error('I do not think that word means what you think it means.', 'Inconceivable!') 109 | 110 | // Immediately remove current toasts without using animation 111 | toastr.remove() 112 | 113 | // Remove current toasts using animation 114 | toastr.clear() 115 | 116 | // Override global options 117 | toastr.success('We do have the Kapua suite available.', 'Turtle Bay Resort', {timeOut: 5000}) 118 | ``` 119 | 120 | ### Escape HTML characters 121 | In case you want to escape HTML characters in title and message 122 | 123 | toastr.options.escapeHtml = true; 124 | 125 | ### Close Button 126 | Optionally enable a close button 127 | ```js 128 | toastr.options.closeButton = true; 129 | ```` 130 | 131 | Optionally override the close button's HTML. 132 | 133 | ```js 134 | toastr.options.closeHtml = ''; 135 | ``` 136 | 137 | You can also override the CSS/LESS for `#toast-container .toast-close-button` 138 | 139 | Optionally override the hide animation when the close button is clicked (falls back to hide configuration). 140 | ```js 141 | toastr.options.closeMethod = 'fadeOut'; 142 | toastr.options.closeDuration = 300; 143 | toastr.options.closeEasing = 'swing'; 144 | ``` 145 | 146 | ### Display Sequence 147 | Show newest toast at bottom (top is default) 148 | ```js 149 | toastr.options.newestOnTop = false; 150 | ``` 151 | 152 | ### Callbacks 153 | ```js 154 | // Define a callback for when the toast is shown/hidden/clicked 155 | toastr.options.onShown = function() { console.log('hello'); } 156 | toastr.options.onHidden = function() { console.log('goodbye'); } 157 | toastr.options.onclick = function() { console.log('clicked'); } 158 | toastr.options.onCloseClick = function() { console.log('close button clicked'); } 159 | ``` 160 | 161 | ### Animation Options 162 | 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. 163 | 164 | #### Easings 165 | Optionally override the animation easing to show or hide the toasts. Default is swing. swing and linear are built into jQuery. 166 | ```js 167 | toastr.options.showEasing = 'swing'; 168 | toastr.options.hideEasing = 'linear'; 169 | toastr.options.closeEasing = 'linear'; 170 | ``` 171 | 172 | Using the jQuery Easing plugin (http://www.gsgd.co.uk/sandbox/jquery/easing/) 173 | ```js 174 | toastr.options.showEasing = 'easeOutBounce'; 175 | toastr.options.hideEasing = 'easeInBack'; 176 | toastr.options.closeEasing = 'easeInBack'; 177 | ``` 178 | 179 | #### Animation Method 180 | 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. 181 | ```js 182 | toastr.options.showMethod = 'slideDown'; 183 | toastr.options.hideMethod = 'slideUp'; 184 | toastr.options.closeMethod = 'slideUp'; 185 | ``` 186 | 187 | ### Prevent Duplicates 188 | Rather than having identical toasts stack, set the preventDuplicates property to true. Duplicates are matched to the previous toast based on their message content. 189 | ```js 190 | toastr.options.preventDuplicates = true; 191 | ``` 192 | 193 | ### Timeouts 194 | Control how toastr interacts with users by setting timeouts appropriately. 195 | ```js 196 | toastr.options.timeOut = 30; // How long the toast will display without user interaction 197 | toastr.options.extendedTimeOut = 60; // How long the toast will display after a user hovers over it 198 | ``` 199 | 200 | ### Prevent from Auto Hiding 201 | To prevent toastr from closing based on the timeouts, set the `timeOut` and `extendedTimeOut` options to `0`. The toastr will persist until selected. 202 | 203 | ```js 204 | toastr.options.timeOut = 0; 205 | toastr.options.extendedTimeOut = 0; 206 | ``` 207 | 208 | ### Progress Bar 209 | Visually indicate how long before a toast expires. 210 | ```js 211 | toastr.options.progressBar = true; 212 | ``` 213 | 214 | ### rtl 215 | Flip the toastr to be displayed properly for right-to-left languages. 216 | ```js 217 | toastr.options.rtl = true; 218 | ``` 219 | 220 | ## Building Toastr 221 | 222 | To build the minified and css versions of Toastr you will need [node](http://nodejs.org) installed. (Use Homebrew or Chocolatey.) 223 | 224 | ``` 225 | npm install -g gulp karma-cli 226 | npm install 227 | ``` 228 | 229 | At this point the dependencies have been installed and you can build Toastr 230 | 231 | - Run the analytics `gulp analyze` 232 | - Run the test `gulp test` 233 | - Run the build `gulp` 234 | 235 | ## Contributing 236 | 237 | For a pull request to be considered it must resolve a bug, or add a feature which is beneficial to a large audience. 238 | 239 | Pull requests must pass existing unit tests, CI processes, and add additional tests to indicate successful operation of a new feature, or the resolution of an identified bug. 240 | 241 | Requests must be made against the `develop` branch. Pull requests submitted against the `master` branch will not be considered. 242 | 243 | All pull requests are subject to approval by the repository owners, who have sole discretion over acceptance or denial. 244 | 245 | ## Authors 246 | **John Papa** 247 | 248 | + [http://twitter.com/John_Papa](http://twitter.com/John_Papa) 249 | 250 | **Tim Ferrell** 251 | 252 | + [http://twitter.com/ferrell_tim](http://twitter.com/ferrell_tim) 253 | 254 | **Hans Fjällemark** 255 | 256 | + [http://twitter.com/hfjallemark](http://twitter.com/hfjallemark) 257 | 258 | ## Credits 259 | Inspired by https://github.com/Srirangan/notifer.js/. 260 | 261 | ## Copyright 262 | Copyright © 2012-2015 263 | 264 | ## License 265 | toastr is under MIT license - http://www.opensource.org/licenses/mit-license.php 266 | -------------------------------------------------------------------------------- /nuget/content/scripts/toastr.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Toastr 3 | * Copyright 2012-2014 John Papa and Hans Fjällemark. 4 | * All Rights Reserved. 5 | * Use, reproduction, distribution, and modification of this code is subject to the terms and 6 | * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php 7 | * 8 | * Author: John Papa and Hans Fjällemark 9 | * ARIA Support: Greta Krafsig 10 | * Project: https://github.com/CodeSeven/toastr 11 | */ 12 | ; (function (define) { 13 | define(['jquery'], function ($) { 14 | return (function () { 15 | var $container; 16 | var listener; 17 | var toastId = 0; 18 | var toastType = { 19 | error: 'error', 20 | info: 'info', 21 | success: 'success', 22 | warning: 'warning' 23 | }; 24 | 25 | var toastr = { 26 | clear: clear, 27 | remove: remove, 28 | error: error, 29 | getContainer: getContainer, 30 | info: info, 31 | options: {}, 32 | subscribe: subscribe, 33 | success: success, 34 | version: '2.0.3', 35 | warning: warning 36 | }; 37 | 38 | return toastr; 39 | 40 | //#region Accessible Methods 41 | function error(message, title, optionsOverride) { 42 | return notify({ 43 | type: toastType.error, 44 | iconClass: getOptions().iconClasses.error, 45 | message: message, 46 | optionsOverride: optionsOverride, 47 | title: title 48 | }); 49 | } 50 | 51 | function getContainer(options, create) { 52 | if (!options) { options = getOptions(); } 53 | $container = $('#' + options.containerId); 54 | if ($container.length) { 55 | return $container; 56 | } 57 | if(create) { 58 | $container = createContainer(options); 59 | } 60 | return $container; 61 | } 62 | 63 | function info(message, title, optionsOverride) { 64 | return notify({ 65 | type: toastType.info, 66 | iconClass: getOptions().iconClasses.info, 67 | message: message, 68 | optionsOverride: optionsOverride, 69 | title: title 70 | }); 71 | } 72 | 73 | function subscribe(callback) { 74 | listener = callback; 75 | } 76 | 77 | function success(message, title, optionsOverride) { 78 | return notify({ 79 | type: toastType.success, 80 | iconClass: getOptions().iconClasses.success, 81 | message: message, 82 | optionsOverride: optionsOverride, 83 | title: title 84 | }); 85 | } 86 | 87 | function warning(message, title, optionsOverride) { 88 | return notify({ 89 | type: toastType.warning, 90 | iconClass: getOptions().iconClasses.warning, 91 | message: message, 92 | optionsOverride: optionsOverride, 93 | title: title 94 | }); 95 | } 96 | 97 | function clear($toastElement) { 98 | var options = getOptions(); 99 | if (!$container) { getContainer(options); } 100 | if (!clearToast($toastElement, options)) { 101 | clearContainer(options); 102 | } 103 | } 104 | 105 | function remove($toastElement) { 106 | var options = getOptions(); 107 | if (!$container) { getContainer(options); } 108 | if ($toastElement && $(':focus', $toastElement).length === 0) { 109 | removeToast($toastElement); 110 | return; 111 | } 112 | if ($container.children().length) { 113 | $container.remove(); 114 | } 115 | } 116 | //#endregion 117 | 118 | //#region Internal Methods 119 | 120 | function clearContainer(options){ 121 | var toastsToClear = $container.children(); 122 | for (var i = toastsToClear.length - 1; i >= 0; i--) { 123 | clearToast($(toastsToClear[i]), options); 124 | }; 125 | } 126 | 127 | function clearToast($toastElement, options){ 128 | if ($toastElement && $(':focus', $toastElement).length === 0) { 129 | $toastElement[options.hideMethod]({ 130 | duration: options.hideDuration, 131 | easing: options.hideEasing, 132 | complete: function () { removeToast($toastElement); } 133 | }); 134 | return true; 135 | } 136 | return false; 137 | } 138 | 139 | function createContainer(options) { 140 | $container = $('
    ') 141 | .attr('id', options.containerId) 142 | .addClass(options.positionClass) 143 | .attr('aria-live', 'polite') 144 | .attr('role', 'alert'); 145 | 146 | $container.appendTo($(options.target)); 147 | return $container; 148 | } 149 | 150 | function getDefaults() { 151 | return { 152 | tapToDismiss: true, 153 | toastClass: 'toast', 154 | containerId: 'toast-container', 155 | debug: false, 156 | 157 | showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery 158 | showDuration: 300, 159 | showEasing: 'swing', //swing and linear are built into jQuery 160 | onShown: undefined, 161 | hideMethod: 'fadeOut', 162 | hideDuration: 1000, 163 | hideEasing: 'swing', 164 | onHidden: undefined, 165 | 166 | extendedTimeOut: 1000, 167 | iconClasses: { 168 | error: 'toast-error', 169 | info: 'toast-info', 170 | success: 'toast-success', 171 | warning: 'toast-warning' 172 | }, 173 | iconClass: 'toast-info', 174 | positionClass: 'toast-top-right', 175 | timeOut: 5000, // Set timeOut and extendedTimeout to 0 to make it sticky 176 | titleClass: 'toast-title', 177 | messageClass: 'toast-message', 178 | target: 'body', 179 | closeHtml: '', 180 | newestOnTop: true 181 | }; 182 | } 183 | 184 | function publish(args) { 185 | if (!listener) { return; } 186 | listener(args); 187 | } 188 | 189 | function notify(map) { 190 | var options = getOptions(), 191 | iconClass = map.iconClass || options.iconClass; 192 | 193 | if (typeof (map.optionsOverride) !== 'undefined') { 194 | options = $.extend(options, map.optionsOverride); 195 | iconClass = map.optionsOverride.iconClass || iconClass; 196 | } 197 | 198 | toastId++; 199 | 200 | $container = getContainer(options, true); 201 | var intervalId = null, 202 | $toastElement = $('
    '), 203 | $titleElement = $('
    '), 204 | $messageElement = $('
    '), 205 | $closeElement = $(options.closeHtml), 206 | response = { 207 | toastId: toastId, 208 | state: 'visible', 209 | startTime: new Date(), 210 | options: options, 211 | map: map 212 | }; 213 | 214 | if (map.iconClass) { 215 | $toastElement.addClass(options.toastClass).addClass(iconClass); 216 | } 217 | 218 | if (map.title) { 219 | $titleElement.append(map.title).addClass(options.titleClass); 220 | $toastElement.append($titleElement); 221 | } 222 | 223 | if (map.message) { 224 | $messageElement.append(map.message).addClass(options.messageClass); 225 | $toastElement.append($messageElement); 226 | } 227 | 228 | if (options.closeButton) { 229 | $closeElement.addClass('toast-close-button').attr("role", "button"); 230 | $toastElement.prepend($closeElement); 231 | } 232 | 233 | $toastElement.hide(); 234 | if (options.newestOnTop) { 235 | $container.prepend($toastElement); 236 | } else { 237 | $container.append($toastElement); 238 | } 239 | 240 | 241 | $toastElement[options.showMethod]( 242 | { duration: options.showDuration, easing: options.showEasing, complete: options.onShown } 243 | ); 244 | 245 | if (options.timeOut > 0) { 246 | intervalId = setTimeout(hideToast, options.timeOut); 247 | } 248 | 249 | $toastElement.hover(stickAround, delayedHideToast); 250 | if (!options.onclick && options.tapToDismiss) { 251 | $toastElement.click(hideToast); 252 | } 253 | 254 | if (options.closeButton && $closeElement) { 255 | $closeElement.click(function (event) { 256 | if( event.stopPropagation ) { 257 | event.stopPropagation(); 258 | } else if( event.cancelBubble !== undefined && event.cancelBubble !== true ) { 259 | event.cancelBubble = true; 260 | } 261 | hideToast(true); 262 | }); 263 | } 264 | 265 | if (options.onclick) { 266 | $toastElement.click(function () { 267 | options.onclick(); 268 | hideToast(); 269 | }); 270 | } 271 | 272 | publish(response); 273 | 274 | if (options.debug && console) { 275 | console.log(response); 276 | } 277 | 278 | return $toastElement; 279 | 280 | function hideToast(override) { 281 | if ($(':focus', $toastElement).length && !override) { 282 | return; 283 | } 284 | return $toastElement[options.hideMethod]({ 285 | duration: options.hideDuration, 286 | easing: options.hideEasing, 287 | complete: function () { 288 | removeToast($toastElement); 289 | if (options.onHidden && response.state !== 'hidden') { 290 | options.onHidden(); 291 | } 292 | response.state = 'hidden'; 293 | response.endTime = new Date(); 294 | publish(response); 295 | } 296 | }); 297 | } 298 | 299 | function delayedHideToast() { 300 | if (options.timeOut > 0 || options.extendedTimeOut > 0) { 301 | intervalId = setTimeout(hideToast, options.extendedTimeOut); 302 | } 303 | } 304 | 305 | function stickAround() { 306 | clearTimeout(intervalId); 307 | $toastElement.stop(true, true)[options.showMethod]( 308 | { duration: options.showDuration, easing: options.showEasing } 309 | ); 310 | } 311 | } 312 | 313 | function getOptions() { 314 | return $.extend({}, getDefaults(), toastr.options); 315 | } 316 | 317 | function removeToast($toastElement) { 318 | if (!$container) { $container = getContainer(); } 319 | if ($toastElement.is(':visible')) { 320 | return; 321 | } 322 | $toastElement.remove(); 323 | $toastElement = null; 324 | if ($container.children().length === 0) { 325 | $container.remove(); 326 | } 327 | } 328 | //#endregion 329 | 330 | })(); 331 | }); 332 | }(typeof define === 'function' && define.amd ? define : function (deps, factory) { 333 | if (typeof module !== 'undefined' && module.exports) { //Node 334 | module.exports = factory(require('jquery')); 335 | } else { 336 | window['toastr'] = factory(window['jQuery']); 337 | } 338 | })); -------------------------------------------------------------------------------- /demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | toastr examples 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 |
    18 |

    toastr

    19 | 20 |
    21 |
    22 |
    23 |
    24 |
    25 | 26 | 27 | 28 | 29 |
    30 |
    31 |
    32 |
    33 | 36 |
    37 |
    38 | 41 |
    42 |
    43 | 46 |
    47 |
    48 | 51 |
    52 |
    53 | 56 |
    57 |
    58 | 61 |
    62 |
    63 | 66 |
    67 |
    68 | 71 |
    72 |
    73 | 76 |
    77 |
    78 |
    79 | 80 |
    81 |
    82 |
    83 | 84 | 87 | 90 | 93 | 96 |
    97 |
    98 |
    99 |
    100 | 101 | 104 | 107 | 110 | 113 | 116 | 119 | 122 | 125 |
    126 |
    127 |
    128 | 129 |
    130 |
    131 |
    132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 |
    144 |
    145 |
    146 | 147 |
    148 |
    149 |
    150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 |
    162 |
    163 |
    164 |
    165 | 166 |
    167 | 168 | 169 | 170 |
    171 | 172 |
    173 |
    
    174 |         
    175 |
    176 |
    177 | 178 |
    179 |

    Links

    180 | 181 | 185 |
    186 | 187 | 188 | 189 | 190 | 350 | 351 | 352 | -------------------------------------------------------------------------------- /toastr.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Toastr 3 | * Copyright 2012-2015 4 | * Authors: John Papa, Hans Fjällemark, and Tim Ferrell. 5 | * All Rights Reserved. 6 | * Use, reproduction, distribution, and modification of this code is subject to the terms and 7 | * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php 8 | * 9 | * ARIA Support: Greta Krafsig 10 | * 11 | * Project: https://github.com/CodeSeven/toastr 12 | */ 13 | /* global define */ 14 | (function (define) { 15 | define(['jquery'], function ($) { 16 | return (function () { 17 | var $container; 18 | var listener; 19 | var toastId = 0; 20 | var toastType = { 21 | error: 'error', 22 | info: 'info', 23 | success: 'success', 24 | warning: 'warning' 25 | }; 26 | 27 | var toastr = { 28 | clear: clear, 29 | remove: remove, 30 | error: error, 31 | getContainer: getContainer, 32 | info: info, 33 | options: {}, 34 | subscribe: subscribe, 35 | success: success, 36 | version: '2.1.4', 37 | warning: warning 38 | }; 39 | 40 | var previousToast; 41 | 42 | return toastr; 43 | 44 | //////////////// 45 | 46 | function error(message, title, optionsOverride) { 47 | return notify({ 48 | type: toastType.error, 49 | iconClass: getOptions().iconClasses.error, 50 | message: message, 51 | optionsOverride: optionsOverride, 52 | title: title 53 | }); 54 | } 55 | 56 | function getContainer(options, create) { 57 | if (!options) { options = getOptions(); } 58 | $container = $('#' + options.containerId); 59 | if ($container.length) { 60 | return $container; 61 | } 62 | if (create) { 63 | $container = createContainer(options); 64 | } 65 | return $container; 66 | } 67 | 68 | function info(message, title, optionsOverride) { 69 | return notify({ 70 | type: toastType.info, 71 | iconClass: getOptions().iconClasses.info, 72 | message: message, 73 | optionsOverride: optionsOverride, 74 | title: title 75 | }); 76 | } 77 | 78 | function subscribe(callback) { 79 | listener = callback; 80 | } 81 | 82 | function success(message, title, optionsOverride) { 83 | return notify({ 84 | type: toastType.success, 85 | iconClass: getOptions().iconClasses.success, 86 | message: message, 87 | optionsOverride: optionsOverride, 88 | title: title 89 | }); 90 | } 91 | 92 | function warning(message, title, optionsOverride) { 93 | return notify({ 94 | type: toastType.warning, 95 | iconClass: getOptions().iconClasses.warning, 96 | message: message, 97 | optionsOverride: optionsOverride, 98 | title: title 99 | }); 100 | } 101 | 102 | function clear($toastElement, clearOptions) { 103 | var options = getOptions(); 104 | if (!$container) { getContainer(options); } 105 | if (!clearToast($toastElement, options, clearOptions)) { 106 | clearContainer(options); 107 | } 108 | } 109 | 110 | function remove($toastElement) { 111 | var options = getOptions(); 112 | if (!$container) { getContainer(options); } 113 | if ($toastElement && $(':focus', $toastElement).length === 0) { 114 | removeToast($toastElement); 115 | return; 116 | } 117 | if ($container.children().length) { 118 | $container.remove(); 119 | } 120 | } 121 | 122 | // internal functions 123 | 124 | function clearContainer (options) { 125 | var toastsToClear = $container.children(); 126 | for (var i = toastsToClear.length - 1; i >= 0; i--) { 127 | clearToast($(toastsToClear[i]), options); 128 | } 129 | } 130 | 131 | function clearToast ($toastElement, options, clearOptions) { 132 | var force = clearOptions && clearOptions.force ? clearOptions.force : false; 133 | if ($toastElement && (force || $(':focus', $toastElement).length === 0)) { 134 | $toastElement[options.hideMethod]({ 135 | duration: options.hideDuration, 136 | easing: options.hideEasing, 137 | complete: function () { removeToast($toastElement); } 138 | }); 139 | return true; 140 | } 141 | return false; 142 | } 143 | 144 | function createContainer(options) { 145 | $container = $('
    ') 146 | .attr('id', options.containerId) 147 | .addClass(options.positionClass); 148 | 149 | $container.appendTo($(options.target)); 150 | return $container; 151 | } 152 | 153 | function getDefaults() { 154 | return { 155 | tapToDismiss: true, 156 | toastClass: 'toast', 157 | containerId: 'toast-container', 158 | debug: false, 159 | 160 | showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery 161 | showDuration: 300, 162 | showEasing: 'swing', //swing and linear are built into jQuery 163 | onShown: undefined, 164 | hideMethod: 'fadeOut', 165 | hideDuration: 1000, 166 | hideEasing: 'swing', 167 | onHidden: undefined, 168 | closeMethod: false, 169 | closeDuration: false, 170 | closeEasing: false, 171 | closeOnHover: true, 172 | 173 | extendedTimeOut: 1000, 174 | iconClasses: { 175 | error: 'toast-error', 176 | info: 'toast-info', 177 | success: 'toast-success', 178 | warning: 'toast-warning' 179 | }, 180 | iconClass: 'toast-info', 181 | positionClass: 'toast-top-right', 182 | timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky 183 | titleClass: 'toast-title', 184 | messageClass: 'toast-message', 185 | escapeHtml: false, 186 | target: 'body', 187 | closeHtml: '', 188 | closeClass: 'toast-close-button', 189 | newestOnTop: true, 190 | preventDuplicates: false, 191 | progressBar: false, 192 | progressClass: 'toast-progress', 193 | rtl: false 194 | }; 195 | } 196 | 197 | function publish(args) { 198 | if (!listener) { return; } 199 | listener(args); 200 | } 201 | 202 | function notify(map) { 203 | var options = getOptions(); 204 | var iconClass = map.iconClass || options.iconClass; 205 | 206 | if (typeof (map.optionsOverride) !== 'undefined') { 207 | options = $.extend(options, map.optionsOverride); 208 | iconClass = map.optionsOverride.iconClass || iconClass; 209 | } 210 | 211 | if (shouldExit(options, map)) { return; } 212 | 213 | toastId++; 214 | 215 | $container = getContainer(options, true); 216 | 217 | var intervalId = null; 218 | var $toastElement = $('
    '); 219 | var $titleElement = $('
    '); 220 | var $messageElement = $('
    '); 221 | var $progressElement = $('
    '); 222 | var $closeElement = $(options.closeHtml); 223 | var progressBar = { 224 | intervalId: null, 225 | hideEta: null, 226 | maxHideTime: null 227 | }; 228 | var response = { 229 | toastId: toastId, 230 | state: 'visible', 231 | startTime: new Date(), 232 | options: options, 233 | map: map 234 | }; 235 | 236 | personalizeToast(); 237 | 238 | displayToast(); 239 | 240 | handleEvents(); 241 | 242 | publish(response); 243 | 244 | if (options.debug && console) { 245 | console.log(response); 246 | } 247 | 248 | return $toastElement; 249 | 250 | function escapeHtml(source) { 251 | if (source == null) { 252 | source = ''; 253 | } 254 | 255 | return source 256 | .replace(/&/g, '&') 257 | .replace(/"/g, '"') 258 | .replace(/'/g, ''') 259 | .replace(//g, '>'); 261 | } 262 | 263 | function personalizeToast() { 264 | setIcon(); 265 | setTitle(); 266 | setMessage(); 267 | setCloseButton(); 268 | setProgressBar(); 269 | setRTL(); 270 | setSequence(); 271 | setAria(); 272 | } 273 | 274 | function setAria() { 275 | var ariaValue = ''; 276 | switch (map.iconClass) { 277 | case 'toast-success': 278 | case 'toast-info': 279 | ariaValue = 'polite'; 280 | break; 281 | default: 282 | ariaValue = 'assertive'; 283 | } 284 | $toastElement.attr('aria-live', ariaValue); 285 | } 286 | 287 | function handleEvents() { 288 | if (options.closeOnHover) { 289 | $toastElement.hover(stickAround, delayedHideToast); 290 | } 291 | 292 | if (!options.onclick && options.tapToDismiss) { 293 | $toastElement.click(hideToast); 294 | } 295 | 296 | if (options.closeButton && $closeElement) { 297 | $closeElement.click(function (event) { 298 | if (event.stopPropagation) { 299 | event.stopPropagation(); 300 | } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) { 301 | event.cancelBubble = true; 302 | } 303 | 304 | if (options.onCloseClick) { 305 | options.onCloseClick(event); 306 | } 307 | 308 | hideToast(true); 309 | }); 310 | } 311 | 312 | if (options.onclick) { 313 | $toastElement.click(function (event) { 314 | options.onclick(event); 315 | hideToast(); 316 | }); 317 | } 318 | } 319 | 320 | function displayToast() { 321 | $toastElement.hide(); 322 | 323 | $toastElement[options.showMethod]( 324 | {duration: options.showDuration, easing: options.showEasing, complete: options.onShown} 325 | ); 326 | 327 | if (options.timeOut > 0) { 328 | intervalId = setTimeout(hideToast, options.timeOut); 329 | progressBar.maxHideTime = parseFloat(options.timeOut); 330 | progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime; 331 | if (options.progressBar) { 332 | progressBar.intervalId = setInterval(updateProgress, 10); 333 | } 334 | } 335 | } 336 | 337 | function setIcon() { 338 | if (map.iconClass) { 339 | $toastElement.addClass(options.toastClass).addClass(iconClass); 340 | } 341 | } 342 | 343 | function setSequence() { 344 | if (options.newestOnTop) { 345 | $container.prepend($toastElement); 346 | } else { 347 | $container.append($toastElement); 348 | } 349 | } 350 | 351 | function setTitle() { 352 | if (map.title) { 353 | var suffix = map.title; 354 | if (options.escapeHtml) { 355 | suffix = escapeHtml(map.title); 356 | } 357 | $titleElement.append(suffix).addClass(options.titleClass); 358 | $toastElement.append($titleElement); 359 | } 360 | } 361 | 362 | function setMessage() { 363 | if (map.message) { 364 | var suffix = map.message; 365 | if (options.escapeHtml) { 366 | suffix = escapeHtml(map.message); 367 | } 368 | $messageElement.append(suffix).addClass(options.messageClass); 369 | $toastElement.append($messageElement); 370 | } 371 | } 372 | 373 | function setCloseButton() { 374 | if (options.closeButton) { 375 | $closeElement.addClass(options.closeClass).attr('role', 'button'); 376 | $toastElement.prepend($closeElement); 377 | } 378 | } 379 | 380 | function setProgressBar() { 381 | if (options.progressBar) { 382 | $progressElement.addClass(options.progressClass); 383 | $toastElement.prepend($progressElement); 384 | } 385 | } 386 | 387 | function setRTL() { 388 | if (options.rtl) { 389 | $toastElement.addClass('rtl'); 390 | } 391 | } 392 | 393 | function shouldExit(options, map) { 394 | if (options.preventDuplicates) { 395 | if (map.message === previousToast) { 396 | return true; 397 | } else { 398 | previousToast = map.message; 399 | } 400 | } 401 | return false; 402 | } 403 | 404 | function hideToast(override) { 405 | var method = override && options.closeMethod !== false ? options.closeMethod : options.hideMethod; 406 | var duration = override && options.closeDuration !== false ? 407 | options.closeDuration : options.hideDuration; 408 | var easing = override && options.closeEasing !== false ? options.closeEasing : options.hideEasing; 409 | if ($(':focus', $toastElement).length && !override) { 410 | return; 411 | } 412 | clearTimeout(progressBar.intervalId); 413 | return $toastElement[method]({ 414 | duration: duration, 415 | easing: easing, 416 | complete: function () { 417 | removeToast($toastElement); 418 | clearTimeout(intervalId); 419 | if (options.onHidden && response.state !== 'hidden') { 420 | options.onHidden(); 421 | } 422 | response.state = 'hidden'; 423 | response.endTime = new Date(); 424 | publish(response); 425 | } 426 | }); 427 | } 428 | 429 | function delayedHideToast() { 430 | if (options.timeOut > 0 || options.extendedTimeOut > 0) { 431 | intervalId = setTimeout(hideToast, options.extendedTimeOut); 432 | progressBar.maxHideTime = parseFloat(options.extendedTimeOut); 433 | progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime; 434 | } 435 | } 436 | 437 | function stickAround() { 438 | clearTimeout(intervalId); 439 | progressBar.hideEta = 0; 440 | $toastElement.stop(true, true)[options.showMethod]( 441 | {duration: options.showDuration, easing: options.showEasing} 442 | ); 443 | } 444 | 445 | function updateProgress() { 446 | var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100; 447 | $progressElement.width(percentage + '%'); 448 | } 449 | } 450 | 451 | function getOptions() { 452 | return $.extend({}, getDefaults(), toastr.options); 453 | } 454 | 455 | function removeToast($toastElement) { 456 | if (!$container) { $container = getContainer(); } 457 | if ($toastElement.is(':visible')) { 458 | return; 459 | } 460 | $toastElement.remove(); 461 | $toastElement = null; 462 | if ($container.children().length === 0) { 463 | $container.remove(); 464 | previousToast = undefined; 465 | } 466 | } 467 | 468 | })(); 469 | }); 470 | }(typeof define === 'function' && define.amd ? define : function (deps, factory) { 471 | if (typeof module !== 'undefined' && module.exports) { //Node 472 | module.exports = factory(require('jquery')); 473 | } else { 474 | window.toastr = factory(window.jQuery); 475 | } 476 | })); 477 | -------------------------------------------------------------------------------- /tests/unit/toastr-tests.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | (function () { 4 | var iconClasses = { 5 | error: 'toast-error', 6 | info: 'toast-info', 7 | success: 'toast-success', 8 | warning: 'toast-warning' 9 | }; 10 | var positionClasses = { 11 | topRight: 'toast-top-right', 12 | bottomRight: 'toast-bottom-right', 13 | bottomLeft: 'toast-bottom-left', 14 | topLeft: 'toast-top-left', 15 | topCenter: 'toast-top-center', 16 | bottomCenter: 'toast-bottom-center' 17 | }; 18 | var sampleMsg = 'I don\'t think they really exist'; 19 | var sampleTitle = 'TEST'; 20 | var selectors = { 21 | container: 'div#toast-container', 22 | toastInfo: 'div#toast-container > div.toast-info', 23 | toastWarning: 'div#toast-container > div.toast-success', 24 | toastError: 'div#toast-container > div.toast-error', 25 | toastSuccess: 'div#toast-container > div.toast-success' 26 | }; 27 | 28 | toastr.options = { 29 | timeOut: 2000, 30 | extendedTimeOut: 0, 31 | fadeOut: 0, 32 | fadeIn: 0, 33 | showDuration: 0, 34 | hideDuration: 0, 35 | debug: false 36 | }; 37 | 38 | var delay = toastr.options.timeOut + 500; 39 | 40 | // 'Clears' must go first 41 | module('clear'); 42 | asyncTest('clear - show 3 toasts, clear the 2nd', 1, function () { 43 | //Arrange 44 | var $toast = []; 45 | $toast[0] = toastr.info(sampleMsg, sampleTitle + '-1'); 46 | $toast[1] = toastr.info(sampleMsg, sampleTitle + '-2'); 47 | $toast[2] = toastr.info(sampleMsg, sampleTitle + '-3'); 48 | var $container = toastr.getContainer(); 49 | //Act 50 | toastr.clear($toast[1]); 51 | //Assert 52 | setTimeout(function () { 53 | ok($container && $container.children().length === 2); 54 | //Teardown 55 | resetContainer(); 56 | start(); 57 | }, 1000); 58 | }); 59 | asyncTest('clear - show 3 toasts, clear all 3, 0 left', 1, function () { 60 | //Arrange 61 | var $toast = []; 62 | $toast[0] = toastr.info(sampleMsg, sampleTitle + '-1'); 63 | $toast[1] = toastr.info(sampleMsg, sampleTitle + '-2'); 64 | $toast[2] = toastr.info(sampleMsg, sampleTitle + '-3'); 65 | var $container = toastr.getContainer(); 66 | //Act 67 | toastr.clear(); 68 | //Assert 69 | setTimeout(function () { 70 | ok($container && $container.children().length === 0); 71 | //Teardown 72 | resetContainer(); 73 | start(); 74 | }, delay); 75 | }); 76 | test('clear - after clear with force option toast with focus disappears', 1, function () { 77 | //Arrange 78 | var $toast; 79 | var msg = sampleMsg + '

    '; 80 | //Act 81 | $toast = toastr.info(msg, sampleTitle + '-1'); 82 | $toast.find('button').focus(); 83 | toastr.clear($toast, { force: true }); 84 | var $container = toastr.getContainer(); 85 | //Assert 86 | ok($container && $container.children().length === 0, 'Focused toast after a clear with force is not visible'); 87 | //Teardown 88 | resetContainer(); 89 | }); 90 | asyncTest('clear and show - show 2 toasts, clear both, then show 1 more', 2, function () { 91 | //Arrange 92 | var $toast = []; 93 | $toast[0] = toastr.info(sampleMsg, sampleTitle + '-1'); 94 | $toast[1] = toastr.info(sampleMsg, sampleTitle + '-2'); 95 | var $container = toastr.getContainer(); 96 | toastr.clear(); 97 | //Act 98 | setTimeout(function () { 99 | $toast[2] = toastr.info(sampleMsg, sampleTitle + '-3-Visible'); 100 | //Assert 101 | equal($toast[2].find('div.toast-title').html(), sampleTitle + '-3-Visible', 'Finds toast after a clear'); 102 | ok($toast[2].is(':visible'), 'Toast after a clear is visible'); 103 | //Teardown 104 | resetContainer(); 105 | start(); 106 | }, delay); 107 | }); 108 | asyncTest('clear and show - clear removes toast container', 2, function () { 109 | //Arrange 110 | var $toast = []; 111 | $toast[0] = toastr.info(sampleMsg, sampleTitle + '-1'); 112 | $toast[1] = toastr.info(sampleMsg, sampleTitle + '-2'); 113 | var $container = toastr.getContainer(); 114 | toastr.clear(); 115 | //Act 116 | setTimeout(function () { 117 | //Assert 118 | equal($(selectors.container).length, 0, 'Toast container does not exist'); 119 | ok(!$toast[1].is(':visible'), 'Toast after a clear is visible'); 120 | //Teardown 121 | resetContainer(); 122 | start(); 123 | }, delay); 124 | }); 125 | asyncTest('clear and show - after clear new toast creates container', 1, function () { 126 | //Arrange 127 | var $toast = []; 128 | $toast[0] = toastr.info(sampleMsg, sampleTitle + '-1'); 129 | $toast[1] = toastr.info(sampleMsg, sampleTitle + '-2'); 130 | var $container = toastr.getContainer(); 131 | toastr.clear(); 132 | //Act 133 | setTimeout(function () { 134 | $toast[2] = toastr.info(sampleMsg, sampleTitle + '-3-Visible'); 135 | //Assert 136 | equal($(selectors.container).find('div.toast-title').html(), sampleTitle + '-3-Visible', 'Finds toast after a clear'); //Teardown 137 | resetContainer(); 138 | start(); 139 | }, delay); 140 | }); 141 | asyncTest('clear and show - clear toast after hover', 1, function () { 142 | //Arrange 143 | var $toast = toastr.info(sampleMsg, sampleTitle); 144 | var $container = toastr.getContainer(); 145 | $toast.trigger("mouseout"); 146 | //Act 147 | setTimeout(function () { 148 | //Assert 149 | ok($container.find('div.toast-title').length === 0, 'Toast clears after a mouse hover'); //Teardown 150 | resetContainer(); 151 | start(); 152 | }, 500); 153 | }); 154 | asyncTest('clear and show - do not clear toast after hover', 1, function () { 155 | //Arrange 156 | var $toast = toastr.info(sampleMsg, sampleTitle, { closeOnHover: false }); 157 | var $container = toastr.getContainer(); 158 | $toast.trigger("mouseout"); 159 | //Act 160 | setTimeout(function () { 161 | //Assert 162 | ok($container.find('div.toast-title').length === 1, 'Toast does not clear after a mouse hover'); //Teardown 163 | resetContainer(); 164 | start(); 165 | }, 500); 166 | }); 167 | test('clear and show - after clear all toasts new toast still appears', 1, function () { 168 | //Arrange 169 | var $toast = []; 170 | //Act 171 | $toast[0] = toastr.info(sampleMsg, sampleTitle + '-1'); 172 | $toast[1] = toastr.info(sampleMsg, sampleTitle + '-2'); 173 | toastr.clear(); 174 | $toast[2] = toastr.info(sampleMsg, sampleTitle + '-3-Visible'); 175 | //Assert 176 | ok($toast[2].is(':visible'), 'Toast after a clear is visible'); 177 | //Teardown 178 | resetContainer(); 179 | }); 180 | module('info'); 181 | test('info - pass title and message', 3, function () { 182 | //Arrange 183 | //Act 184 | var $toast = toastr.info(sampleMsg, sampleTitle); 185 | //Assert 186 | equal($toast.find('div.toast-title').html(), sampleTitle, 'Sets title'); 187 | equal($toast.find('div.toast-message').html(), sampleMsg, 'Sets message'); 188 | ok($toast.hasClass(iconClasses.info), 'Sets info icon'); 189 | //Teardown 190 | $toast.remove(); 191 | clearContainerChildren(); 192 | }); 193 | test('info - pass message, but no title', 3, function () { 194 | //Arrange 195 | //Act 196 | var $toast = toastr.info(sampleMsg); 197 | //Assert 198 | equal($toast.find('div.toast-title').length, 0, 'Sets null title'); 199 | equal($toast.find('div.toast-message').html(), sampleMsg, 'Sets message'); 200 | ok($toast.hasClass(iconClasses.info), 'Sets info icon'); 201 | //Teardown 202 | $toast.remove(); 203 | clearContainerChildren(); 204 | }); 205 | test('info - pass no message nor title', 3, function () { 206 | //Arrange 207 | //Act 208 | var $toast = toastr.info(); //Assert 209 | equal($toast.find('div.toast-title').length, 0, 'Sets null title'); 210 | equal($toast.find('div.toast-message').html(), null, 'Sets message'); 211 | ok($toast.hasClass(iconClasses.info), 'Sets info icon'); 212 | //Teardown 213 | $toast.remove(); 214 | clearContainerChildren(); 215 | }); 216 | module('warning'); 217 | test('warning - pass message and title', 3, function () { 218 | //Arrange 219 | //Act 220 | var $toast = toastr.warning(sampleMsg, sampleTitle); 221 | //Assert 222 | equal($toast.find('div.toast-title').html(), sampleTitle, 'Sets title'); 223 | equal($toast.find('div.toast-message').html(), sampleMsg, 'Sets message'); 224 | ok($toast.hasClass(iconClasses.warning), 'Sets warning icon'); 225 | //Teardown 226 | $toast.remove(); 227 | clearContainerChildren(); 228 | }); 229 | test('warning - pass message, but no title', 3, function () { 230 | //Arrange 231 | //Act 232 | var $toast = toastr.warning(sampleMsg); 233 | //Assert 234 | equal($toast.find('div.toast-title').length, 0, 'Sets empty title'); 235 | equal($toast.find('div.toast-message').html(), sampleMsg, 'Sets message'); 236 | ok($toast.hasClass(iconClasses.warning), 'Sets warning icon'); 237 | //Teardown 238 | $toast.remove(); 239 | clearContainerChildren(); 240 | }); 241 | test('warning - no message nor title', 3, function () { 242 | //Arrange 243 | //Act 244 | var $toast = toastr.warning(''); 245 | //Assert 246 | equal($toast.find('div.toast-title').length, 0, 'Sets null title'); 247 | equal($toast.find('div.toast-message').length, 0, 'Sets empty message'); 248 | ok($toast.hasClass(iconClasses.warning), 'Sets warning icon'); 249 | //Teardown 250 | $toast.remove(); 251 | clearContainerChildren(); 252 | }); 253 | module('error'); 254 | test('error - pass message and title', 3, function () { 255 | //Arrange 256 | //Act 257 | var $toast = toastr.error(sampleMsg, sampleTitle); 258 | //Assert 259 | equal($toast.find('div.toast-title').html(), sampleTitle, 'Sets title'); 260 | equal($toast.find('div.toast-message').html(), sampleMsg, 'Sets message'); 261 | ok($toast.hasClass(iconClasses.error), 'Sets error icon'); 262 | //Teardown 263 | $toast.remove(); 264 | clearContainerChildren(); 265 | }); 266 | test('error - pass message, but no title', 3, function () { 267 | //Arrange 268 | //Act 269 | var $toast = toastr.error(sampleMsg); //Assert 270 | equal($toast.find('div.toast-title').length, 0, 'Sets empty title'); 271 | equal($toast.find('div.toast-message').html(), sampleMsg, 'Sets message'); 272 | ok($toast.hasClass(iconClasses.error), 'Sets error icon'); 273 | //Teardown 274 | $toast.remove(); 275 | clearContainerChildren(); 276 | }); 277 | test('error - no message nor title', 3, function () { 278 | //Arrange 279 | //Act 280 | var $toast = toastr.error(''); 281 | //Assert 282 | equal($toast.find('div.toast-title').length, 0, 'Sets empty title'); 283 | equal($toast.find('div.toast-message').length, 0, 'Sets empty message'); 284 | ok($toast.hasClass(iconClasses.error), 'Sets error icon'); 285 | //Teardown 286 | $toast.remove(); 287 | clearContainerChildren(); 288 | }); 289 | module('success'); 290 | test('success - pass message and title', 3, function () { 291 | //Arrange 292 | //Act 293 | var $toast = toastr.success(sampleMsg, sampleTitle); 294 | //Assert 295 | equal($toast.find('div.toast-title').html(), sampleTitle, 'Sets title'); 296 | equal($toast.find('div.toast-message').html(), sampleMsg, 'Sets message'); 297 | ok($toast.hasClass(iconClasses.success), 'Sets success icon'); 298 | //Teardown 299 | $toast.remove(); 300 | clearContainerChildren(); 301 | }); 302 | test('success - pass message, but no title', 3, function () { 303 | //Arrange 304 | //Act 305 | var $toast = toastr.success(sampleMsg); 306 | //Assert 307 | equal($toast.find('div.toast-title').length, 0, 'Sets empty title'); 308 | equal($toast.find('div.toast-message').html(), sampleMsg, 'Sets message'); 309 | ok($toast.hasClass(iconClasses.success), 'Sets success icon'); 310 | //Teardown 311 | $toast.remove(); 312 | clearContainerChildren(); 313 | }); 314 | test('success - no message nor title', 3, function () { 315 | //Arrange 316 | //Act 317 | var $toast = toastr.success(''); 318 | //Assert 319 | equal($toast.find('div.toast-title').length, 0, 'Sets null title'); 320 | equal($toast.find('div.toast-message').length, 0, 'Sets empty message'); 321 | ok($toast.hasClass(iconClasses.success), 'Sets success icon'); //Teardown 322 | $toast.remove(); 323 | clearContainerChildren(); 324 | }); 325 | 326 | 327 | module('escape html', { 328 | teardown: function () { 329 | toastr.options.escapeHtml = false; 330 | } 331 | }); 332 | test('info - escape html', 2, function () { 333 | //Arrange 334 | toastr.options.escapeHtml = true; 335 | //Act 336 | var $toast = toastr.info('html message', 'html title'); 337 | //Assert 338 | equal($toast.find('div.toast-title').html(), 'html <u>title</u>', 'Title is escaped'); 339 | equal($toast.find('div.toast-message').html(), 'html <strong>message</strong>', 'Message is escaped'); 340 | //Teardown 341 | $toast.remove(); 342 | clearContainerChildren(); 343 | }); 344 | test('warning - escape html', 2, function () { 345 | //Arrange 346 | toastr.options.escapeHtml = true; 347 | //Act 348 | var $toast = toastr.warning('html message', 'html title'); 349 | //Assert 350 | equal($toast.find('div.toast-title').html(), 'html <u>title</u>', 'Title is escaped'); 351 | equal($toast.find('div.toast-message').html(), 'html <strong>message</strong>', 'Message is escaped'); 352 | //Teardown 353 | $toast.remove(); 354 | clearContainerChildren(); 355 | }); 356 | test('error - escape html', 2, function () { 357 | //Arrange 358 | toastr.options.escapeHtml = true; 359 | //Act 360 | var $toast = toastr.error('html message', 'html title'); 361 | //Assert 362 | equal($toast.find('div.toast-title').html(), 'html <u>title</u>', 'Title is escaped'); 363 | equal($toast.find('div.toast-message').html(), 'html <strong>message</strong>', 'Message is escaped'); 364 | //Teardown 365 | $toast.remove(); 366 | clearContainerChildren(); 367 | }); 368 | test('success - escape html', 2, function () { 369 | //Arrange 370 | toastr.options.escapeHtml = true; 371 | //Act 372 | var $toast = toastr.success('html message', 'html title'); 373 | //Assert 374 | equal($toast.find('div.toast-title').html(), 'html <u>title</u>', 'Title is escaped'); 375 | equal($toast.find('div.toast-message').html(), 'html <strong>message</strong>', 'Message is escaped'); 376 | //Teardown 377 | $toast.remove(); 378 | clearContainerChildren(); 379 | }); 380 | 381 | module('closeButton', { 382 | teardown: function () { 383 | toastr.options.closeButton = false; 384 | } 385 | }); 386 | test('close button disabled', 1, function () { 387 | //Arrange 388 | toastr.options.closeButton = false; 389 | //Act 390 | var $toast = toastr.success(''); 391 | //Assert 392 | equal($toast.find('button.toast-close-button').length, 0, 'close button should not exist with closeButton=false'); 393 | //Teardown 394 | $toast.remove(); 395 | clearContainerChildren(); 396 | }); 397 | test('close button enabled', 1, function () { 398 | //Arrange 399 | toastr.options.closeButton = true; 400 | //Act 401 | var $toast = toastr.success(''); 402 | //Assert 403 | equal($toast.find('button.toast-close-button').length, 1, 'close button should exist with closeButton=true'); 404 | //Teardown 405 | $toast.remove(); 406 | clearContainerChildren(); 407 | }); 408 | test('close button has type=button', 1, function () { 409 | //Arrange 410 | toastr.options.closeButton = true; 411 | //Act 412 | var $toast = toastr.success(''); 413 | //Assert 414 | equal($toast.find('button[type="button"].toast-close-button').length, 1, 'close button should have type=button'); 415 | //Teardown 416 | $toast.remove(); 417 | clearContainerChildren(); 418 | }); 419 | asyncTest('close button duration', 1, function () { 420 | //Arrange 421 | toastr.options.closeButton = true; 422 | toastr.options.closeDuration = 0; 423 | toastr.options.hideDuration = 2000; 424 | var $container = toastr.getContainer(); 425 | //Act 426 | var $toast = toastr.success(''); 427 | $toast.find('button.toast-close-button').click(); 428 | setTimeout(function () { 429 | //Assert 430 | ok($container && $container.children().length === 0, 'close button should support own hide animation'); 431 | //Teardown 432 | toastr.options.hideDuration = 0; 433 | resetContainer(); 434 | start(); 435 | }, 500); 436 | }); 437 | 438 | module('progressBar', { 439 | teardown: function () { 440 | toastr.options.progressBar = false; 441 | } 442 | }); 443 | test('progress bar disabled', 1, function () { 444 | //Arrange 445 | toastr.options.progressBar = false; 446 | //Act 447 | var $toast = toastr.success(''); 448 | //Assert 449 | equal($toast.find('div.toast-progress').length, 0, 'progress bar should not exist with progressBar=false'); 450 | //Teardown 451 | $toast.remove(); 452 | clearContainerChildren(); 453 | }); 454 | test('progress bar enabled', 1, function () { 455 | //Arrange 456 | toastr.options.progressBar = true; 457 | //Act 458 | var $toast = toastr.success(''); 459 | //Assert 460 | equal($toast.find('div.toast-progress').length, 1, 'progress bar should exist with progressBar=true'); 461 | //Teardown 462 | $toast.remove(); 463 | clearContainerChildren(); 464 | }); 465 | 466 | module('rtl', { 467 | teardown: function () { 468 | toastr.options.rtl = false; 469 | } 470 | }); 471 | test('toastr is ltr by default', 1, function () { 472 | //Arrange 473 | //Act 474 | //Assert 475 | toastr.subscribe(function(response) { 476 | equal(response.options.rtl, false, 'ltr by default (i.e. rtl=false)'); 477 | }); 478 | var $toast = toastr.success(''); 479 | //Teardown 480 | toastr.subscribe(null); 481 | $toast.remove(); 482 | clearContainerChildren(); 483 | }); 484 | test('ltr toastr does not have .rtl class', 1, function () { 485 | //Arrange 486 | //Act 487 | var $toast = toastr.success(''); 488 | //Assert 489 | ok($toast.hasClass('rtl') === false, 'ltr div container does not have .rtl class'); 490 | //Teardown 491 | $toast.remove(); 492 | clearContainerChildren(); 493 | }); 494 | test('rtl toastr has .rtl class', 1, function () { 495 | //Arrange 496 | toastr.options.rtl = true; 497 | //Act 498 | var $toast = toastr.success(''); 499 | //Assert 500 | ok($toast.hasClass('rtl'), 'rtl div container has .rtl class'); 501 | //Teardown 502 | $toast.remove(); 503 | clearContainerChildren(); 504 | }); 505 | 506 | module('accessibility'); 507 | test('toastr success has aria polite',1,function() { 508 | // Arrange 509 | var $toast = toastr.success(''); 510 | 511 | // Act 512 | ok($toast.attr('aria-live')==='polite', 'success toast has aria-live of polite'); 513 | 514 | // Teardown 515 | $toast.remove(); 516 | clearContainerChildren(); 517 | }); 518 | test('toastr info has aria polite',1,function() { 519 | // Arrange 520 | var $toast = toastr.info(''); 521 | 522 | // Act 523 | ok($toast.attr('aria-live')==='polite', 'info toast has aria-live of polite'); 524 | 525 | // Teardown 526 | $toast.remove(); 527 | clearContainerChildren(); 528 | }); 529 | test('toastr warning has aria assertive',1,function() { 530 | // Arrange 531 | var $toast = toastr.warning(''); 532 | 533 | // Act 534 | ok($toast.attr('aria-live')==='assertive', 'warning toast has aria-live of assertive'); 535 | 536 | // Teardown 537 | $toast.remove(); 538 | clearContainerChildren(); 539 | }); 540 | test('toastr error has aria assertive',1,function() { 541 | // Arrange 542 | var $toast = toastr.error(''); 543 | 544 | // Act 545 | ok($toast.attr('aria-live')==='assertive', 'error toast has aria-live of assertive'); 546 | 547 | // Teardown 548 | $toast.remove(); 549 | clearContainerChildren(); 550 | }); 551 | 552 | module('event', { 553 | teardown: function () { 554 | toastr.options.closeButton = false; 555 | toastr.options.hideDuration = 0; 556 | } 557 | }); 558 | asyncTest('event - onShown is executed', 1, function () { 559 | // Arrange 560 | var run = false; 561 | var onShown = function () { run = true; }; 562 | toastr.options.onShown = onShown; 563 | // Act 564 | var $toast = toastr.success(sampleMsg, sampleTitle); 565 | setTimeout(function () { 566 | // Assert 567 | ok(run); 568 | //Teardown 569 | $toast.remove(); 570 | clearContainerChildren(); 571 | start(); 572 | }, delay); 573 | }); 574 | 575 | asyncTest('event - onHidden is executed', 1, function () { 576 | //Arrange 577 | var run = false; 578 | var onHidden = function () { run = true; }; 579 | toastr.options.onHidden = onHidden; 580 | toastr.options.timeOut = 1; 581 | //Act 582 | var $toast = toastr.success(sampleMsg, sampleTitle); 583 | setTimeout(function () { 584 | // Assert 585 | ok(run); //Teardown 586 | $toast.remove(); 587 | clearContainerChildren(); 588 | start(); 589 | }, delay); 590 | }); 591 | 592 | asyncTest('event - onShown and onHidden are both executed', 2, function () { 593 | //Arrange 594 | var onShowRun = false; 595 | var onHideRun = false; 596 | var onShow = function () { onShowRun = true; }; 597 | var onHide = function () { onHideRun = true; }; 598 | toastr.options.onShown = onShow; 599 | toastr.options.onHidden = onHide; 600 | toastr.options.timeOut = 1; 601 | //Act 602 | var $toast = toastr.success(sampleMsg, sampleTitle); 603 | setTimeout(function () { 604 | // Assert 605 | ok(onShowRun); 606 | ok(onHideRun); 607 | //Teardown 608 | $toast.remove(); 609 | clearContainerChildren(); 610 | start(); 611 | }, delay); 612 | }); 613 | 614 | asyncTest('event - onCloseClick is executed', 1, function () { 615 | //Arrange 616 | var run = false; 617 | toastr.options.closeButton = true; 618 | toastr.options.closeDuration = 0; 619 | toastr.options.hideDuration = 2000; 620 | var onCloseClick = function () { run = true; }; 621 | toastr.options.onCloseClick = onCloseClick; 622 | toastr.options.timeOut = 1; 623 | //Act 624 | var $toast = toastr.success(sampleMsg, sampleTitle); 625 | $toast.find('button.toast-close-button').click(); 626 | setTimeout(function () { 627 | // Assert 628 | ok(run); //Teardown 629 | $toast.remove(); 630 | clearContainerChildren(); 631 | start(); 632 | }, delay); 633 | }); 634 | 635 | test('event - message appears when no show or hide method functions provided', 1, function () { 636 | //Arrange 637 | //Act 638 | var $toast = toastr.success(sampleMsg, sampleTitle); 639 | //Assert 640 | ok($toast.hasClass(iconClasses.success), 'Sets success icon'); 641 | //Teardown 642 | $toast.remove(); 643 | clearContainerChildren(); 644 | }); 645 | 646 | test('event - prevent duplicate sequential toasts.', 1, function(){ 647 | toastr.options.preventDuplicates = true; 648 | 649 | var $toast = []; 650 | $toast[0] = toastr.info(sampleMsg, sampleTitle); 651 | $toast[1] = toastr.info(sampleMsg, sampleTitle); 652 | $toast[2] = toastr.info(sampleMsg + " 1", sampleTitle); 653 | $toast[3] = toastr.info(sampleMsg, sampleTitle); 654 | var $container = toastr.getContainer(); 655 | 656 | ok($container && $container.children().length === 3); 657 | 658 | clearContainerChildren(); 659 | }); 660 | 661 | test('event - prevent duplicate sequential toasts, but allow previous after clear.', 1, function(){ 662 | toastr.options.preventDuplicates = true; 663 | 664 | var $toast = []; 665 | $toast[0] = toastr.info(sampleMsg, sampleTitle); 666 | $toast[1] = toastr.info(sampleMsg, sampleTitle); 667 | clearContainerChildren(); 668 | $toast[3] = toastr.info(sampleMsg, sampleTitle); 669 | var $container = toastr.getContainer(); 670 | 671 | ok($container && $container.children().length === 1); 672 | 673 | clearContainerChildren(); 674 | }); 675 | 676 | test('event - allow duplicate sequential toasts.', 1, function(){ 677 | toastr.options.preventDuplicates = false; 678 | 679 | var $toast = []; 680 | $toast[0] = toastr.info(sampleMsg, sampleTitle); 681 | $toast[1] = toastr.info(sampleMsg, sampleTitle); 682 | $toast[1] = toastr.info(sampleMsg, sampleTitle); 683 | var $container = toastr.getContainer(); 684 | 685 | ok($container && $container.children().length === 3); 686 | 687 | clearContainerChildren(); 688 | }); 689 | 690 | test('event - allow preventDuplicates option to be overridden.', 1, function() { 691 | var $toast = []; 692 | 693 | $toast[0] = toastr.info(sampleMsg, sampleTitle, { 694 | preventDuplicates: true 695 | }); 696 | $toast[1] = toastr.info(sampleMsg, sampleTitle, { 697 | preventDuplicates: true 698 | }); 699 | $toast[2] = toastr.info(sampleMsg, sampleTitle); 700 | var $container = toastr.getContainer(); 701 | 702 | ok($container && $container.children().length === 2); 703 | clearContainerChildren(); 704 | }); 705 | 706 | module('subscription'); 707 | asyncTest('subscribe - triggers 2 visible and 2 hidden response notifications while clicking on a toast', 1, function () { 708 | //Arrange 709 | var $toast = []; 710 | var expectedReponses = []; 711 | //Act 712 | toastr.subscribe(function(response) { 713 | if(response.options.testId) { 714 | expectedReponses.push(response); 715 | } 716 | }) 717 | 718 | $toast[0] = toastr.info(sampleMsg, sampleTitle, {testId : 1}); 719 | $toast[1] = toastr.info(sampleMsg, sampleTitle, {testId : 2}); 720 | 721 | $toast[1].click() 722 | 723 | setTimeout(function () { 724 | // Assert 725 | ok(expectedReponses.length === 4); 726 | //Teardown 727 | clearContainerChildren(); 728 | toastr.subscribe(null); 729 | start(); 730 | }, delay); 731 | }); 732 | 733 | module('order of appearance'); 734 | test('Newest toast on top', 1, function () { 735 | //Arrange 736 | resetContainer(); 737 | toastr.options.newestOnTop = true; 738 | //Act 739 | var $first = toastr.success("First toast"); 740 | var $second = toastr.success("Second toast"); 741 | //Assert 742 | var containerHtml = toastr.getContainer().html(); 743 | ok(containerHtml.indexOf("First toast") > containerHtml.indexOf("Second toast"), 'Newest toast is on top'); 744 | //Teardown 745 | $first.remove(); 746 | $second.remove(); 747 | resetContainer(); 748 | }); 749 | 750 | test('Oldest toast on top', 1, function () { 751 | //Arrange 752 | resetContainer(); 753 | toastr.options.newestOnTop = false; 754 | //Act 755 | var $first = toastr.success("First toast"); 756 | var $second = toastr.success("Second toast"); 757 | //Assert 758 | var containerHtml = toastr.getContainer().html(); 759 | ok(containerHtml.indexOf("First toast") < containerHtml.indexOf("Second toast"), 'Oldest toast is on top'); 760 | //Teardown 761 | $first.remove(); 762 | $second.remove(); 763 | resetContainer(); 764 | }); 765 | 766 | // These must go last 767 | module('positioning'); 768 | test('Container - position top-right', 1, function () { 769 | //Arrange 770 | resetContainer(); 771 | toastr.options.positionClass = positionClasses.topRight; 772 | //Act 773 | var $toast = toastr.success(sampleMsg); 774 | var $container = toastr.getContainer(); 775 | //Assert 776 | ok($container.hasClass(positionClasses.topRight), 'Has position top right'); 777 | //Teardown 778 | $toast.remove(); 779 | resetContainer(); 780 | }); 781 | test('Container - position bottom-right', 1, function () { 782 | //Arrange 783 | resetContainer(); 784 | toastr.options.positionClass = positionClasses.bottomRight; 785 | //Act 786 | var $toast = toastr.success(sampleMsg); 787 | var $container = toastr.getContainer(); 788 | //Assert 789 | ok($container.hasClass(positionClasses.bottomRight), 'Has position bottom right'); 790 | //Teardown 791 | $toast.remove(); 792 | resetContainer(); 793 | }); 794 | test('Container - position bottom-left', 1, function () { 795 | //Arrange 796 | resetContainer(); 797 | //$(selectors.container).remove() 798 | toastr.options.positionClass = positionClasses.bottomLeft; 799 | //Act 800 | var $toast = toastr.success(sampleMsg); 801 | var $container = toastr.getContainer(); 802 | //Assert 803 | ok($container.hasClass(positionClasses.bottomLeft), 'Has position bottom left'); 804 | //Teardown 805 | $toast.remove(); 806 | resetContainer(); 807 | }); 808 | test('Container - position top-left', 1, function () { 809 | //Arrange 810 | resetContainer(); 811 | toastr.options.positionClass = positionClasses.topLeft; 812 | //Act 813 | var $toast = toastr.success(sampleMsg); 814 | var $container = toastr.getContainer(); 815 | //Assert 816 | ok($container.hasClass(positionClasses.topLeft), 'Has position top left'); 817 | //Teardown 818 | $toast.remove(); 819 | resetContainer(); 820 | }); 821 | test('Container - position top-center', 1, function () { 822 | //Arrange 823 | resetContainer(); 824 | toastr.options.positionClass = positionClasses.topCenter; 825 | //Act 826 | var $toast = toastr.success(sampleMsg); 827 | var $container = toastr.getContainer(); 828 | //Assert 829 | ok($container.hasClass(positionClasses.topCenter), 'Has position top center'); 830 | //Teardown 831 | $toast.remove(); 832 | resetContainer(); 833 | }); 834 | test('Container - position bottom-center', 1, function () { 835 | //Arrange 836 | resetContainer(); 837 | toastr.options.positionClass = positionClasses.bottomCenter; 838 | //Act 839 | var $toast = toastr.success(sampleMsg); 840 | var $container = toastr.getContainer(); 841 | //Assert 842 | ok($container.hasClass(positionClasses.bottomCenter), 'Has position bottom center'); 843 | //Teardown 844 | $toast.remove(); 845 | resetContainer(); 846 | }); 847 | 848 | function resetContainer() { 849 | var $container = toastr.getContainer(); 850 | if ($container) { 851 | $container.remove(); 852 | } 853 | $(selectors.container).remove(); 854 | clearContainerChildren(); 855 | } 856 | 857 | function clearContainerChildren() { 858 | toastr.clear(); 859 | } 860 | 861 | })(); 862 | --------------------------------------------------------------------------------