YaWK  24.1
Yet another WebKit
loginbox.ajax.min.js File Reference

Go to the source code of this file.

Functions

document ready (function(){var e;e=0,$("#loginForm").on("keydown", function(){e &&clearTimeout(e), e=setTimeout(function(){$("#loginForm").validate({errorPlacement:function(e, n){e.insertBefore(n)}, rules:{user:{required:!0, minlength:4, maxlength:48}, password:{required:!0, minlength:4, maxlength:48}}})}, 300)});var n=$("#loginForm");$(n).keypress(function(e){"13"===(e.keyCode?e.keyCode:e.which)&&$("#submit").click()}),$(n).submit(function(e){e.preventDefault();var o=$("#user").val(), t=$("#password").val(), a=$("#loginboxGreeting").val(), i=$("#loginboxGreetingText").val(), l=$("#loginboxGreetingTextType").val(), r=$("#loginboxGreetingTextClass").val(), s=$("#loginboxGreetingSubtext").val(), g=($("#loginboxGreetingShowName").val(),$("#loginboxLogoutBtnText").val()), u=$("#loginboxLogoutBtnClass").val(), c=$("#loginboxRedirect").val(), d=$("#loginboxRedirectTime").val(), m='< a href="logout" id="logoutBtn" class="'+u+'" target="_self">'+g+"</a>";function x(){$(n).effect("shake",{times:3}, 820)}if(!t.trim()||!o.trim()) return x(),!1;$.ajax({url:"system/widgets/loginbox/js/loginbox.ajax.php", type:"POST", crossOrigin:!0, async:!0, data:{user:o, password:t}, success:function(e){if(!e) return console.log("ajax error during login: no data was sent"), alert("ERROR: ajax processing failed: no data was sent"),!1;if(!0===e.status){if($("#heading").hide(),$("#loginForm").hide(), c &&(d?setTimeout(function(){window.location.href=""+c}, d):window.location.replace(""+c)),"GLOBALTEXT"===l &&(l="p"), r) var n=' class="'+r+'"';else n="";"greeting-max"===a &&$("#thankYouMessage").append("<"+l+n+">"+i+" "+o+" <small>"+s+"</small></"+l+">"+m),"greeting-min"===a &&$("#thankYouMessage").append("<"+l+n+">"+i+" <small>"+s+"</small></"+l+">"+m),"greeting-button"===a &&$("#thankYouMessage").append(""+m),"greeting-none"===a &&$("#thankYouMessage").hide()}else x()}, error:function(e){x(), console.log("Login failed / username or pwd wrong")}})})})
 

Function Documentation

◆ ready()

document ready ( function(){var e;e=0,$("#loginForm").on("keydown", function(){e &&clearTimeout(e), e=setTimeout(function(){$("#loginForm").validate({errorPlacement:function(e, n){e.insertBefore(n)}, rules:{user:{required:!0, minlength:4, maxlength:48}, password:{required:!0, minlength:4, maxlength:48}}})}, 300)});var n=$("#loginForm");$(n).keypress(function(e){"13"===(e.keyCode?e.keyCode:e.which)&&$("#submit").click()}),$(n).submit(function(e){e.preventDefault();var o=$("#user").val(), t=$("#password").val(), a=$("#loginboxGreeting").val(), i=$("#loginboxGreetingText").val(), l=$("#loginboxGreetingTextType").val(), r=$("#loginboxGreetingTextClass").val(), s=$("#loginboxGreetingSubtext").val(), g=($("#loginboxGreetingShowName").val(),$("#loginboxLogoutBtnText").val()), u=$("#loginboxLogoutBtnClass").val(), c=$("#loginboxRedirect").val(), d=$("#loginboxRedirectTime").val(), m='< a href="logout" id="logoutBtn" class="'+u+'" target="_self">'+g+"</a>";function x(){$(n).effect("shake",{times:3}, 820)}if(!t.trim()||!o.trim()) return x(),!1;$.ajax({url:"system/widgets/loginbox/js/loginbox.ajax.php", type:"POST", crossOrigin:!0, async:!0, data:{user:o, password:t}, success:function(e){if(!e) return console.log("ajax error during login: no data was sent"), alert("ERROR: ajax processing failed: no data was sent"),!1;if(!0===e.status){if($("#heading").hide(),$("#loginForm").hide(), c &&(d?setTimeout(function(){window.location.href=""+c}, d):window.location.replace(""+c)),"GLOBALTEXT"===l &&(l="p"), r) var n=' class="'+r+'"';else n="";"greeting-max"===a &&$("#thankYouMessage").append("<"+l+n+">"+i+" "+o+" <small>"+s+"</small></"+l+">"+m),"greeting-min"===a &&$("#thankYouMessage").append("<"+l+n+">"+i+" <small>"+s+"</small></"+l+">"+m),"greeting-button"===a &&$("#thankYouMessage").append(""+m),"greeting-none"===a &&$("#thankYouMessage").hide()}else x()}, error:function(e){x(), console.log("Login failed / username or pwd wrong")}})})}  )

References a, c, d(), e, error, g(), i(), l, m, n(), o(), on, r(), s(), t, type, u(), window, and x().