Comparing version 3.8.5 to 3.9.0
@@ -1,1 +0,1 @@ | ||
var notie=function(){function e(e){for(var t in e)L[t]=e[t]}function t(e,t,i){L.colorText.length>0&&(A.style.color=L.colorText),H(),J++,setTimeout(function(){J--},L.animationDelay+10),1===J&&(Y?n(function(){o(e,t,i)}):o(e,t,i))}function o(e,t,o){Y=!0;var i=0;switch(i="undefined"==typeof o||0===o?864e5:o>0&&1>o?1e3:1e3*o,D(N,"notie-background-success"),D(N,"notie-background-warning"),D(N,"notie-background-error"),D(N,"notie-background-info"),e){case 1:case"success":L.colorSuccess.length>0?N.style.backgroundColor=L.colorSuccess:x(N,"notie-background-success");break;case 2:case"warning":L.colorWarning.length>0?N.style.backgroundColor=L.colorWarning:x(N,"notie-background-warning");break;case 3:case"error":L.colorError.length>0?N.style.backgroundColor=L.colorError:x(N,"notie-background-error");break;case 4:case"info":L.colorInfo.length>0?N.style.backgroundColor=L.colorInfo:x(N,"notie-background-info")}A.innerHTML=t,N.style.top="-10000px",N.style.display="table",N.style.top="-"+N.offsetHeight-5+"px",F=setTimeout(function(){x(N,"notie-transition"),N.style.top=0,W=setTimeout(function(){n(function(){})},i)},20)}function n(e){clearTimeout(F),clearTimeout(W),N.style.top="-"+N.offsetHeight-5+"px",setTimeout(function(){D(N,"notie-transition"),N.style.top="-10000px",Y=!1,e&&e()},L.animationDelay+10)}function i(e,t,o,i,l){L.colorInfo.length>0&&(V.style.backgroundColor=L.colorInfo),L.colorSuccess.length>0&&(z.style.backgroundColor=L.colorSuccess),L.colorError.length>0&&(B.style.backgroundColor=L.colorError),L.colorText.length>0&&(j.style.color=L.colorText,K.style.color=L.colorText,R.style.color=L.colorText),H(),Y?n(function(){c(e,t,o,i,l)}):c(e,t,o,i,l)}function c(e,t,o,n,i){function c(){j.innerHTML=e,K.innerHTML=t,R.innerHTML=o,O.style.top="-10000px",O.style.display="table",O.style.top="-"+O.offsetHeight-5+"px",$.style.display="block",setTimeout(function(){x(O,"notie-transition"),O.style.top=0,$.style.opacity="0.75",setTimeout(function(){q=!0},L.animationDelay+10)},20)}M(),z.onclick=function(){l(),n&&setTimeout(function(){n()},L.animationDelay+10)},B.onclick=function(){l(),i&&setTimeout(function(){i()},L.animationDelay+10)},q?(l(),setTimeout(function(){c()},L.animationDelay+10)):c()}function l(){O.style.top="-"+O.offsetHeight-5+"px",$.style.opacity="0",setTimeout(function(){D(O,"notie-transition"),O.style.top="-10000px",$.style.display="none",w(),q=!1},L.animationDelay+10)}function a(e,t,o,i,c,l){L.colorInfo.length>0&&(Q.style.backgroundColor=L.colorInfo),L.colorSuccess.length>0&&(X.style.backgroundColor=L.colorSuccess),L.colorError.length>0&&(Z.style.backgroundColor=L.colorError),L.colorText.length>0&&(_.style.color=L.colorText,ee.style.color=L.colorText,te.style.color=L.colorText),H(),"undefined"!=typeof e.type&&e.type?U.setAttribute("type",e.type):U.setAttribute("type","text"),"undefined"!=typeof e.placeholder&&e.placeholder&&U.setAttribute("placeholder",e.placeholder),"undefined"!=typeof e.prefilledValue&&e.prefilledValue?U.value=e.prefilledValue:U.value="",Y?n(function(){r(t,o,i,c,l)}):r(t,o,i,c,l)}function r(e,t,o,n,i){function c(){_.innerHTML=e,ee.innerHTML=t,te.innerHTML=o,G.style.top="-10000px",G.style.display="table",G.style.top="-"+G.offsetHeight-5+"px",P.style.display="block",setTimeout(function(){x(G,"notie-transition"),G.style.top=0,P.style.opacity="0.75",setTimeout(function(){oe=!0,U.focus()},L.animationDelay+10)},20)}M(),X.onclick=function(){d(),n&&setTimeout(function(){n(U.value)},L.animationDelay+10)},Z.onclick=function(){d(),i&&setTimeout(function(){i(U.value)},L.animationDelay+10)},oe?(d(),setTimeout(function(){c()},L.animationDelay+10)):c()}function d(){G.style.top="-"+G.offsetHeight-5+"px",P.style.opacity="0",setTimeout(function(){D(G,"notie-transition"),P.style.display="none",G.style.top="-10000px",w(),oe=!1},L.animationDelay+10)}function s(e,t,o){L.colorInfo.length>0&&(ie.style.backgroundColor=L.colorInfo),L.colorNeutral.length>0&&(re.style.backgroundColor=L.colorNeutral),L.colorText.length>0&&(ce.style.color=L.colorText,re.style.color=L.colorText);for(var i=[],c=0;c<arguments.length-3;c++)i[c]=arguments[c+3];if(i.length!==o.length)throw new Error("notie.select number of choices must match number of functions");H(),Y?n(function(){u(e,t,o,i)}):u(e,t,o,i)}function u(e,t,o,n){function i(e){ce.innerHTML=e,ne.style.bottom="-10000px",ne.style.display="table",ne.style.bottom="-"+ne.offsetHeight-5+"px",le.style.display="block",setTimeout(function(){x(ne,"notie-transition"),ne.style.bottom=0,le.style.opacity="0.75",setTimeout(function(){de=!0},L.animationDelay+10)},20)}M(),document.getElementById("notie-select-choices").innerHTML="",re.innerHTML=t;for(var c,l=0;l<o.length;l++){var a=document.createElement("div");if(a.innerHTML=o[l].title,x(a,"notie-select-choice"),ae.appendChild(a),L.colorText.length>0&&(a.style.color=L.colorText),o[l].type)switch(o[l].type){case 1:L.colorSuccess.length>0?a.style.backgroundColor=L.colorSuccess:x(a,"notie-background-success");break;case 2:L.colorWarning.length>0?a.style.backgroundColor=L.colorWarning:x(a,"notie-background-warning");break;case 3:L.colorError.length>0?a.style.backgroundColor=L.colorError:x(a,"notie-background-error");break;case 4:L.colorInfo.length>0?a.style.backgroundColor=L.colorInfo:x(a,"notie-background-info")}else o[l].color&&(a.style.backgroundColor=o[l].color);a.style.backgroundColor=window.getComputedStyle(a).backgroundColor,l>0&&a.style.backgroundColor===c.style.backgroundColor&&x(c,"notie-select-choice-bottom-border"),a.onclick=function(e){return function(){m(),setTimeout(function(){n[e]()},L.animationDelay+10)}}(l),c=a}de?(m(),setTimeout(function(){i(e)},L.animationDelay+10)):i(e)}function m(){ne.style.bottom="-"+ne.offsetHeight-5+"px",le.style.opacity="0",setTimeout(function(){D(ne,"notie-transition"),ne.style.bottom="-10000px",le.style.display="none",w(),de=!1},L.animationDelay+10)}function p(){return Y||q||oe||de||Ne}function y(e){L.colorInfo.length>0&&(me.style.backgroundColor=L.colorInfo),L.colorSuccess.length>0&&(xe.style.backgroundColor=L.colorSuccess),L.colorError.length>0&&(De.style.backgroundColor=L.colorError),L.colorText.length>0&&(me.style.color=L.colorText),H(),Y?n(function(){f(e)}):f(e)}function f(e){function t(){Me=e.initial||new Date,h(Me),xe.innerHTML=e.yesText||"OK",De.innerHTML=e.noText||"Cancel",se.style.top="-10000px",se.style.display="table",se.style.top="-"+se.offsetHeight-5+"px",He.style.display="block",setTimeout(function(){x(se,"notie-transition"),se.style.top=0,He.style.opacity="0.75",setTimeout(function(){Ne=!0},L.animationDelay+10)},20)}M(),xe.onclick=function(){E(),e.yesCallback&&setTimeout(function(){e.yesCallback(Me)},L.animationDelay+10)},De.onclick=function(){E(),e.noCallback&&setTimeout(function(){e.noCallback(Me)},L.animationDelay+10)},Ne?(E(),setTimeout(function(){t()},L.animationDelay+10)):t()}function h(e){be.innerHTML=L.dateMonths[e.getMonth()],ve.innerHTML=e.getDate(),ke.innerHTML=e.getFullYear()}function g(){Me.setMonth(Me.getMonth()-1),h(Me)}function b(){Me.setMonth(Me.getMonth()+1),h(Me)}function v(){Me.setDate(Me.getDate()-1),h(Me)}function k(){Me.setDate(Me.getDate()+1),h(Me)}function C(){Me.setFullYear(Me.getFullYear()-1),h(Me)}function T(){Me.setFullYear(Me.getFullYear()+1),h(Me)}function E(){se.style.top="-"+se.offsetHeight-5+"px",He.style.opacity="0",setTimeout(function(){D(se,"notie-transition"),se.style.top="-10000px",He.style.display="none",w(),Ne=!1},L.animationDelay+10)}function x(e,t){e.classList?e.classList.add(t):e.className+=" "+t}function D(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}function H(){document.activeElement&&document.activeElement.blur()}function M(){we=document.body.style.height,Le=document.body.style.overflow,document.body.style.height="100%",document.body.style.overflow="hidden"}function w(){document.body.style.height=we,document.body.style.overflow=Le}var L={colorSuccess:"",colorWarning:"",colorError:"",colorInfo:"",colorNeutral:"",colorText:"",dateMonths:["January","February","March","April","May","June","July","August","September","October","November","December"],animationDelay:300,backgroundClickDismiss:!0},N=document.createElement("div");N.id="notie-alert-outer",N.onclick=function(){n()},document.body.appendChild(N);var I=document.createElement("div");I.id="notie-alert-inner",N.appendChild(I);var S=document.createElement("div");S.id="notie-alert-content",I.appendChild(S);var A=document.createElement("span");A.id="notie-alert-text",S.appendChild(A);var F,W,Y=!1,J=0,O=document.createElement("div");O.id="notie-confirm-outer";var V=document.createElement("div");V.id="notie-confirm-inner",O.appendChild(V);var j=document.createElement("span");j.id="notie-confirm-text",V.appendChild(j);var z=document.createElement("div");z.id="notie-confirm-yes",O.appendChild(z);var B=document.createElement("div");B.id="notie-confirm-no",O.appendChild(B);var K=document.createElement("span");K.id="notie-confirm-text-yes",z.appendChild(K);var R=document.createElement("span");R.id="notie-confirm-text-no",B.appendChild(R);var $=document.createElement("div");$.id="notie-confirm-background",x($,"notie-transition"),$.onclick=function(){L.backgroundClickDismiss&&l()},document.body.appendChild(O),document.body.appendChild($);var q=!1,G=document.createElement("div");G.id="notie-input-outer";var P=document.createElement("div");P.id="notie-input-background",x(P,"notie-transition");var Q=document.createElement("div");Q.id="notie-input-inner",G.appendChild(Q);var U=document.createElement("input");U.id="notie-input-field",U.setAttribute("autocomplete","off"),U.setAttribute("autocorrect","off"),U.setAttribute("autocapitalize","off"),U.setAttribute("spellcheck","false"),G.appendChild(U);var X=document.createElement("div");X.id="notie-input-yes",G.appendChild(X);var Z=document.createElement("div");Z.id="notie-input-no",G.appendChild(Z);var _=document.createElement("span");_.id="notie-input-text",Q.appendChild(_);var ee=document.createElement("span");ee.id="notie-input-text-yes",X.appendChild(ee);var te=document.createElement("span");te.id="notie-input-text-no",Z.appendChild(te),document.body.appendChild(G),document.body.appendChild(P),P.onclick=function(){L.backgroundClickDismiss&&d()};var oe=!1,ne=document.createElement("div");ne.id="notie-select-outer";var ie=document.createElement("div");ie.id="notie-select-inner",ne.appendChild(ie);var ce=document.createElement("span");ce.id="notie-select-text",ie.appendChild(ce);var le=document.createElement("div");le.id="notie-select-background",x(le,"notie-transition");var ae=document.createElement("div");ae.id="notie-select-choices",ne.appendChild(ae);var re=document.createElement("div");re.id="notie-select-cancel",ne.appendChild(re),document.body.appendChild(ne),document.body.appendChild(le),le.onclick=function(){L.backgroundClickDismiss&&m()},re.onclick=function(){m()};var de=!1,se=document.createElement("div");se.id="notie-date-outer";var ue=document.createElement("div");ue.id="notie-date-selector",se.appendChild(ue);var me=document.createElement("div");me.id="notie-date-inner",se.appendChild(me);var pe='<div class="notie-date-arrow-up"></div>',ye='<div class="notie-date-arrow-down"></div>',fe=document.createElement("div");fe.className="notie-date-up",fe.innerHTML=pe,ue.appendChild(fe),fe.onclick=g;var he=document.createElement("div");he.className="notie-date-up",he.innerHTML=pe,ue.appendChild(he),he.onclick=v;var ge=document.createElement("div");ge.className="notie-date-up",ge.innerHTML=pe,ue.appendChild(ge),ge.onclick=C;var be=document.createElement("div");be.className="notie-date-text",ue.appendChild(be);var ve=document.createElement("div");ve.className="notie-date-text",ue.appendChild(ve);var ke=document.createElement("div");ke.className="notie-date-text",ue.appendChild(ke);var Ce=document.createElement("div");Ce.className="notie-date-down",Ce.innerHTML=ye,ue.appendChild(Ce),Ce.onclick=b;var Te=document.createElement("div");Te.className="notie-date-down",Te.innerHTML=ye,ue.appendChild(Te),Te.onclick=k;var Ee=document.createElement("div");Ee.className="notie-date-down",Ee.innerHTML=ye,ue.appendChild(Ee),Ee.onclick=T;var xe=document.createElement("div");xe.id="notie-date-yes",me.appendChild(xe);var De=document.createElement("div");De.id="notie-date-no",me.appendChild(De);var He=document.createElement("div");He.id="notie-date-background",x(He,"notie-transition"),He.onclick=function(){L.backgroundClickDismiss&&E()},document.body.appendChild(se),document.body.appendChild(He);var Me,we,Le,Ne=!1;return window.addEventListener("keydown",function(e){var t=13===e.which||13===e.keyCode,o=27===e.which||27===e.keyCode;Y?(t||o)&&n():q?t?z.click():o&&l():oe?t?X.click():o&&d():de?o&&m():Ne&&(t?xe.click():o&&E())}),{setOptions:e,alert:t,alertHide:n,confirm:i,input:a,select:s,date:y,isShowing:p}}();"object"==typeof module&&module.exports&&(module.exports=notie); | ||
var notie=function(){function e(e){for(var t in e)L[t]=e[t]}function t(e,t,i){L.colorText.length>0&&(A.style.color=L.colorText),H(),J++,setTimeout(function(){J--},L.animationDelay+10),1===J&&(Y?n(function(){o(e,t,i)}):o(e,t,i))}function o(e,t,o){Y=!0;var i=0;switch(i="undefined"==typeof o||0===o?864e5:o>0&&1>o?1e3:1e3*o,D(N,"notie-background-success"),D(N,"notie-background-warning"),D(N,"notie-background-error"),D(N,"notie-background-info"),e){case 1:case"success":L.colorSuccess.length>0?N.style.backgroundColor=L.colorSuccess:x(N,"notie-background-success");break;case 2:case"warning":L.colorWarning.length>0?N.style.backgroundColor=L.colorWarning:x(N,"notie-background-warning");break;case 3:case"error":L.colorError.length>0?N.style.backgroundColor=L.colorError:x(N,"notie-background-error");break;case 4:case"info":L.colorInfo.length>0?N.style.backgroundColor=L.colorInfo:x(N,"notie-background-info")}A.innerHTML=t,N.style.top="-10000px",N.style.display="table",N.style.top="-"+N.offsetHeight-5+"px",F=setTimeout(function(){x(N,"notie-transition"),N.style.top=0,W=setTimeout(function(){n(function(){})},i)},20)}function n(e){clearTimeout(F),clearTimeout(W),N.style.top="-"+N.offsetHeight-5+"px",setTimeout(function(){D(N,"notie-transition"),N.style.top="-10000px",Y=!1,e&&e()},L.animationDelay+10)}function i(e,t,o,i,l){L.colorInfo.length>0&&(V.style.backgroundColor=L.colorInfo),L.colorSuccess.length>0&&(z.style.backgroundColor=L.colorSuccess),L.colorError.length>0&&(B.style.backgroundColor=L.colorError),L.colorText.length>0&&(j.style.color=L.colorText,K.style.color=L.colorText,R.style.color=L.colorText),H(),Y?n(function(){c(e,t,o,i,l)}):c(e,t,o,i,l)}function c(e,t,o,n,i){function c(){j.innerHTML=e,K.innerHTML=t,R.innerHTML=o,O.style.top="-10000px",O.style.display="table",O.style.top="-"+O.offsetHeight-5+"px",$.style.display="block",setTimeout(function(){x(O,"notie-transition"),O.style.top=0,$.style.opacity="0.75",setTimeout(function(){q=!0},L.animationDelay+10)},20)}M(),z.onclick=function(){l(),n&&setTimeout(function(){n()},L.animationDelay+10)},B.onclick=function(){l(),i&&setTimeout(function(){i()},L.animationDelay+10)},q?(l(),setTimeout(function(){c()},L.animationDelay+10)):c()}function l(){O.style.top="-"+O.offsetHeight-5+"px",$.style.opacity="0",setTimeout(function(){D(O,"notie-transition"),O.style.top="-10000px",$.style.display="none",w(),q=!1},L.animationDelay+10)}function a(e,t,o,i,c,l){L.colorInfo.length>0&&(Q.style.backgroundColor=L.colorInfo),L.colorSuccess.length>0&&(X.style.backgroundColor=L.colorSuccess),L.colorError.length>0&&(Z.style.backgroundColor=L.colorError),L.colorText.length>0&&(_.style.color=L.colorText,ee.style.color=L.colorText,te.style.color=L.colorText),H(),"undefined"!=typeof e.type&&e.type?U.setAttribute("type",e.type):U.setAttribute("type","text"),"undefined"!=typeof e.placeholder&&e.placeholder&&U.setAttribute("placeholder",e.placeholder),"undefined"!=typeof e.prefilledValue&&e.prefilledValue?U.value=e.prefilledValue:U.value="",Y?n(function(){r(t,o,i,c,l)}):r(t,o,i,c,l)}function r(e,t,o,n,i){function c(){_.innerHTML=e,ee.innerHTML=t,te.innerHTML=o,G.style.top="-10000px",G.style.display="table",G.style.top="-"+G.offsetHeight-5+"px",P.style.display="block",setTimeout(function(){x(G,"notie-transition"),G.style.top=0,P.style.opacity="0.75",setTimeout(function(){oe=!0,U.focus()},L.animationDelay+10)},20)}M(),X.onclick=function(){d(),n&&setTimeout(function(){n(U.value)},L.animationDelay+10)},Z.onclick=function(){d(),i&&setTimeout(function(){i(U.value)},L.animationDelay+10)},oe?(d(),setTimeout(function(){c()},L.animationDelay+10)):c()}function d(){G.style.top="-"+G.offsetHeight-5+"px",P.style.opacity="0",setTimeout(function(){D(G,"notie-transition"),P.style.display="none",G.style.top="-10000px",w(),oe=!1},L.animationDelay+10)}function s(e,t,o){L.colorInfo.length>0&&(ie.style.backgroundColor=L.colorInfo),L.colorNeutral.length>0&&(re.style.backgroundColor=L.colorNeutral),L.colorText.length>0&&(ce.style.color=L.colorText,re.style.color=L.colorText),H(),Y?n(function(){u(e,t,o)}):u(e,t,o)}function u(e,t,o){function n(e){ce.innerHTML=e,ne.style.bottom="-10000px",ne.style.display="table",ne.style.bottom="-"+ne.offsetHeight-5+"px",le.style.display="block",setTimeout(function(){x(ne,"notie-transition"),ne.style.bottom=0,le.style.opacity="0.75",setTimeout(function(){de=!0},L.animationDelay+10)},20)}M(),document.getElementById("notie-select-choices").innerHTML="",re.innerHTML=t;for(var i,c=0;c<o.length;c++){var l=document.createElement("div");if(l.innerHTML=o[c].title,x(l,"notie-select-choice"),ae.appendChild(l),L.colorText.length>0&&(l.style.color=L.colorText),o[c].type)switch(o[c].type){case 1:L.colorSuccess.length>0?l.style.backgroundColor=L.colorSuccess:x(l,"notie-background-success");break;case 2:L.colorWarning.length>0?l.style.backgroundColor=L.colorWarning:x(l,"notie-background-warning");break;case 3:L.colorError.length>0?l.style.backgroundColor=L.colorError:x(l,"notie-background-error");break;case 4:L.colorInfo.length>0?l.style.backgroundColor=L.colorInfo:x(l,"notie-background-info")}else o[c].color&&(l.style.backgroundColor=o[c].color);if(l.style.backgroundColor=window.getComputedStyle(l).backgroundColor,c>0&&l.style.backgroundColor===i.style.backgroundColor&&x(i,"notie-select-choice-bottom-border"),!o[c].handler)throw new Error('notie.select choice "'+l.title+'" must have a handler');l.onclick=function(e){return function(){p(),setTimeout(function(){o[e].handler()},L.animationDelay+10)}}(c),i=l}de?(p(),setTimeout(function(){n(e)},L.animationDelay+10)):n(e)}function p(){ne.style.bottom="-"+ne.offsetHeight-5+"px",le.style.opacity="0",setTimeout(function(){D(ne,"notie-transition"),ne.style.bottom="-10000px",le.style.display="none",w(),de=!1},L.animationDelay+10)}function m(){return Y||q||oe||de||Ne}function y(e){L.colorInfo.length>0&&(pe.style.backgroundColor=L.colorInfo),L.colorSuccess.length>0&&(xe.style.backgroundColor=L.colorSuccess),L.colorError.length>0&&(De.style.backgroundColor=L.colorError),L.colorText.length>0&&(pe.style.color=L.colorText),H(),Y?n(function(){f(e)}):f(e)}function f(e){function t(){Me=e.initial||new Date,h(Me),xe.innerHTML=e.yesText||"OK",De.innerHTML=e.noText||"Cancel",se.style.top="-10000px",se.style.display="table",se.style.top="-"+se.offsetHeight-5+"px",He.style.display="block",setTimeout(function(){x(se,"notie-transition"),se.style.top=0,He.style.opacity="0.75",setTimeout(function(){Ne=!0},L.animationDelay+10)},20)}M(),xe.onclick=function(){E(),e.yesCallback&&setTimeout(function(){e.yesCallback(Me)},L.animationDelay+10)},De.onclick=function(){E(),e.noCallback&&setTimeout(function(){e.noCallback(Me)},L.animationDelay+10)},Ne?(E(),setTimeout(function(){t()},L.animationDelay+10)):t()}function h(e){be.innerHTML=L.dateMonths[e.getMonth()],ve.innerHTML=e.getDate(),ke.innerHTML=e.getFullYear()}function g(){Me.setMonth(Me.getMonth()-1),h(Me)}function b(){Me.setMonth(Me.getMonth()+1),h(Me)}function v(){Me.setDate(Me.getDate()-1),h(Me)}function k(){Me.setDate(Me.getDate()+1),h(Me)}function C(){Me.setFullYear(Me.getFullYear()-1),h(Me)}function T(){Me.setFullYear(Me.getFullYear()+1),h(Me)}function E(){se.style.top="-"+se.offsetHeight-5+"px",He.style.opacity="0",setTimeout(function(){D(se,"notie-transition"),se.style.top="-10000px",He.style.display="none",w(),Ne=!1},L.animationDelay+10)}function x(e,t){e.classList?e.classList.add(t):e.className+=" "+t}function D(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}function H(){document.activeElement&&document.activeElement.blur()}function M(){we=document.body.style.height,Le=document.body.style.overflow,document.body.style.height="100%",document.body.style.overflow="hidden"}function w(){document.body.style.height=we,document.body.style.overflow=Le}var L={colorSuccess:"",colorWarning:"",colorError:"",colorInfo:"",colorNeutral:"",colorText:"",dateMonths:["January","February","March","April","May","June","July","August","September","October","November","December"],animationDelay:300,backgroundClickDismiss:!0},N=document.createElement("div");N.id="notie-alert-outer",N.onclick=function(){n()},document.body.appendChild(N);var I=document.createElement("div");I.id="notie-alert-inner",N.appendChild(I);var S=document.createElement("div");S.id="notie-alert-content",I.appendChild(S);var A=document.createElement("span");A.id="notie-alert-text",S.appendChild(A);var F,W,Y=!1,J=0,O=document.createElement("div");O.id="notie-confirm-outer";var V=document.createElement("div");V.id="notie-confirm-inner",O.appendChild(V);var j=document.createElement("span");j.id="notie-confirm-text",V.appendChild(j);var z=document.createElement("div");z.id="notie-confirm-yes",O.appendChild(z);var B=document.createElement("div");B.id="notie-confirm-no",O.appendChild(B);var K=document.createElement("span");K.id="notie-confirm-text-yes",z.appendChild(K);var R=document.createElement("span");R.id="notie-confirm-text-no",B.appendChild(R);var $=document.createElement("div");$.id="notie-confirm-background",x($,"notie-transition"),$.onclick=function(){L.backgroundClickDismiss&&l()},document.body.appendChild(O),document.body.appendChild($);var q=!1,G=document.createElement("div");G.id="notie-input-outer";var P=document.createElement("div");P.id="notie-input-background",x(P,"notie-transition");var Q=document.createElement("div");Q.id="notie-input-inner",G.appendChild(Q);var U=document.createElement("input");U.id="notie-input-field",U.setAttribute("autocomplete","off"),U.setAttribute("autocorrect","off"),U.setAttribute("autocapitalize","off"),U.setAttribute("spellcheck","false"),G.appendChild(U);var X=document.createElement("div");X.id="notie-input-yes",G.appendChild(X);var Z=document.createElement("div");Z.id="notie-input-no",G.appendChild(Z);var _=document.createElement("span");_.id="notie-input-text",Q.appendChild(_);var ee=document.createElement("span");ee.id="notie-input-text-yes",X.appendChild(ee);var te=document.createElement("span");te.id="notie-input-text-no",Z.appendChild(te),document.body.appendChild(G),document.body.appendChild(P),P.onclick=function(){L.backgroundClickDismiss&&d()};var oe=!1,ne=document.createElement("div");ne.id="notie-select-outer";var ie=document.createElement("div");ie.id="notie-select-inner",ne.appendChild(ie);var ce=document.createElement("span");ce.id="notie-select-text",ie.appendChild(ce);var le=document.createElement("div");le.id="notie-select-background",x(le,"notie-transition");var ae=document.createElement("div");ae.id="notie-select-choices",ne.appendChild(ae);var re=document.createElement("div");re.id="notie-select-cancel",ne.appendChild(re),document.body.appendChild(ne),document.body.appendChild(le),le.onclick=function(){L.backgroundClickDismiss&&p()},re.onclick=function(){p()};var de=!1,se=document.createElement("div");se.id="notie-date-outer";var ue=document.createElement("div");ue.id="notie-date-selector",se.appendChild(ue);var pe=document.createElement("div");pe.id="notie-date-inner",se.appendChild(pe);var me='<div class="notie-date-arrow-up"></div>',ye='<div class="notie-date-arrow-down"></div>',fe=document.createElement("div");fe.className="notie-date-up",fe.innerHTML=me,ue.appendChild(fe),fe.onclick=g;var he=document.createElement("div");he.className="notie-date-up",he.innerHTML=me,ue.appendChild(he),he.onclick=v;var ge=document.createElement("div");ge.className="notie-date-up",ge.innerHTML=me,ue.appendChild(ge),ge.onclick=C;var be=document.createElement("div");be.className="notie-date-text",ue.appendChild(be);var ve=document.createElement("div");ve.className="notie-date-text",ue.appendChild(ve);var ke=document.createElement("div");ke.className="notie-date-text",ue.appendChild(ke);var Ce=document.createElement("div");Ce.className="notie-date-down",Ce.innerHTML=ye,ue.appendChild(Ce),Ce.onclick=b;var Te=document.createElement("div");Te.className="notie-date-down",Te.innerHTML=ye,ue.appendChild(Te),Te.onclick=k;var Ee=document.createElement("div");Ee.className="notie-date-down",Ee.innerHTML=ye,ue.appendChild(Ee),Ee.onclick=T;var xe=document.createElement("div");xe.id="notie-date-yes",pe.appendChild(xe);var De=document.createElement("div");De.id="notie-date-no",pe.appendChild(De);var He=document.createElement("div");He.id="notie-date-background",x(He,"notie-transition"),He.onclick=function(){L.backgroundClickDismiss&&E()},document.body.appendChild(se),document.body.appendChild(He);var Me,we,Le,Ne=!1;return window.addEventListener("keydown",function(e){var t=13===e.which||13===e.keyCode,o=27===e.which||27===e.keyCode;Y?(t||o)&&n():q?t?z.click():o&&l():oe?t?X.click():o&&d():de?o&&p():Ne&&(t?xe.click():o&&E())}),{setOptions:e,alert:t,alertHide:n,confirm:i,input:a,select:s,date:y,isShowing:m}}();"object"==typeof module&&module.exports&&(module.exports=notie); |
@@ -5,3 +5,3 @@ { | ||
"author": "Jared Reich", | ||
"version": "3.8.5", | ||
"version": "3.9.0", | ||
"main": "./dist/notie.min.js", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -69,3 +69,3 @@ # notie | ||
notie.select(title(String), cancelText(String), choices(Array of Objects) /*, callback1(Function), callback2(Function), ... */); | ||
notie.select(title(String), cancelText(String), choices(Array of Objects)); | ||
@@ -105,10 +105,4 @@ notie.date({ | ||
prefilledValue: 'jane@doe.com' | ||
}, 'Please enter your email address:', 'Submit', 'Cancel', 'email', 'name@example.com', function(valueEntered) { | ||
}, 'Please enter your email:', 'Submit', 'Cancel', function(valueEntered) { | ||
notie.alert(1, 'You entered: ' + valueEntered, 2); | ||
}); | ||
notie.input({ | ||
type: 'password', | ||
placeholder: 'Enter your password' | ||
}, 'Please enter your password:', 'Submit', 'Cancel', function(valueEntered) { | ||
notie.alert(1, 'You entered: ' + valueEntered, 2); | ||
}, function(valueEntered) { | ||
@@ -120,16 +114,30 @@ notie.alert(3, 'You cancelled with this value: ' + valueEntered, 2); | ||
[ | ||
{ title: 'Share' }, | ||
{ title: 'Open', color: '#57BF57' }, | ||
{ title: 'Edit', type: 2 }, | ||
{ title: 'Delete', type: 3 } | ||
], | ||
function() { | ||
notie.alert(1, 'Share item!', 3); | ||
}, function() { | ||
notie.alert(1, 'Open item!', 3); | ||
}, function() { | ||
notie.alert(2, 'Edit item!', 3); | ||
}, function() { | ||
notie.alert(3, 'Delete item!', 3); | ||
}); | ||
{ | ||
title: 'Share', | ||
handler: function () { | ||
notie.alert(1, 'Share item!', 3); | ||
} | ||
}, | ||
{ | ||
title: 'Open', | ||
color: '#57BF57', | ||
handler: function () { | ||
notie.alert(1, 'Open item!', 3); | ||
} | ||
}, | ||
{ | ||
title: 'Edit', | ||
type: 2, | ||
handler: function () { | ||
notie.alert(2, 'Edit item!', 3); | ||
} | ||
}, | ||
{ | ||
title: 'Delete', | ||
type: 3, | ||
handler: function () { | ||
notie.alert(3, 'Delete item!', 3); | ||
} | ||
} | ||
]; | ||
@@ -136,0 +144,0 @@ notie.date({ |
@@ -540,24 +540,15 @@ /* | ||
var funcs = [] | ||
for (var i = 0; i < arguments.length - 3; i++) { | ||
funcs[i] = arguments[i + 3] | ||
} | ||
blur() | ||
if (funcs.length === choices.length) { | ||
blur() | ||
if (alertIsShowing) { | ||
// Hide notie.alert | ||
alertHide(function () { | ||
selectShow(title, cancelText, choices, funcs) | ||
}) | ||
} else { | ||
selectShow(title, cancelText, choices, funcs) | ||
} | ||
if (alertIsShowing) { | ||
// Hide notie.alert | ||
alertHide(function () { | ||
selectShow(title, cancelText, choices) | ||
}) | ||
} else { | ||
throw new Error('notie.select number of choices must match number of functions') | ||
selectShow(title, cancelText, choices) | ||
} | ||
} | ||
function selectShow (title, cancelText, choices, funcs) { | ||
function selectShow (title, cancelText, choices) { | ||
scrollDisable() | ||
@@ -606,10 +597,14 @@ | ||
// onclick for this choice | ||
selectChoice.onclick = (function (i) { | ||
return function () { | ||
selectHide() | ||
setTimeout(function () { | ||
funcs[i]() | ||
}, (options.animationDelay + 10)) | ||
} | ||
})(i) | ||
if (choices[i].handler) { | ||
selectChoice.onclick = (function (i) { | ||
return function () { | ||
selectHide() | ||
setTimeout(function () { | ||
choices[i].handler() | ||
}, (options.animationDelay + 10)) | ||
} | ||
})(i) | ||
} else { | ||
throw new Error('notie.select choice "' + selectChoice.title + '" must have a handler') | ||
} | ||
@@ -616,0 +611,0 @@ selectChoicePrevious = selectChoice |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
175
1254685
1006