angularjs-toast
Advanced tools
Comparing version 1.0.12 to 1.0.13
/*! | ||
* @module angularjs-toast | ||
* @description A Simple toast notification service for AngularJS pages | ||
* @version v1.0.12 | ||
* @version v1.0.13 | ||
* @link https://github.com/Sibiraj-S/angularjs-toast#readme | ||
@@ -76,4 +76,3 @@ * @licence MIT License, https://opensource.org/licenses/MIT | ||
message: args.message, | ||
id: new Date().getUTCMilliseconds(), | ||
count: 1 | ||
id: new Date().getUTCMilliseconds() | ||
}; | ||
@@ -80,0 +79,0 @@ // push elements to array |
/*! | ||
* @module angularjs-toast | ||
* @description A Simple toast notification service for AngularJS pages | ||
* @version v1.0.12 | ||
* @version v1.0.13 | ||
* @link https://github.com/Sibiraj-S/angularjs-toast#readme | ||
* @licence MIT License, https://opensource.org/licenses/MIT | ||
*/ | ||
(function(){"use strict";angular.module("angularjsToast",["ngSanitize","ngAnimate"]).factory("toast",["$rootScope","$http","$templateCache","$compile","$timeout",function(s,i,o,n,l){var r,c,m;return m="angularjs-toast.html",'<div class="angularjs-toast" ng-class="$toastPlace ? \'position-fixed\' : \'position-relative\'"> <ul class="toast-container" ng-class="[$position, $masterClass]"> <li class="animate-repeat" ng-repeat="data in $toastMessages track by data.id"> <div class="alert alert-dismissible" ng-class="::$toastClass"> <span ng-bind-html="data.message"></span> <a href="javascript:void(0)" class="close" data-dismiss="alert" aria-label="close" title="close" ng-click="$close($index)" ng-if="$dismissible">×</a> </div> </li> </ul></div>',o.put(m,'<div class="angularjs-toast" ng-class="$toastPlace ? \'position-fixed\' : \'position-relative\'"> <ul class="toast-container" ng-class="[$position, $masterClass]"> <li class="animate-repeat" ng-repeat="data in $toastMessages track by data.id"> <div class="alert alert-dismissible" ng-class="::$toastClass"> <span ng-bind-html="data.message"></span> <a href="javascript:void(0)" class="close" data-dismiss="alert" aria-label="close" title="close" ng-click="$close($index)" ng-if="$dismissible">×</a> </div> </li> </ul></div>'),r=document.querySelector("body"),5e3,!0,"Hi there!",6,"right","alert-success",(c=s.$new()).$toastMessages=[],function(e){var s,a,t;e.duration=e.duration?e.duration:5e3,e.maxToast=e.maxToast?e.maxToast:6,e.insertFromTop=!e.insertFromTop||e.insertFromTop,e.removeFromTop=!!e.removeFromTop&&e.removeFromTop,e.container=e.container?document.querySelector(e.container):r,c.$position=e.position?e.position:"right",c.$toastPlace=e.container===r,c.$masterClass=e.masterClass?e.masterClass:"",c.$toastClass=e.className?e.className:"alert-success",c.$dismissible=!e.dismissible||e.dismissible,c.$message=e.message?e.message:"Hi there!",angular.element(document.getElementsByClassName("angularjs-toast"))[0]||i.get(m,{cache:o}).then(function(s){var a;a=n(s.data)(c),angular.element(e.container).append(a)}),t=function(a){l(function(){var s;-1!==(s=c.$toastMessages.indexOf(a))&&c.$toastMessages.splice(s,1)},e.duration)},s={message:e.message,id:(new Date).getUTCMilliseconds(),count:1},a=function(){e.insertFromTop?c.$toastMessages.unshift(s):c.$toastMessages.push(s),t(s)},c.$toastMessages.length===e.maxToast&&(e.removeFromTop?c.$toastMessages.shift():c.$toastMessages.pop()),a(),c.$close=function(s){c.$toastMessages.splice(s,1)}}}])}).call(this); | ||
(function(){"use strict";angular.module("angularjsToast",["ngSanitize","ngAnimate"]).factory("toast",["$rootScope","$http","$templateCache","$compile","$timeout",function(s,i,o,n,l){var r,c,m;return m="angularjs-toast.html",'<div class="angularjs-toast" ng-class="$toastPlace ? \'position-fixed\' : \'position-relative\'"> <ul class="toast-container" ng-class="[$position, $masterClass]"> <li class="animate-repeat" ng-repeat="data in $toastMessages track by data.id"> <div class="alert alert-dismissible" ng-class="::$toastClass"> <span ng-bind-html="data.message"></span> <a href="javascript:void(0)" class="close" data-dismiss="alert" aria-label="close" title="close" ng-click="$close($index)" ng-if="$dismissible">×</a> </div> </li> </ul></div>',o.put(m,'<div class="angularjs-toast" ng-class="$toastPlace ? \'position-fixed\' : \'position-relative\'"> <ul class="toast-container" ng-class="[$position, $masterClass]"> <li class="animate-repeat" ng-repeat="data in $toastMessages track by data.id"> <div class="alert alert-dismissible" ng-class="::$toastClass"> <span ng-bind-html="data.message"></span> <a href="javascript:void(0)" class="close" data-dismiss="alert" aria-label="close" title="close" ng-click="$close($index)" ng-if="$dismissible">×</a> </div> </li> </ul></div>'),r=document.querySelector("body"),5e3,!0,"Hi there!",6,"right","alert-success",(c=s.$new()).$toastMessages=[],function(e){var s,a,t;e.duration=e.duration?e.duration:5e3,e.maxToast=e.maxToast?e.maxToast:6,e.insertFromTop=!e.insertFromTop||e.insertFromTop,e.removeFromTop=!!e.removeFromTop&&e.removeFromTop,e.container=e.container?document.querySelector(e.container):r,c.$position=e.position?e.position:"right",c.$toastPlace=e.container===r,c.$masterClass=e.masterClass?e.masterClass:"",c.$toastClass=e.className?e.className:"alert-success",c.$dismissible=!e.dismissible||e.dismissible,c.$message=e.message?e.message:"Hi there!",angular.element(document.getElementsByClassName("angularjs-toast"))[0]||i.get(m,{cache:o}).then(function(s){var a;a=n(s.data)(c),angular.element(e.container).append(a)}),t=function(a){l(function(){var s;-1!==(s=c.$toastMessages.indexOf(a))&&c.$toastMessages.splice(s,1)},e.duration)},s={message:e.message,id:(new Date).getUTCMilliseconds()},a=function(){e.insertFromTop?c.$toastMessages.unshift(s):c.$toastMessages.push(s),t(s)},c.$toastMessages.length===e.maxToast&&(e.removeFromTop?c.$toastMessages.shift():c.$toastMessages.pop()),a(),c.$close=function(s){c.$toastMessages.splice(s,1)}}}])}).call(this); | ||
//# sourceMappingURL=angularjs-toast.min.js.map |
{ | ||
"name": "angularjs-toast", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"description": "A Simple toast notification service for AngularJS pages", | ||
@@ -5,0 +5,0 @@ "repository": { |
# angularjs-toast [![Build Status](https://travis-ci.org/Sibiraj-S/angularjs-toast.svg?branch=master)](https://travis-ci.org/Sibiraj-S/angularjs-toast) [![Maintenance](https://img.shields.io/badge/maintained%20%3F-no-red.svg)](https://github.com/Sibiraj-S/angularjs-toast) | ||
angularjs-toast is a simple service for creating toast notification for AngularJS pages | ||
@@ -17,2 +16,3 @@ | ||
``` | ||
or use cdn | ||
@@ -33,2 +33,3 @@ | ||
``` | ||
or | ||
@@ -96,3 +97,2 @@ | ||
[ngAnimate]: https://docs.angularjs.org/api/ngAnimate | ||
@@ -99,0 +99,0 @@ [ngSanitize]: https://docs.angularjs.org/api/ngSanitize |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
26308
332