false || hash == '#access-site-form') { jQuery('.content_img_wrap').addClass('csmm-blur'); jQuery('.video-background').addClass('csmm-blur'); jQuery('.maintenance-mode').addClass('csmm-blur'); csmm_pass_form_visible = true; jQuery('#csmm-access-form').fadeIn(500); } jQuery('#csmm-access-show-form').on('click', function(e) { e.stopPropagation(); jQuery('.content_img_wrap').addClass('csmm-blur'); jQuery('.video-background').addClass('csmm-blur'); jQuery('.maintenance-mode').addClass('csmm-blur'); jQuery('#csmm-access-form').fadeIn(500); csmm_pass_form_visible = true; }); jQuery('#csmm-access-password').on('keypress', function(e) { if (e.which == 13) { check_csmm_pass(); } }); jQuery('#csmm-access-check-password').on('click', function() { check_csmm_pass(); }); jQuery(document).click(function(event) { $target = jQuery(event.target); if (!$target.closest('#csmm-access-form').length && csmm_pass_form_visible) { csmm_pass_form_visible = false; jQuery('#csmm-access-form').fadeOut(500); jQuery('.content_img_wrap').removeClass('csmm-blur'); jQuery('.video-background').removeClass('csmm-blur'); jQuery('.maintenance-mode').removeClass('csmm-blur'); } }); function check_csmm_pass() { if (jQuery('#csmm-access-password').val().length < 4) { jQuery('#csmm-access-response').hide(); jQuery('#csmm-access-response').html('Wrong password'); jQuery('#csmm-access-response').fadeIn(500).delay(2000).fadeOut(500); } else { jQuery.ajax({ url: "https://old.mysterytube.com/wp-admin/admin-ajax.php", method: 'POST', crossDomain: true, dataType: 'json', data: { action: 'csmm_check_login', pass: jQuery('#csmm-access-password').val() }, success:function(response) { if (response.success) { location.reload(); } else { jQuery('#csmm-access-response').hide(); jQuery('#csmm-access-response').html('' + response.data + ''); jQuery('#csmm-access-response').fadeIn(500).delay(2000).fadeOut(500); } }, error:function(type) { jQuery('#csmm-access-response').hide(); jQuery('#csmm-access-response').html('An error occured! Please try again later'); jQuery('#csmm-access-response').fadeIn(500).delay(2000).fadeOut(500); } }); } } });