PluginProbe
Passster – Password Protect Pages and Content / 3.5.5.8
Passster – Password Protect Pages and Content v3.5.5.8
4.3.17 4.3.16 4.3.15 4.3.14 4.3.12 4.3.13 4.3.11 4.3.10 4.3.9 4.3.8 4.3.7 4.3.6 4.3.5 trunk 3.5.4 3.5.5.2 3.5.5.8 3.5.5.9 4.0 4.1.4 4.2.10 4.2.11 4.2.12 4.2.13 4.2.14 All 49 releases
content-protector / assets / public / passster-public.min.js

passster-public.min.js in Passster – Password Protect Pages and Content 3.5.5.8, at assets/public/passster-public.min.js

1 lines 6.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 jQuery(document).ready(function($){function a(a){$.ajax({type:"post",dataType:"json",url:ps_ajax.ajax_url,data:{action:"hash_password",hash_nonce:ps_ajax.hash_nonce,password:a},success:function(a){Cookies.set("passster",a.password,{expires:parseInt(ps_ajax.days),sameSite:"strict"})},async:!1})}if(ps_ajax.link_pass&&"on"===ps_ajax.use_cookie&&(ps_ajax.link_pass.length<25?a(atob(ps_ajax.link_pass)):Cookies.set("passster",ps_ajax.link_pass,{expires:parseInt(ps_ajax.days),sameSite:"strict"}),window.location.replace(ps_ajax.permalink)),$(".passster-submit").on("click",function(c){c.preventDefault();var b=$(this).parent().parent();$(b)[0].checkValidity()||$(b)[0].reportValidity(),ps_id=$(this).attr("data-psid"),b=$("#"+ps_id),password=$("#"+ps_id+" .passster-password").attr("data-password"),type=$("#"+ps_id+" .passster-password").attr("data-protection-type"),list=$("#"+ps_id+" .passster-password").attr("data-list"),area=$("#"+ps_id+" .passster-password").attr("data-area"),protection=$("#"+ps_id+" .passster-password").attr("data-protection"),redirect=$(this).attr("data-redirect"),input=$("#"+ps_id+" .passster-password").val(),acf=$(this).attr("data-acf"),$.ajax({type:"post",dataType:"json",url:ps_ajax.ajax_url,data:{action:"validate_input",nonce:ps_ajax.nonce,input:input,password:password,post_id:ps_ajax.post_id,type:type,list:list,area:area,protection:protection,acf:acf,redirect:redirect},beforeSend:function(){b.find(".ps-loader").css("display","block")},success:function(c){if(b.find(".ps-loader").css("display","none"),!0===c.success){if("on"===ps_ajax.no_ajax)a(input),window.location.reload();else{"on"===ps_ajax.use_cookie&&a(input),b.find(".passster-error").hide();let d=c.content;d&&($.each(ps_ajax.shortcodes,function(a,b){d=d.replace(a,b)}),$("#"+ps_id).replaceWith(d)),c.redirect&&window.location.replace(redirect)}}else b.find(".passster-error").text(c.error),b.find(".passster-error").show().fadeOut(3500),$("#"+ps_id+" .passster-password").val("")}})}),$(".recaptcha-form-v2").length>0&&grecaptcha.ready(function(){grecaptcha.render("ps-recaptcha-v2",{sitekey:ps_ajax.recaptcha_key,callback:function(a){ps_id=$(".recaptcha-v2-submit").attr("data-psid"),form=$("#"+ps_id),protection=$(".recaptcha-v2-submit").attr("data-protection"),acf=$(".recaptcha-v2-submit").attr("data-acf"),area=$("#"+ps_id).find(".recaptcha-v2-submit").attr("data-area"),redirect=$("#"+ps_id).find(".recaptcha-v2-submit").attr("data-redirect"),$.ajax({type:"post",dataType:"json",url:ps_ajax.ajax_url,data:{action:"validate_input",nonce:ps_ajax.nonce,token:a,post_id:ps_ajax.post_id,type:"recaptcha",protection:protection,captcha_id:ps_id,acf:acf,area:area,redirect:redirect},success:function(a){if(!0===a.success){if("on"===ps_ajax.no_ajax)Cookies.set("passster","recaptcha",{expires:parseInt(ps_ajax.days),sameSite:"strict"}),window.location.reload();else{"on"===ps_ajax.use_cookie&&Cookies.set("passster","recaptcha",{expires:parseInt(ps_ajax.days),sameSite:"strict"}),form.find(".passster-error").hide();let b=a.content;b&&($.each(ps_ajax.shortcodes,function(a,c){b=b.replace(a,c)}),$("#"+ps_id).replaceWith(b)),a.redirect&&window.location.replace(redirect)}}else form.find(".passster-error").text(a.error),form.find(".passster-error").show().fadeOut(3500)}})}})}),$(".recaptcha-form").on("submit",function(a){a.preventDefault(),ps_id=$(this).find(".passster-submit-recaptcha").attr("data-psid"),form=$("#"+ps_id),protection=$(this).find(".passster-submit-recaptcha").attr("data-protection"),acf=$(this).find(".passster-submit-recaptcha").attr("data-acf"),area=$(this).find(".passster-submit-recaptcha").attr("data-area"),redirect=$(this).find(".passster-submit-recaptcha").attr("data-redirect"),grecaptcha.ready(function(){grecaptcha.execute(ps_ajax.recaptcha_key,{action:"validate_input"}).then(function(a){form.prepend('<input type="hidden" name="token" value="'+a+'">'),form.prepend('<input type="hidden" name="action" value="validate_input">'),$.ajax({type:"post",dataType:"json",url:ps_ajax.ajax_url,data:{action:"validate_input",nonce:ps_ajax.nonce,token:a,post_id:ps_ajax.post_id,type:"recaptcha",protection:protection,captcha_id:ps_id,acf:acf,area:area,redirect:redirect},success:function(a){if(!0===a.success){if("on"===ps_ajax.no_ajax)Cookies.set("passster","recaptcha",{expires:parseInt(ps_ajax.days),sameSite:"strict"}),window.location.reload();else{"on"===ps_ajax.use_cookie&&Cookies.set("passster","recaptcha",{expires:parseInt(ps_ajax.days),sameSite:"strict"}),form.find(".passster-error").hide();let b=a.content;b&&($.each(ps_ajax.shortcodes,function(a,c){b=b.replace(a,c)}),form.replaceWith(b)),a.redirect&&window.location.replace(redirect)}}else form.find(".passster-error").text(a.error),form.find(".passster-error").show().fadeOut(3500)}})})})}),$(".passster-captcha-input").length>0){var b=new jCaptcha({el:".passster-captcha-input",canvasClass:"jCaptchaCanvas",canvasStyle:{width:100,height:25,textBaseline:"top",font:"22px Arial",textAlign:"left",fillStyle:"#000"},requiredValue:"",callback:function(a){"success"==a&&(ps_id=$(".passster-submit-captcha").attr("data-psid"),form=$("#"+ps_id),protection=$(".passster-submit-captcha").attr("data-protection"),acf=$(".passster-submit-captcha").attr("data-acf"),area=$("#"+ps_id).find(".passster-captcha-input").attr("data-area"),redirect=$(".passster-submit-captcha").attr("data-redirect"),$.ajax({type:"post",dataType:"json",url:ps_ajax.ajax_url,data:{action:"validate_input",nonce:ps_ajax.nonce,captcha:"success",post_id:ps_ajax.post_id,type:"captcha",protection:protection,captcha_id:ps_id,acf:acf,area:area,redirect:redirect},success:function(a){if(!0===a.success){if("on"===ps_ajax.no_ajax)Cookies.set("passster","captcha",{expires:parseInt(ps_ajax.days),sameSite:"strict"}),window.location.reload();else{"on"===ps_ajax.use_cookie&&Cookies.set("passster","captcha",{expires:parseInt(ps_ajax.days),sameSite:"strict"}),form.find(".passster-error").hide();let b=a.content;b&&($.each(ps_ajax.shortcodes,function(a,c){b=b.replace(a,c)}),$("#"+ps_id).replaceWith(b)),a.redirect&&window.location.replace(redirect)}}else form.find(".passster-error").text(a.error),form.find(".passster-error").show().fadeOut(3500)}})),"error"==a&&(form.find(".passster-error").text(ps_ajax.captcha_error),form.find(".passster-error").show().fadeOut(3500))}});document.querySelector(".captcha-form").addEventListener("submit",function(a){a.preventDefault(),b.validate()})}$(document).on("click","#ps-logout",function(){$.ajax({type:"post",dataType:"json",url:ps_ajax.ajax_url,data:{action:"handle_logout",logout_nonce:ps_ajax.logout_nonce},success:function(a){!0===a.success&&(Cookies.set("passster","",{expires:0,sameSite:"strict"}),window.location.reload())}})})})