Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jAlert

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jAlert - npm Package Compare versions

Comparing version 4.9.0 to 4.9.1

2

dist/jAlert.min.js

@@ -7,2 +7,2 @@ /*

*/
(function(a){Date.now||(Date.now=function(){return+new Date}),a.fn.jAlert=function(b){a("body").focus(),a("body").blur();var c={xsmall:"xsm",small:"sm",medium:"md",large:"lg",xlarge:"xlg"},d=[],e=["animated"],f=[];if(1<this.length)return this.each(function(){a.fn.jAlert(b)}),this;if("undefined"!=typeof a(this)[0]&&"undefined"!=a(this)[0].jAlert)return a(this)[0].jAlert;if(a.each(a.fn.jAlert.defaults,function(a){var c=a.toLowerCase();"undefined"!=typeof b[c]&&(b[a]=b[c])}),b=a.extend({},a.fn.jAlert.defaults,b),!b.id)var g=Date.now().toString()+Math.floor(1e5*Math.random()),h="ja_"+g;else var h=b.id;var i={set:function(a,b){return i[a]=b,i},__set:function(a,b){return i.set(a,b)},get:function(a){return i[a]},__get:function(a){return i.get(a)},animateAlert:function(b){return"hide"==b?(i.instance.data("jAlert").blurBackground&&a("body").removeClass("ja_blur"),i.instance.removeClass(i.showAnimation).addClass(i.hideAnimation)):(i.instance.data("jAlert").blurBackground&&a("body").addClass("ja_blur"),i.instance.addClass(i.showAnimation).removeClass(i.hideAnimation).show()),i},closeAlert:function(b,c){return!1!=b&&(b=!0),i.instance&&(i.animateAlert("hide"),window.setTimeout(function(){var d=i.instance.parents(".ja_wrap");b?d.remove():d.hide(),"function"==typeof c?c(i.instance):"function"==typeof i.onClose&&i.onClose(i.instance),0===a(".jAlert:visible").length&&a("html,body").css("overflow","")},i.animationTimeout)),i},showAlert:function(b,c,d,e){!1!=b&&(b=!0),!1!==c&&(c=!0),b&&a(".jAlert:visible").data("jAlert").jAlert().closeAlert(c);var f=i.instance.parents(".ja_wrap");return a("body").append(f),i.animateAlert("show"),"function"==typeof e&&(i.onClose=e),window.setTimeout(function(){"function"==typeof d&&d(i.instance)},i.animationTimeout),i}};if(a.each(b,function(a,b){i.set(a,b)}),i.set("id",h),i.content&&0===i.content.indexOf("#")&&0<a(i.content).length&&(i.content=a(i.content).html()),"object"==typeof i.content&&i.jquery&&(i.content=i.content.html()),i.video&&-1<i.video.indexOf("youtube.com/watch?v=")&&-1===i.video.indexOf("embed")&&(i.video=i.video.replace("watch?v=","embed/")),"confirm"==i.type&&(!i.content&&(i.content=i.confirmQuestion),i.btns=[{text:i.confirmBtnText,theme:"green",class:"confirmBtn",closeAlert:!0,onClick:i.onConfirm},{text:i.denyBtnText,theme:"red",class:"denyBtn",closeAlert:!0,onClick:i.onDeny}],i.autofocus=i.confirmAutofocus),i.color&&(i.theme=i.color),-1==a.inArray(i.theme,["default","green","dark_green","red","dark_red","black","brown","gray","dark_gray","blue","dark_blue","yellow"]))return console.log("jAlert Config Error: Invalid theme selection."),!1;if(e.push("ja_"+i.theme),i["class"]&&e.push(i["class"]),i.classes&&e.push(i.classes),i.fullscreen&&e.push("ja_fullscreen"),i.noPadContent&&e.push("ja_no_pad"),i.title||e.push("ja_noTitle"),i.width&&(i.size=i.width),i.size&&"object"==typeof i.size&&("undefined"==typeof i.size.width||"undefined"==typeof i.size.height))return console.log("jAlert Config Error: Invalid size selection (try a preset or make sure you're including height and width in your size object)."),!1;if(i.size?"object"==typeof i.size?(d.push("width: "+i.size.width+";"),d.push("height: "+i.size.height+";"),e.push("ja_setheight")):("undefined"!=typeof c[i.size]&&(i.size=c[i.size]),-1<a.inArray(i.size,["xsm","sm","md","lg","xlg","full","auto"])?e.push("ja_"+i.size):d.push("width: "+i.size+";")):e.push("ja_sm"),-1==a.inArray(i.backgroundColor,["white","black"]))return console.log("jAlert Config Error: Invalid background color selection."),!1;f.push("ja_wrap_"+i.backgroundColor),i.onOpen=[i.onOpen];i.picture&&(i.image=i.picture),i.image?(i.noPadContent=!0,i.content="<div class='ja_media_wrap'><div class='ja_loader'>Loading...</div><img src='"+i.image+"' class='ja_img' onload='$.fn.jAlert.mediaLoaded($(this))''",i.imageWidth&&(i.content+=" style='width: "+i.imageWidth+"'"),i.content+="></div>",i.onOpen.unshift(function(a){var b=a.find(".ja_img");b.on("load",function(){a.css("width",b.width()+"px"),a.css("height",b.height()+"px")})})):i.video?(i.content="<div class='ja_media_wrap'><div class='ja_loader'>Loading...</div><div class='ja_video'></div></div>",i.onOpen.unshift(function(b){var c=document.createElement("iframe");c.src=b.data("jAlert").video,c.addEventListener?c.addEventListener("load",function(){a.fn.jAlert.mediaLoaded(a(this))},!0):c.attachEvent?c.attachEvent("onload",function(){a.fn.jAlert.mediaLoaded(a(this))}):c.onload=function(){a.fn.jAlert.mediaLoaded(a(this))},b.find(".ja_video").append(c)})):i.iframe?(!i.iframeHeight&&(i.iframeHeight=a(window).height()+"px"),i.content="<div class='ja_media_wrap'><div class='ja_loader'>Loading...</div></div>",i.onOpen.unshift(function(b){var c=document.createElement("iframe");c.src=b.jAlert().iframe,c.className="ja_iframe",c.addEventListener?c.addEventListener("load",function(){a.fn.jAlert.mediaLoaded(a(this))},!0):c.attachEvent?c.attachEvent("onload",function(){a.fn.jAlert.mediaLoaded(a(this))}):c.onload=function(){a.fn.jAlert.mediaLoaded(a(this))},b.find(".ja_media_wrap").append(c)})):i.ajax&&(i.content="<div class='ja_media_wrap'><div class='ja_loader'>Loading...</div></div>",onAjaxCallbacks=i.onOpen,i.onOpen=[function(b){a.ajax(b.jAlert().ajax,{async:!0,complete:function(c){b.find(".ja_media_wrap").replaceWith(c.responseText),a.each(onAjaxCallbacks,function(a,c){c(b)})},error:function(a){i.onAjaxFail(b,"Error getting content: Code: "+a.status+" : Msg: "+a.statusText)}})}]);var j=function(b){if("undefined"==typeof b.href&&(b.href=""),"undefined"==typeof b["class"]&&(b["class"]=""),b["class"]+="undefined"==typeof b.theme?" ja_btn_default":" ja_btn_"+b.theme,"undefined"==typeof b.text&&(b.text=""),"undefined"==typeof b.id){var c=Date.now().toString()+Math.floor(1e5*Math.random());b.id="ja_btn_"+c}return"undefined"==typeof b.target&&(b.target="_self"),"undefined"==typeof b.closeAlert&&(b.closeAlert=!0),a("body").off("click","#"+b.id),a("body").on("click","#"+b.id,function(c){var d=a(this);i=d.parents(".jAlert").jAlert(),b.closeAlert&&i.closeAlert();var e=!0;return"function"==typeof b.onClick&&(e=b.onClick(c,d,i)),!e||b.closeAlert?(c.preventDefault(),!1):e}),"<a href='"+b.href+"' id='"+b.id+"' target='"+b.target+"' class='ja_btn "+b["class"]+"'>"+b.text+"</a> "},k=function(b){var c="";c+="<div class=\"ja_wrap "+f.join(" ")+"\"><div class=\"jAlert "+e.join(" ")+"\" style=\""+d.join(" ")+"\" id=\""+i.id+"\"><div>",i.closeBtn&&(c+="<div class='closejAlert ja_close",i.closeBtnAlt?c+=" ja_close_alt":i.closeBtnRoundWhite?c+=" ja_close_round_white":i.closeBtnRound&&(c+=" ja_close_round"),c+="'>&times;</div>"),i.title&&(c+="<div class='ja_title'><div>"+i.title+"</div></div>"),c+="<div class=\"ja_body\">"+b,i.btns&&(c+="<div class=\"ja_btn_wrap ",i.btnBackground&&(c+="optBack"),c+="\">"),"object"==typeof i.btns[0]?a.each(i.btns,function(a,b){"object"==typeof b&&(c+=j(b))}):"object"==typeof i.btns?c+=j(i.btns):i.btns&&console.log("jAlert Config Error: Incorrect value for btns (must be object or array of objects): "+i.btns),i.btns&&(c+="</div>"),c+="</div></div></div></div>";var g=a(c);if(i.replaceOtherAlerts){var h=a(".jAlert:visible");h.each(function(){a(this).jAlert().closeAlert()})}return a("body").append(g),a(".jAlert:last").data("jAlert",i),i.instance=a("#"+i.id),i.instance[0].jAlert=i,a("html,body").css("overflow","hidden"),i.animateAlert("show"),i.closeBtn&&i.instance.on("click",".closejAlert",function(b){return b.preventDefault(),a(this).parents(".jAlert:first").closeAlert(),!1}),i.closeOnClick&&(a(document).off("mouseup touchstart",a.fn.jAlert.onMouseUp),a(document).on("mouseup touchstart",a.fn.jAlert.onMouseUp)),i.closeOnEsc&&(a(document).off("keydown",a.fn.jAlert.onEscKeyDown),a(document).on("keydown",a.fn.jAlert.onEscKeyDown)),i.onOpen&&a.each(i.onOpen,function(a,b){b(i.instance)}),i.autofocus?i.instance.find(i.autofocus).focus():i.instance.focus(),i.autoClose&&a.fn.closeTimer(function(){var b=a.jAlert("current");!1!==b&&b.closeAlert()},i.autoClose),i.instance};return this.initialize=function(){return i.content||i.image||i.video||i.iframe||i.ajax?(i.content||(i.content=""),k(i.content)):(console.log("jAlert potential error: No content defined"),k(""))},this.initialize(),i},a.fn.closeTimer=function(){var a=0;return function(b,c){clearTimeout(a),a=setTimeout(b,c)}}(jQuery),a.fn.jAlert.defaults={title:!1,content:!1,noPadContent:!1,fullscreen:!1,image:!1,imageWidth:"auto",video:!1,ajax:!1,onAjaxFail:function(a,b){a.jAlert().closeAlert(),errorAlert(b)},iframe:!1,iframeHeight:!1,class:"",classes:"",id:!1,showAnimation:"fadeInUp",hideAnimation:"fadeOutDown",animationTimeout:600,theme:"default",backgroundColor:"black",blurBackground:!1,size:!1,replaceOtherAlerts:!1,closeOnClick:!1,closeOnEsc:!0,closeBtn:!0,closeBtnAlt:!1,closeBtnRound:!0,closeBtnRoundWhite:!1,btns:!1,autoClose:!1,btnBackground:!0,autofocus:!1,onOpen:function(){return!1},onClose:function(){return!1},type:"modal",confirmQuestion:"Are you sure?",confirmBtnText:"Yes",denyBtnText:"No",confirmAutofocus:".confirmBtn",onConfirm:function(a){return a.preventDefault(),console.log("confirmed"),!1},onDeny:function(a){return a.preventDefault(),!1}},a.fn.jAlert.onMouseUp=function(b){var c=b.target?b.target:b.srcElement,d=a(".jAlert:visible:last");0<d.length&&d.data("jAlert").closeOnClick&&!a(c).is(".jAlert *")&&d.data("jAlert").closeAlert()},a.fn.jAlert.onEscKeyDown=function(b){if(27===b.keyCode){var c=a(".jAlert:visible:last");0<c.length&&c.data("jAlert").closeOnEsc&&c.data("jAlert").closeAlert()}},a.fn.attachjAlert=function(b){return b.preventDefault(),a.jAlert(a(this).data()),!1},a.jAlert=function(b){if("current"==b){var c=a(".jAlert:visible:last");return!!(0<c.length)&&c.data("jAlert")}return"attach"==b?(a("[data-jAlert]").off("click",a.fn.attachjAlert),a("[data-jAlert]").on("click",a.fn.attachjAlert),a("[data-jalert]").off("click",a.fn.attachjAlert),a("[data-jalert]").on("click",a.fn.attachjAlert),!1):a.fn.jAlert(b)},a.fn.alertOnClick=function(b){a(this).on("click",function(c){return c.preventDefault(),a.jAlert(b),!1})},a.alertOnClick=function(b,c){a("body").on("click",b,function(b){return b.preventDefault(),a.jAlert(c),!1})},a.fn.closeAlert=function(b,c){a(this).data("jAlert")&&a(this).data("jAlert").closeAlert(b,c)},a.fn.jAlert.mediaLoaded=function(a){var b=a.parents(".ja_media_wrap"),c=b.find(".ja_video"),d=a.parents(".jAlert:first"),e=d.data("jAlert");b.find(".ja_loader").remove(),0<c.length?c.fadeIn("fast"):a.fadeIn("fast"),"undefined"!=typeof e.iframeHeight&&e.iframeHeight&&(a.css("display","block"),a.height(e.iframeHeight))}})(jQuery);
(function(a){Date.now||(Date.now=function(){return+new Date}),a.fn.jAlert=function(b){a("body").focus(),a("body").blur();var c={xsmall:"xsm",small:"sm",medium:"md",large:"lg",xlarge:"xlg"},d=[],e=["animated"],f=[];if(1<this.length)return this.each(function(){a.fn.jAlert(b)}),this;if("undefined"!=typeof a(this)[0]&&"undefined"!=a(this)[0].jAlert)return a(this)[0].jAlert;if(a.each(a.fn.jAlert.defaults,function(a){var c=a.toLowerCase();"undefined"!=typeof b[c]&&(b[a]=b[c])}),b=a.extend({},a.fn.jAlert.defaults,b),!b.id)var g=Date.now().toString()+Math.floor(1e5*Math.random()),h="ja_"+g;else var h=b.id;var i={set:function(a,b){return i[a]=b,i},__set:function(a,b){return i.set(a,b)},get:function(a){return i[a]},__get:function(a){return i.get(a)},animateAlert:function(b){return"hide"==b?(i.instance.data("jAlert").blurBackground&&a("body").removeClass("ja_blur"),i.instance.removeClass(i.showAnimation).addClass(i.hideAnimation)):(i.instance.data("jAlert").blurBackground&&a("body").addClass("ja_blur"),i.instance.addClass(i.showAnimation).removeClass(i.hideAnimation).show()),i},closeAlert:function(b,c){return!1!=b&&(b=!0),i.instance&&(i.animateAlert("hide"),window.setTimeout(function(){var d=i.instance.parents(".ja_wrap");b?d.remove():d.hide(),"function"==typeof c?c(i.instance):"function"==typeof i.onClose&&i.onClose(i.instance),0===a(".jAlert:visible").length&&a("html,body").css("overflow","")},i.animationTimeout)),i},showAlert:function(b,c,d,e){!1!=b&&(b=!0),!1!==c&&(c=!0),b&&a(".jAlert:visible").data("jAlert").jAlert().closeAlert(c);var f=i.instance.parents(".ja_wrap");return a("body").append(f),i.animateAlert("show"),"function"==typeof e&&(i.onClose=e),window.setTimeout(function(){"function"==typeof d&&d(i.instance)},i.animationTimeout),i}};if(a.each(b,function(a,b){i.set(a,b)}),i.set("id",h),i.content&&0===i.content.indexOf("#")&&0<a(i.content).length&&(i.content=a(i.content).html()),"object"==typeof i.content&&i.jquery&&(i.content=i.content.html()),i.video&&-1<i.video.indexOf("youtube.com/watch?v=")&&-1===i.video.indexOf("embed")&&(i.video=i.video.replace("watch?v=","embed/")),"confirm"==i.type&&(!i.content&&(i.content=i.confirmQuestion),i.btns=[{text:i.confirmBtnText,theme:"green",class:"confirmBtn",closeAlert:!0,onClick:i.onConfirm},{text:i.denyBtnText,theme:"red",class:"denyBtn",closeAlert:!0,onClick:i.onDeny}],i.autofocus=i.confirmAutofocus),i.color&&(i.theme=i.color),-1==a.inArray(i.theme,["default","green","dark_green","red","dark_red","black","brown","gray","dark_gray","blue","dark_blue","yellow"]))return console.log("jAlert Config Error: Invalid theme selection."),!1;if(e.push("ja_"+i.theme),i["class"]&&e.push(i["class"]),i.classes&&e.push(i.classes),i.fullscreen&&e.push("ja_fullscreen"),i.noPadContent&&e.push("ja_no_pad"),i.title||e.push("ja_noTitle"),i.width&&(i.size=i.width),i.size&&"object"==typeof i.size&&("undefined"==typeof i.size.width||"undefined"==typeof i.size.height))return console.log("jAlert Config Error: Invalid size selection (try a preset or make sure you're including height and width in your size object)."),!1;if(i.size?"object"==typeof i.size?(d.push("width: "+i.size.width+";"),d.push("height: "+i.size.height+";"),e.push("ja_setheight")):("undefined"!=typeof c[i.size]&&(i.size=c[i.size]),-1<a.inArray(i.size,["xsm","sm","md","lg","xlg","full","auto"])?e.push("ja_"+i.size):d.push("width: "+i.size+";")):e.push("ja_sm"),-1==a.inArray(i.backgroundColor,["white","black"]))return console.log("jAlert Config Error: Invalid background color selection."),!1;f.push("ja_wrap_"+i.backgroundColor),i.onOpen=[i.onOpen];i.picture&&(i.image=i.picture),i.image?(i.noPadContent=!0,i.content="<div class='ja_media_wrap'><div class='ja_loader'>Loading...</div><img src='"+i.image+"' class='ja_img' onload='$.fn.jAlert.mediaLoaded($(this))''",i.imageWidth&&(i.content+=" style='width: "+i.imageWidth+"'"),i.content+="></div>",i.onOpen.unshift(function(a){var b=a.find(".ja_img");b.on("load",function(){a.css("width",b.width()+"px"),a.css("height",b.height()+"px")})})):i.video?(i.content="<div class='ja_media_wrap'><div class='ja_loader'>Loading...</div><div class='ja_video'></div></div>",i.onOpen.unshift(function(b){var c=document.createElement("iframe");c.src=b.data("jAlert").video,c.addEventListener?c.addEventListener("load",function(){a.fn.jAlert.mediaLoaded(a(this))},!0):c.attachEvent?c.attachEvent("onload",function(){a.fn.jAlert.mediaLoaded(a(this))}):c.onload=function(){a.fn.jAlert.mediaLoaded(a(this))},b.find(".ja_video").append(c)})):i.iframe?(!i.iframeHeight&&e.push("ja_stretch_height"),i.content="<div class='ja_media_wrap'><div class='ja_loader'>Loading...</div></div>",i.onOpen.unshift(function(b){var c=document.createElement("iframe");c.src=b.jAlert().iframe,c.className="ja_iframe",c.addEventListener?c.addEventListener("load",function(){a.fn.jAlert.mediaLoaded(a(this))},!0):c.attachEvent?c.attachEvent("onload",function(){a.fn.jAlert.mediaLoaded(a(this))}):c.onload=function(){a.fn.jAlert.mediaLoaded(a(this))},b.find(".ja_media_wrap").append(c)})):i.ajax&&(i.content="<div class='ja_media_wrap'><div class='ja_loader'>Loading...</div></div>",onAjaxCallbacks=i.onOpen,i.onOpen=[function(b){a.ajax(b.jAlert().ajax,{async:!0,complete:function(c){b.find(".ja_media_wrap").replaceWith(c.responseText),a.each(onAjaxCallbacks,function(a,c){c(b)})},error:function(a){i.onAjaxFail(b,"Error getting content: Code: "+a.status+" : Msg: "+a.statusText)}})}]);var j=function(b){if("undefined"==typeof b.href&&(b.href=""),"undefined"==typeof b["class"]&&(b["class"]=""),b["class"]+="undefined"==typeof b.theme?" ja_btn_default":" ja_btn_"+b.theme,"undefined"==typeof b.text&&(b.text=""),"undefined"==typeof b.id){var c=Date.now().toString()+Math.floor(1e5*Math.random());b.id="ja_btn_"+c}return"undefined"==typeof b.target&&(b.target="_self"),"undefined"==typeof b.closeAlert&&(b.closeAlert=!0),a("body").off("click","#"+b.id),a("body").on("click","#"+b.id,function(c){var d=a(this);i=d.parents(".jAlert").jAlert(),b.closeAlert&&i.closeAlert();var e=!0;return"function"==typeof b.onClick&&(e=b.onClick(c,d,i)),!e||b.closeAlert?(c.preventDefault(),!1):e}),"<a href='"+b.href+"' id='"+b.id+"' target='"+b.target+"' class='ja_btn "+b["class"]+"'>"+b.text+"</a> "},k=function(b){var c="";c+="<div class=\"ja_wrap "+f.join(" ")+"\"><div class=\"jAlert "+e.join(" ")+"\" style=\""+d.join(" ")+"\" id=\""+i.id+"\"><div>",i.closeBtn&&(c+="<div class='closejAlert ja_close",i.closeBtnAlt?c+=" ja_close_alt":i.closeBtnRoundWhite?c+=" ja_close_round_white":i.closeBtnRound&&(c+=" ja_close_round"),c+="'>&times;</div>"),i.title&&(c+="<div class='ja_title'><div>"+i.title+"</div></div>"),c+="<div class=\"ja_body\">"+b,i.btns&&(c+="<div class=\"ja_btn_wrap ",i.btnBackground&&(c+="optBack"),c+="\">"),"object"==typeof i.btns[0]?a.each(i.btns,function(a,b){"object"==typeof b&&(c+=j(b))}):"object"==typeof i.btns?c+=j(i.btns):i.btns&&console.log("jAlert Config Error: Incorrect value for btns (must be object or array of objects): "+i.btns),i.btns&&(c+="</div>"),c+="</div></div></div></div>";var g=a(c);if(i.replaceOtherAlerts){var h=a(".jAlert:visible");h.each(function(){a(this).jAlert().closeAlert()})}return a("body").append(g),a(".jAlert:last").data("jAlert",i),i.instance=a("#"+i.id),i.instance[0].jAlert=i,a("html,body").css("overflow","hidden"),i.animateAlert("show"),i.closeBtn&&i.instance.on("click",".closejAlert",function(b){return b.preventDefault(),a(this).parents(".jAlert:first").closeAlert(),!1}),i.closeOnClick&&(a(document).off("mouseup touchstart",a.fn.jAlert.onMouseUp),a(document).on("mouseup touchstart",a.fn.jAlert.onMouseUp)),i.closeOnEsc&&(a(document).off("keydown",a.fn.jAlert.onEscKeyDown),a(document).on("keydown",a.fn.jAlert.onEscKeyDown)),i.onOpen&&a.each(i.onOpen,function(a,b){b(i.instance)}),i.autofocus?i.instance.find(i.autofocus).focus():i.instance.focus(),i.autoClose&&a.fn.closeTimer(function(){var b=a.jAlert("current");!1!==b&&b.closeAlert()},i.autoClose),i.instance};return this.initialize=function(){return i.content||i.image||i.video||i.iframe||i.ajax?(i.content||(i.content=""),k(i.content)):(console.log("jAlert potential error: No content defined"),k(""))},this.initialize(),i},a.fn.closeTimer=function(){var a=0;return function(b,c){clearTimeout(a),a=setTimeout(b,c)}}(jQuery),a.fn.jAlert.defaults={title:!1,content:!1,noPadContent:!1,fullscreen:!1,image:!1,imageWidth:"auto",video:!1,ajax:!1,onAjaxFail:function(a,b){a.jAlert().closeAlert(),errorAlert(b)},iframe:!1,iframeHeight:!1,class:"",classes:"",id:!1,showAnimation:"fadeInUp",hideAnimation:"fadeOutDown",animationTimeout:600,theme:"default",backgroundColor:"black",blurBackground:!1,size:!1,replaceOtherAlerts:!1,closeOnClick:!1,closeOnEsc:!0,closeBtn:!0,closeBtnAlt:!1,closeBtnRound:!0,closeBtnRoundWhite:!1,btns:!1,autoClose:!1,btnBackground:!0,autofocus:!1,onOpen:function(){return!1},onClose:function(){return!1},type:"modal",confirmQuestion:"Are you sure?",confirmBtnText:"Yes",denyBtnText:"No",confirmAutofocus:".confirmBtn",onConfirm:function(a){return a.preventDefault(),console.log("confirmed"),!1},onDeny:function(a){return a.preventDefault(),!1}},a.fn.jAlert.onMouseUp=function(b){var c=b.target?b.target:b.srcElement,d=a(".jAlert:visible:last");0<d.length&&d.data("jAlert").closeOnClick&&!a(c).is(".jAlert *")&&d.data("jAlert").closeAlert()},a.fn.jAlert.onEscKeyDown=function(b){if(27===b.keyCode){var c=a(".jAlert:visible:last");0<c.length&&c.data("jAlert").closeOnEsc&&c.data("jAlert").closeAlert()}},a.fn.attachjAlert=function(b){return b.preventDefault(),a.jAlert(a(this).data()),!1},a.jAlert=function(b){if("current"==b){var c=a(".jAlert:visible:last");return!!(0<c.length)&&c.data("jAlert")}return"attach"==b?(a("[data-jAlert]").off("click",a.fn.attachjAlert),a("[data-jAlert]").on("click",a.fn.attachjAlert),a("[data-jalert]").off("click",a.fn.attachjAlert),a("[data-jalert]").on("click",a.fn.attachjAlert),!1):a.fn.jAlert(b)},a.fn.alertOnClick=function(b){a(this).on("click",function(c){return c.preventDefault(),a.jAlert(b),!1})},a.alertOnClick=function(b,c){a("body").on("click",b,function(b){return b.preventDefault(),a.jAlert(c),!1})},a.fn.closeAlert=function(b,c){a(this).data("jAlert")&&a(this).data("jAlert").closeAlert(b,c)},a.fn.jAlert.mediaLoaded=function(a){var b=a.parents(".ja_media_wrap"),c=b.find(".ja_video"),d=a.parents(".jAlert:first"),e=d.data("jAlert");b.find(".ja_loader").remove(),0<c.length?c.fadeIn("fast"):a.fadeIn("fast"),e.iframeHeight&&(a.css("flex","unset"),a.height(e.iframeHeight))}})(jQuery);
{
"name": "jAlert",
"version": "4.9.0",
"version": "4.9.1",
"description": "Simple jQuery (Modal | Popup | Lightbox | Alert) Plugin",
"author": {
"name" : "HTMLGuy, LLC",
"url" : "https://htmlguy.com"
},
"main": "./dist/jAlert.min.js",

@@ -18,6 +22,3 @@ "repository": {

},
"license":{
"type": "MIT",
"url": "https://www.opensource.org/licenses/mit-license.php"
}
"license":"MIT"
}

@@ -430,5 +430,5 @@ /*

{
if( !alert.iframeHeight )
{
alert.iframeHeight = $(window).height() +'px';
//if no height was provided, use flexbox to stretch the height to fit the window
if( !alert.iframeHeight ){
classes.push('ja_stretch_height');
}

@@ -765,3 +765,3 @@

'iframe': false, //uses iframe as content
'iframeHeight': false, //string. height of the iframe within the popup (false = 90% of viewport height)
'iframeHeight': false, //string. height of the iframe within the popup (false = flex to fit)
'class': '', //adds a class to the jAlert (add as many as you want space delimited)

@@ -949,5 +949,5 @@ 'classes': '', //add classes to the jAlert (space delimited)

//if iframe, add height after load and set display: block
if( typeof jalert.iframeHeight !== 'undefined' && jalert.iframeHeight )
if( jalert.iframeHeight )
{
elem.css('display', 'block');
elem.css('flex', 'unset');
elem.height(jalert.iframeHeight);

@@ -954,0 +954,0 @@ }

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