1const resizeObserver = new ResizeObserver(entries => 2 placeLoginBox() 3) 4 5$(document).on('keydown', function (event) { 6 if (event.keyCode == 13 && !$(event.target).find('#login_form').size()) { 7 $('#login_form').submit(); 8 } 9}); 10 11$(document).ready(function () { 12 // initialize tooltips and hide it 13 // $('.caps_warn').tooltip(); 14 $('.caps_warn').hide(); 15 16 $('#login_buttom').click(function () { 17 $('#login_form').submit(); 18 }); 19 20 $('#register_button').click(function () { 21 window.location = "/signup"; 22 return false; 23 }); 24 25 $('#code_signup_button').click(function () { 26 showCodeSignupLogin(); 27 return false; 28 }); 29 30 $('#start_code_signup_button').click(function () { 31 validateCodeSignupLogin(); 32 return false; 33 }); 34 35 $('.password-toggle-on').click(function(){ 36 $('.password-toggle-on').hide(); 37 $('.password-toggle-off').show(); 38 $('#password').attr('type', 'text'); 39 }); 40 $('.password-toggle-off').click(function(){ 41 $('.password-toggle-off').hide(); 42 $('.password-toggle-on').show(); 43 $('#password').attr('type', 'password'); 44 }); 45}); 46 47function rescaleCaptcha() { 48 var width = $('.g-recaptcha').parent().width(); 49 var scale; 50 if (width < 302) { 51 scale = width / 302; 52 } else { 53 scale = 1.0; 54 } 55 56 $('.g-recaptcha').css('transform', 'scale(' + scale + ')'); 57 $('.g-recaptcha').css('-webkit-transform', 'scale(' + scale + ')'); 58 $('.g-recaptcha').css('transform-origin', '0 0'); 59 $('.g-recaptcha').css('-webkit-transform-origin', '0 0'); 60} 61 62$(function () { 63 64 65 rescaleCaptcha(); 66 $(window).resize(function () { 67 rescaleCaptcha(); 68 }); 69 70 // start observing a DOM node 71 resizeObserver.observe(document.body) 72 73}); 74 75/** 76 * detects if capslock is on and displays/hides a warning to user 77 * @param element 78 * @param event 79 */ 80function showCapslockWarning(element, event) { 81 var result = false;
82 var e = event ? event : window.event; 83 var target = '#' + $(element).attr('data-target'); 84 85 var charCode = false; 86 if (e.which) { 87 charCode = e.which; 88 } else if (e.keyCode) { 89 charCode = e.keyCode; 90 } 91 92 var shifton = false; 93 if (e.shiftKey) { 94 shifton = e.shiftKey; 95 } else if (e.modifiers) { 96 shifton = !!(e.modifiers & 4); 97 } 98 99 if (charCode >= 97 && charCode <= 122 && shifton) { 100 result = true; 101 } 102 103 if (charCode >= 65 && charCode <= 90 && !shifton) { 104 result = true; 105 } 106 107 result ? $(target).show() : $(target).hide(); 108} 109 110 111function validateCodeSignupLogin() { 112 $('#signup_code_container').fadeOut(function () { 113 $('#signup_code_container').find('.error').hide().html(''); 114 $('#signup_code_container_loader').fadeIn(400, function () { 115 $.ajax({ 116 url: '/ajax', 117 data: { 118 mode: 'validate_signup_code', 119 signup_code: $('#signup_code').val(), 120 json: 1, 121 } 122 }).done(function (data) { 123 if (data.success) { 124 window.location = '/signup?signup_code=' + $('#signup_code').val(); 125 } else { 126 $('#signup_code_container_loader').fadeOut(400, function () { 127 $('#signup_code_container').fadeIn(); 128 $('#signup_code_container').find('.error').html(data.message).show(); 129 }); 130 } 131 }); 132 }); 133 }); 134} 135 136function showCodeSignupLogin() { 137 $('#login_error').fadeOut(); 138 $('#login_form').fadeOut(function () { 139 $('#signup_code_container').fadeIn(); 140 }); 141} 142 143function hideCodeSignupLogin() { 144 $('#signup_code_container').fadeOut(function () { 145 $('#login_form').fadeIn(); 146 }); 147} 148 149 150function placeLoginBox() { 151 return; 152 if ($(document).height() > $(window).height()) { 153 $('#virtuagym_footer').removeClass('static'); 154 $('#main-row').removeClass('full-height'); 155 $('.card').css('margin-top', '52px'); 156 } else { 157 $('#virtuagym_footer').addClass('static'); 158 $('#main-row').addClass('full-height'); 159 $('.card').css('margin-top', ''); 160 } 161}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.