Socket
Socket
Sign inDemoInstall

izitoast

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

izitoast - npm Package Compare versions

Comparing version 1.0.2-b to 1.0.2-c

0

bower.json

@@ -0,0 +0,0 @@ {

25

dist/js/iziToast.js

@@ -345,5 +345,6 @@ /*

*/
iziToast.hide = function (options, $toast) {
iziToast.hide = function (options, $toast, closedByButton) {
var settings = extend(defaults, options || {});
var isClosed = closedByButton || false;

@@ -403,3 +404,3 @@ if(typeof $toast != 'object'){

if(typeof settings.onClose !== "undefined")
settings.onClose.apply();
settings.onClose.apply(null, [settings, $toast, isClosed]);
};

@@ -459,8 +460,2 @@

if (!isNaN(settings.zindex)) {
$toast.style.zIndex = settings.zindex;
} else {
console.warn("["+PLUGIN_NAME+"] Invalid zIndex.");
}
var $buttonClose;

@@ -602,5 +597,3 @@ if(settings.close){

$wrapper;
if(settings.target){

@@ -647,4 +640,10 @@

settings.onOpen.apply();
if (!isNaN(settings.zindex)) {
$wrapper.style.zIndex = settings.zindex;
} else {
console.warn("["+PLUGIN_NAME+"] Invalid zIndex.");
}
settings.onOpen.apply(null, [settings, $toast]);
try {

@@ -704,3 +703,3 @@ var event;

var button = event.target;
that.hide(settings, $toast);
that.hide(settings, $toast, true);
});

@@ -730,2 +729,2 @@ }

return iziToast;
});
});

@@ -6,2 +6,2 @@ /*

*/
!function(e,t){"function"==typeof define&&define.amd?define([],t(e)):"object"==typeof exports?module.exports=t(e):e.iziToast=t(e)}("undefined"!=typeof global?global:this.window||this.global,function(e){"use strict";var t={},n="iziToast",i=!!/Mobi/.test(navigator.userAgent),o=["bottomRight","bottomLeft","bottomCenter","topRight","topLeft","topCenter","center"],s=568,a={},r={"class":"",title:"",message:"",color:"",icon:"",iconText:"",iconColor:"",image:"",imageWidth:50,zindex:99999,layout:1,balloon:!1,close:!0,rtl:!1,position:"bottomRight",target:"",timeout:5e3,pauseOnHover:!0,resetOnHover:!1,progressBar:!0,progressBarColor:"",animateInside:!0,buttons:{},transitionIn:"fadeInUp",transitionOut:"fadeOut",transitionInMobile:"fadeInUp",transitionOutMobile:"fadeOutDown",onOpen:function(){},onClose:function(){}};"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)});var d=function(e,t,n){if("[object Object]"===Object.prototype.toString.call(e))for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(n,e[i],i,e);else if(e)for(var o=0,s=e.length;s>o;o++)t.call(n,e[o],o,e)},l=function(e,t){var n={};return d(e,function(t,i){n[i]=e[i]}),d(t,function(e,i){n[i]=t[i]}),n},c=function(e){var t=document.createDocumentFragment(),n=document.createElement("div");for(n.innerHTML=e;n.firstChild;)t.appendChild(n.firstChild);return t},u=function(e,t,i){var o=!1,s=!1,a=!1,r=null,d=e.querySelector("."+n+"-progressbar div"),l={hideEta:null,maxHideTime:null,currentTime:(new Date).getTime(),updateProgress:function(){if(o=!!e.classList.contains(n+"-paused"),s=!!e.classList.contains(n+"-reseted"),a=!!e.classList.contains(n+"-closed"),s&&(clearTimeout(r),d.style.width="100%",u(e,t,i),e.classList.remove(n+"-reseted")),a&&(clearTimeout(r),e.classList.remove(n+"-closed")),!o&&!s&&!a){l.currentTime=l.currentTime+10;var c=(l.hideEta-l.currentTime)/l.maxHideTime*100;d.style.width=c+"%",(Math.round(c)<0||"object"!=typeof e)&&(clearTimeout(r),i.apply())}}};t.timeout>0&&(l.maxHideTime=parseFloat(t.timeout),l.hideEta=(new Date).getTime()+l.maxHideTime,r=setInterval(l.updateProgress,10))};return t.destroy=function(){d(document.querySelectorAll("."+n+"-wrapper"),function(e,t){e.remove()}),d(document.querySelectorAll("."+n),function(e,t){e.remove()}),document.removeEventListener(n+"-open",{},!1),document.removeEventListener(n+"-close",{},!1),a={}},t.settings=function(e){t.destroy(),a=e,r=l(r,e||{})},t.info=function(e){var t={color:"blue",icon:"ico-info"},n=l(a,e||{});n=l(t,n||{}),this.show(n)},t.success=function(e){var t={color:"green",icon:"ico-check"},n=l(a,e||{});n=l(t,n||{}),this.show(n)},t.warning=function(e){var t={color:"yellow",icon:"ico-warning"},n=l(a,e||{});n=l(t,n||{}),this.show(n)},t.error=function(e){var t={color:"red",icon:"ico-error"},n=l(a,e||{});n=l(t,n||{}),this.show(n)},t.hide=function(e,t){var o=l(r,e||{});if("object"!=typeof t&&(t=document.querySelector(t)),t.classList.add(n+"-closed"),(o.transitionIn||o.transitionInMobile)&&t.classList.remove(o.transitionIn,o.transitionInMobile),o.transitionOut||o.transitionOutMobile){i||window.innerWidth<=s?o.transitionOutMobile.length>0&&t.classList.add(o.transitionOutMobile):o.transitionOut.length>0&&t.classList.add(o.transitionOut);var a=t.parentNode.offsetHeight;t.parentNode.style.height=a+"px",t.style.pointerEvents="none",i||window.innerWidth<=s||(t.parentNode.style.transitionDelay="0.2s"),setTimeout(function(){t.parentNode.style.height="0px",window.setTimeout(function(){t.parentNode.remove()},1e3)},200)}else t.parentNode.remove();if(o["class"])try{var d;window.CustomEvent?d=new CustomEvent("iziToast-close",{detail:{"class":o["class"]}}):(d=document.createEvent("CustomEvent"),d.initCustomEvent("iziToast-close",!0,!0,{"class":o["class"]})),document.dispatchEvent(d)}catch(c){console.warn(c)}"undefined"!=typeof o.onClose&&o.onClose.apply()},t.show=function(e){var t=this,p=l(a,e||{});p=l(r,p);var m=document.createElement("div");m.classList.add(n+"-capsule");var h=document.createElement("div");if(h.classList.add(n),i||window.innerWidth<=s?p.transitionInMobile.length>0&&h.classList.add(p.transitionInMobile):p.transitionIn.length>0&&h.classList.add(p.transitionIn),p.rtl&&h.classList.add(n+"-rtl"),p.color.length>0&&("#"==p.color.substring(0,1)||"rgb"==p.color.substring(0,3)||"hsl"==p.color.substring(0,3)?h.style.background=p.color:h.classList.add(n+"-color-"+p.color)),p["class"]&&h.classList.add(p["class"]),p.image){var v=document.createElement("div");v.classList.add(n+"-cover"),v.style.width=p.imageWidth+"px",v.style.backgroundImage="url("+p.image+")",h.appendChild(v)}isNaN(p.zindex)?console.warn("["+n+"] Invalid zIndex."):h.style.zIndex=p.zindex;var f;if(p.close?(f=document.createElement("button"),f.classList.add(n+"-close"),h.appendChild(f)):p.rtl?h.style.paddingLeft="30px":h.style.paddingRight="30px",p.progressBar){var g=document.createElement("div");g.classList.add(n+"-progressbar");var y=document.createElement("div");y.style.background=p.progressBarColor,g.appendChild(y),h.appendChild(g),setTimeout(function(){u(h,p,function(){t.hide(p,h)})},300)}else p.progressBar===!1&&p.timeout>0&&setTimeout(function(){t.hide(p,h)},p.timeout);var w=document.createElement("div");if(w.classList.add(n+"-body"),p.image&&(p.rtl?w.style.marginRight=p.imageWidth+10+"px":w.style.marginLeft=p.imageWidth+10+"px"),p.icon){var b=document.createElement("i");b.setAttribute("class",n+"-icon "+p.icon),p.iconText&&b.appendChild(document.createTextNode(p.iconText)),p.rtl?w.style.paddingRight="33px":w.style.paddingLeft="33px",p.iconColor&&(b.style.color=p.iconColor),w.appendChild(b)}var L=document.createElement("strong");L.appendChild(document.createTextNode(p.title));var C=document.createElement("p");C.appendChild(document.createTextNode(p.message)),p.layout>1&&h.classList.add(n+"-layout"+p.layout),p.balloon&&h.classList.add(n+"-balloon"),w.appendChild(L),w.appendChild(C);var E;if(p.buttons.length>0){E=document.createElement("div"),E.classList.add(n+"-buttons"),C.style.marginRight="15px";var T=0;d(p.buttons,function(e,n){E.appendChild(c(e[0]));var i=E.childNodes;i[T].addEventListener("click",function(n){n.preventDefault();var i=e[1];return new i(t,h)}),T++}),w.appendChild(E)}h.appendChild(w),m.style.visibility="hidden",m.style.height="0px",m.appendChild(h),setTimeout(function(){var e=h.offsetHeight,t=h.currentStyle||window.getComputedStyle(h),n=t.marginTop;n=n.split("px"),n=parseInt(n[0]);var i=t.marginBottom;i=i.split("px"),i=parseInt(i[0]),m.style.visibility="",m.style.height=e+i+n+"px",setTimeout(function(){m.style.height="auto"},1e3)},100);var x,I=p.position;if(p.target)x=document.querySelector(p.target),x.classList.add(n+"-target"),x.appendChild(m);else{if(-1==o.indexOf(p.position))return void console.warn("["+n+"] Incorrect position.\nIt can be › "+o);I=i||window.innerWidth<=s?"bottomLeft"==p.position||"bottomRight"==p.position||"bottomCenter"==p.position?n+"-wrapper-bottomCenter":"topLeft"==p.position||"topRight"==p.position||"topCenter"==p.position?n+"-wrapper-topCenter":n+"-wrapper-center":n+"-wrapper-"+I,x=document.querySelector("."+n+"-wrapper."+I),x||(x=document.createElement("div"),x.classList.add(n+"-wrapper"),x.classList.add(I),document.body.appendChild(x)),"topLeft"==p.position||"topCenter"==p.position||"topRight"==p.position?x.insertBefore(m,x.firstChild):x.appendChild(m)}p.onOpen.apply();try{var O;window.CustomEvent?O=new CustomEvent("iziToast-open",{detail:{"class":p["class"]}}):(O=document.createEvent("CustomEvent"),O.initCustomEvent("iziToast-open",!0,!0,{"class":p["class"]})),document.dispatchEvent(O)}catch(N){console.warn(N)}if(p.animateInside){h.classList.add(n+"-animateInside");var M=200,z=100,H=300;if("bounceInLeft"==p.transitionIn&&(M=400,z=200,H=400),window.setTimeout(function(){L.classList.add("slideIn")},M),window.setTimeout(function(){C.classList.add("slideIn")},z),p.icon&&window.setTimeout(function(){b.classList.add("revealIn")},H),p.buttons.length>0&&E){var R=150;d(E.childNodes,function(e,t){window.setTimeout(function(){e.classList.add("revealIn")},R),R+=R})}}f&&f.addEventListener("click",function(e){e.target;t.hide(p,h)}),p.pauseOnHover&&(h.addEventListener("mouseenter",function(e){this.classList.add(n+"-paused")}),h.addEventListener("mouseleave",function(e){this.classList.remove(n+"-paused")})),p.resetOnHover&&(h.addEventListener("mouseenter",function(e){this.classList.add(n+"-reseted")}),h.addEventListener("mouseleave",function(e){this.classList.remove(n+"-reseted")}))},t});
!function(e,t){"function"==typeof define&&define.amd?define([],t(e)):"object"==typeof exports?module.exports=t(e):e.iziToast=t(e)}("undefined"!=typeof global?global:this.window||this.global,function(e){"use strict";var t={},n="iziToast",i=!!/Mobi/.test(navigator.userAgent),o=["bottomRight","bottomLeft","bottomCenter","topRight","topLeft","topCenter","center"],s=568,a={},r={"class":"",title:"",message:"",color:"",icon:"",iconText:"",iconColor:"",image:"",imageWidth:50,zindex:99999,layout:1,balloon:!1,close:!0,rtl:!1,position:"bottomRight",target:"",timeout:5e3,pauseOnHover:!0,resetOnHover:!1,progressBar:!0,progressBarColor:"",animateInside:!0,buttons:{},transitionIn:"fadeInUp",transitionOut:"fadeOut",transitionInMobile:"fadeInUp",transitionOutMobile:"fadeOutDown",onOpen:function(){},onClose:function(){}};"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)});var d=function(e,t,n){if("[object Object]"===Object.prototype.toString.call(e))for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(n,e[i],i,e);else if(e)for(var o=0,s=e.length;s>o;o++)t.call(n,e[o],o,e)},l=function(e,t){var n={};return d(e,function(t,i){n[i]=e[i]}),d(t,function(e,i){n[i]=t[i]}),n},c=function(e){var t=document.createDocumentFragment(),n=document.createElement("div");for(n.innerHTML=e;n.firstChild;)t.appendChild(n.firstChild);return t},u=function(e,t,i){var o=!1,s=!1,a=!1,r=null,d=e.querySelector("."+n+"-progressbar div"),l={hideEta:null,maxHideTime:null,currentTime:(new Date).getTime(),updateProgress:function(){if(o=!!e.classList.contains(n+"-paused"),s=!!e.classList.contains(n+"-reseted"),a=!!e.classList.contains(n+"-closed"),s&&(clearTimeout(r),d.style.width="100%",u(e,t,i),e.classList.remove(n+"-reseted")),a&&(clearTimeout(r),e.classList.remove(n+"-closed")),!o&&!s&&!a){l.currentTime=l.currentTime+10;var c=(l.hideEta-l.currentTime)/l.maxHideTime*100;d.style.width=c+"%",(Math.round(c)<0||"object"!=typeof e)&&(clearTimeout(r),i.apply())}}};t.timeout>0&&(l.maxHideTime=parseFloat(t.timeout),l.hideEta=(new Date).getTime()+l.maxHideTime,r=setInterval(l.updateProgress,10))};return t.destroy=function(){d(document.querySelectorAll("."+n+"-wrapper"),function(e,t){e.remove()}),d(document.querySelectorAll("."+n),function(e,t){e.remove()}),document.removeEventListener(n+"-open",{},!1),document.removeEventListener(n+"-close",{},!1),a={}},t.settings=function(e){t.destroy(),a=e,r=l(r,e||{})},t.info=function(e){var t={color:"blue",icon:"ico-info"},n=l(a,e||{});n=l(t,n||{}),this.show(n)},t.success=function(e){var t={color:"green",icon:"ico-check"},n=l(a,e||{});n=l(t,n||{}),this.show(n)},t.warning=function(e){var t={color:"yellow",icon:"ico-warning"},n=l(a,e||{});n=l(t,n||{}),this.show(n)},t.error=function(e){var t={color:"red",icon:"ico-error"},n=l(a,e||{});n=l(t,n||{}),this.show(n)},t.hide=function(e,t,o){var a=l(r,e||{}),d=o||!1;if("object"!=typeof t&&(t=document.querySelector(t)),t.classList.add(n+"-closed"),(a.transitionIn||a.transitionInMobile)&&t.classList.remove(a.transitionIn,a.transitionInMobile),a.transitionOut||a.transitionOutMobile){i||window.innerWidth<=s?a.transitionOutMobile.length>0&&t.classList.add(a.transitionOutMobile):a.transitionOut.length>0&&t.classList.add(a.transitionOut);var c=t.parentNode.offsetHeight;t.parentNode.style.height=c+"px",t.style.pointerEvents="none",i||window.innerWidth<=s||(t.parentNode.style.transitionDelay="0.2s"),setTimeout(function(){t.parentNode.style.height="0px",window.setTimeout(function(){t.parentNode.remove()},1e3)},200)}else t.parentNode.remove();if(a["class"])try{var u;window.CustomEvent?u=new CustomEvent("iziToast-close",{detail:{"class":a["class"]}}):(u=document.createEvent("CustomEvent"),u.initCustomEvent("iziToast-close",!0,!0,{"class":a["class"]})),document.dispatchEvent(u)}catch(p){console.warn(p)}"undefined"!=typeof a.onClose&&a.onClose.apply(null,[a,t,d])},t.show=function(e){var t=this,p=l(a,e||{});p=l(r,p);var m=document.createElement("div");m.classList.add(n+"-capsule");var h=document.createElement("div");if(h.classList.add(n),i||window.innerWidth<=s?p.transitionInMobile.length>0&&h.classList.add(p.transitionInMobile):p.transitionIn.length>0&&h.classList.add(p.transitionIn),p.rtl&&h.classList.add(n+"-rtl"),p.color.length>0&&("#"==p.color.substring(0,1)||"rgb"==p.color.substring(0,3)||"hsl"==p.color.substring(0,3)?h.style.background=p.color:h.classList.add(n+"-color-"+p.color)),p["class"]&&h.classList.add(p["class"]),p.image){var v=document.createElement("div");v.classList.add(n+"-cover"),v.style.width=p.imageWidth+"px",v.style.backgroundImage="url("+p.image+")",h.appendChild(v)}var f;if(p.close?(f=document.createElement("button"),f.classList.add(n+"-close"),h.appendChild(f)):p.rtl?h.style.paddingLeft="30px":h.style.paddingRight="30px",p.progressBar){var g=document.createElement("div");g.classList.add(n+"-progressbar");var y=document.createElement("div");y.style.background=p.progressBarColor,g.appendChild(y),h.appendChild(g),setTimeout(function(){u(h,p,function(){t.hide(p,h)})},300)}else p.progressBar===!1&&p.timeout>0&&setTimeout(function(){t.hide(p,h)},p.timeout);var w=document.createElement("div");if(w.classList.add(n+"-body"),p.image&&(p.rtl?w.style.marginRight=p.imageWidth+10+"px":w.style.marginLeft=p.imageWidth+10+"px"),p.icon){var b=document.createElement("i");b.setAttribute("class",n+"-icon "+p.icon),p.iconText&&b.appendChild(document.createTextNode(p.iconText)),p.rtl?w.style.paddingRight="33px":w.style.paddingLeft="33px",p.iconColor&&(b.style.color=p.iconColor),w.appendChild(b)}var L=document.createElement("strong");L.appendChild(document.createTextNode(p.title));var C=document.createElement("p");C.appendChild(document.createTextNode(p.message)),p.layout>1&&h.classList.add(n+"-layout"+p.layout),p.balloon&&h.classList.add(n+"-balloon"),w.appendChild(L),w.appendChild(C);var E;if(p.buttons.length>0){E=document.createElement("div"),E.classList.add(n+"-buttons"),C.style.marginRight="15px";var T=0;d(p.buttons,function(e,n){E.appendChild(c(e[0]));var i=E.childNodes;i[T].addEventListener("click",function(n){n.preventDefault();var i=e[1];return new i(t,h)}),T++}),w.appendChild(E)}h.appendChild(w),m.style.visibility="hidden",m.style.height="0px",m.appendChild(h),setTimeout(function(){var e=h.offsetHeight,t=h.currentStyle||window.getComputedStyle(h),n=t.marginTop;n=n.split("px"),n=parseInt(n[0]);var i=t.marginBottom;i=i.split("px"),i=parseInt(i[0]),m.style.visibility="",m.style.height=e+i+n+"px",setTimeout(function(){m.style.height="auto"},1e3)},100);var x,I=p.position;if(p.target)x=document.querySelector(p.target),x.classList.add(n+"-target"),x.appendChild(m);else{if(-1==o.indexOf(p.position))return void console.warn("["+n+"] Incorrect position.\nIt can be › "+o);I=i||window.innerWidth<=s?"bottomLeft"==p.position||"bottomRight"==p.position||"bottomCenter"==p.position?n+"-wrapper-bottomCenter":"topLeft"==p.position||"topRight"==p.position||"topCenter"==p.position?n+"-wrapper-topCenter":n+"-wrapper-center":n+"-wrapper-"+I,x=document.querySelector("."+n+"-wrapper."+I),x||(x=document.createElement("div"),x.classList.add(n+"-wrapper"),x.classList.add(I),document.body.appendChild(x)),"topLeft"==p.position||"topCenter"==p.position||"topRight"==p.position?x.insertBefore(m,x.firstChild):x.appendChild(m)}isNaN(p.zindex)?console.warn("["+n+"] Invalid zIndex."):x.style.zIndex=p.zindex,p.onOpen.apply(null,[p,h]);try{var O;window.CustomEvent?O=new CustomEvent("iziToast-open",{detail:{"class":p["class"]}}):(O=document.createEvent("CustomEvent"),O.initCustomEvent("iziToast-open",!0,!0,{"class":p["class"]})),document.dispatchEvent(O)}catch(N){console.warn(N)}if(p.animateInside){h.classList.add(n+"-animateInside");var M=200,z=100,H=300;if("bounceInLeft"==p.transitionIn&&(M=400,z=200,H=400),window.setTimeout(function(){L.classList.add("slideIn")},M),window.setTimeout(function(){C.classList.add("slideIn")},z),p.icon&&window.setTimeout(function(){b.classList.add("revealIn")},H),p.buttons.length>0&&E){var R=150;d(E.childNodes,function(e,t){window.setTimeout(function(){e.classList.add("revealIn")},R),R+=R})}}f&&f.addEventListener("click",function(e){e.target;t.hide(p,h,!0)}),p.pauseOnHover&&(h.addEventListener("mouseenter",function(e){this.classList.add(n+"-paused")}),h.addEventListener("mouseleave",function(e){this.classList.remove(n+"-paused")})),p.resetOnHover&&(h.addEventListener("mouseenter",function(e){this.classList.add(n+"-reseted")}),h.addEventListener("mouseleave",function(e){this.classList.remove(n+"-reseted")}))},t});
{
"name": "izitoast",
"version": "1.0.2b",
"version": "1.0.2c",
"description": "Elegant, responsive, flexible and lightweight notification plugin with no dependencies.",
"readmeFilename": "README.md",
"main": "js/iziToast.js",
"main": "dist/js/iziToast.js",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

@@ -0,0 +0,0 @@ # [iziToast](http://izitoast.dolce.ninja)

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc