1jQuery(document).ready(function($) { 2 3 if (jsPassData.generated_pass == 'on') { 4 $("#allow_pass").show(); 5 }else { 6 $("#allow_pass").hide(); 7 } 8 9 $(".go_to_login_link").click(function(e) { 10 if (jsPassData.type_modal != 'LinkToDefault') { 11 e.stopPropagation(); 12 e.preventDefault(); 13 var offset = $( this ).offset(); 14 15 if ($("#csh-login-wrap").css("display") == "none") { 16 var windowsize = $(window).width(); 17 if (jsPassData.type_modal == 'Dropdown') { 18 $("#csh-login-wrap").css('position', 'absolute'); 19 $("#csh-login-wrap").css('top', offset.top + 30); 20 $("#csh-login-wrap").css('left', offset.left); 21 } 22 23 $("#csh-login-wrap").slideToggle(250); 24 $(".login_form").show(); 25 $("#login_user").focus(); 26 $(".register_form").hide(); 27 $(".lost_pwd_form").hide(); 28 $(".back_login").hide(); 29 $(".alert_status").hide(); 30 }else { 31 $("#csh-login-wrap").slideUp(200); 32 } 33 34 //clear form fields 35 //$(".login_form").find("input[type=text],input[type=email],input[type=password],textarea").val(""); 36 $(".register_form").find("input[type=text],input[type=email],input[type=password],textarea").val(""); 37 $(".lost_pwd_form").find("input[type=email],textarea").val(""); 38 39 //clear validation. 40 var login_validator = $(".login_form").validate(); 41 login_validator.resetForm(); 42 } 43 }); 44 45 $(".menu_register_link").click(function(e) { 46 if (jsPassData.type_modal != 'LinkToDefault') { 47 e.stopPropagation(); 48 e.preventDefault(); 49 var offset = $( this ).offset(); 50 var windowsize = $(window).width(); 51 if (jsPassData.type_modal == 'Dropdown') { 52 $("#csh-login-wrap").css('position', 'absolute'); 53 $("#csh-login-wrap").css('top', offset.top + 30); 54 $("#csh-login-wrap").css('left', offset.left); 55 } 56 57 $("#csh-login-wrap").slideToggle(250); 58 $(".login_form").hide(); 59 $(".register_form").show(); 60 $("#register_user").focus(); 61 $(".lost_pwd_form").hide(); 62 $(".back_login").show(); 63 $(".alert_status").hide(); 64 //clear form fields 65 $(".register_form").find("input[type=text],input[type=email],input[type=password],textarea").val(""); 66 $(".lost_pwd_form").find("input[type=email],textarea").val(""); 67 68 //clear validation. 69 var register_validator = $(".register_form").validate(); 70 register_validator.resetForm(); 71 72 } 73 }); 74 75 $(document).keydown(function(e) { 76 if (e.keyCode === 27) { 77 e.stopPropagation(); 78 $("#csh-login-wrap").slideUp(200); 79 } 80 }); 81 82 var mouse_is_inside = false;
83 $('.login_dialog').hover(function() { 84 mouse_is_inside = true; 85 }, function() { 86 mouse_is_inside = false; 87 }); 88 89 $("body").mousedown(function(e) { 90 if (e.which == 1) { 91 if (!mouse_is_inside) { 92 $('#csh-login-wrap').slideUp(200); 93 } 94 } 95 }); 96 97 $('.boxclose').click(function() { 98 $("#csh-login-wrap").slideUp(200); 99 }); 100 //Login form 101 $(".go_to_register_link").click(function(e) { 102 e.preventDefault(); 103 e.stopPropagation(); 104 $(".login_form").hide(); 105 $(".lost_pwd_form").hide(); 106 $(".register_form").show(); 107 $("#register_user").focus(); 108 $(".back_login").show(); 109 $(".alert_status").hide(); 110 111 //clear validation. 112 var register_validator = $(".register_form").validate(); 113 register_validator.resetForm(); 114 }); 115 116 $(".go_to_lostpassword_link").click(function(e) { 117 e.preventDefault(); 118 e.stopPropagation(); 119 $(".login_form").hide(); 120 $(".lost_pwd_form").show(); 121 $("#lost_pwd_user_email").focus(); 122 $(".register_form").hide(); 123 $(".back_login").show(); 124 $(".alert_status").hide(); 125 126 //clear validation. 127 var lostpwd_validator = $(".lost_pwd_form").validate(); 128 lostpwd_validator.resetForm(); 129 }); 130 131 $(".back_login").click(function(e) { 132 e.preventDefault(); 133 e.stopPropagation(); 134 $(".login_form").show(); 135 $("#login_user").focus(); 136 $(".register_form").hide(); 137 $(".lost_pwd_form").hide(); 138 $(".back_login").hide(); 139 $(".alert_status").hide(); 140 }); 141 //validate form. 142 $('.login_form').removeData('validator'); 143 $('.register_form').removeData('validator'); 144 $('.lost_pwd_form').removeData('validator'); 145 146 $('.login_form').removeData('unobtrusiveValidation'); 147 $('.register_form').removeData('unobtrusiveValidation'); 148 $('.lost_pwd_form').removeData('unobtrusiveValidation'); 149 150 var login_form = $(".login_form"); 151 login_form.validate({ 152 invalidHandler: function(form, validator) { 153 var errors = validator.numberOfInvalids(); 154 if (errors) { 155 $('.alert_status').show(); 156 $('.alert_status').val(validator.errorList[0].message); 157 validator.errorList[0].element.focus(); //Set Focus 158 } 159 }, 160 rules: { 161 login_user: { 162 required: true, 163 }, 164 pass_user: { 165 required: true, 166 minlength: 6 167 }, 168 }, 169 messages: { 170 login_user: {required: "Enter your name"}, 171 pass_user: {required: "Enter your Password", minlength:"At least 6 characters"} 172 }, 173 errorPlacement: function(error, element) { 174 //Nothing 175 } 176 }); 177 178 var register_form = $(".register_form"); 179 register_form.validate({ 180 invalidHandler: function(form, validator) { 181 var errors = validator.numberOfInvalids(); 182 if (errors) { 183 $('.alert_status').show(); 184 $('.alert_status').val(validator.errorList[0].message); 185 validator.errorList[0].element.focus(); //Set Focus 186 } 187 }, 188 rules: { 189 register_user: { 190 required: true, 191 }, 192 register_email: { 193 required: true, 194 email: true, 195 }, 196 register_pass: { 197 required: true, 198 minlength: 6 199 }, 200 confirm_pass: { 201 required: true, 202 minlength: 6, 203 equalTo: "#register_pass", 204 }, 205 }, 206 messages: { 207 register_user: {required: "Enter your name"}, 208 register_email: {required: "Enter the email",email: "Invalid email address" }, 209 register_pass: {required: "Enter the password.",minlength:"At least 6 characters"}, 210 confirm_pass: {required: "Enter the password confirm.",equalTo:"Confirm password not match"} 211 }, 212 errorPlacement: function(error, element) { 213 // 214 } 215 }); 216 217 var lost_pwd_form = $(".lost_pwd_form"); 218 lost_pwd_form.validate({ 219 invalidHandler: function(form, validator) { 220 var errors = validator.numberOfInvalids(); 221 if (errors) { 222 $('.alert_status').show(); 223 $('.alert_status').val(validator.errorList[0].message); 224 validator.errorList[0].element.focus(); //Set Focus 225 } 226 }, 227 rules: { 228 lost_pwd_user_email: { 229 required: true, 230 }, 231 }, 232 messages: { 233 lost_pwd_user_email: {required: "Enter your E-mail"}, 234 }, 235 errorPlacement: function(error, element) { 236 // 237 } 238 }); 239 //login form ajax. 240 $(".login_submit").click(function(e) { 241 e.preventDefault(); 242 e.stopPropagation(); 243 if (login_form.valid()) { 244 var user = $("#login_user").val(); 245 var password = $("#pass_user").val(); 246 var rememberme = $("#rememberme").val(); 247 var arlet_string = ''; 248 $(".alert_status").hide(); 249 $.ajax({ 250 type: 'POST', 251 data: { 252 'action': 'cshlg_login_submit', 253 'user': user, 254 'password': password, 255 'rememberme': rememberme, 256 }, 257 url: jsPassData.ajax_url, 258 success: function(data) { 259 if (data.login_status == "OK") { 260 arlet_string = jsPassData.login_success; 261 $(".alert_status").val(arlet_string); 262 $(".alert_status").addClass('alert-success'); 263 $(".alert_status").show(); 264 265 if (jsPassData.get_login_redirect == 'Home Page') { 266 $(".login_form").attr('action', jsPassData.login_redirect); 267 $(".login_form").submit(); 268 } 269 270 if (jsPassData.get_login_redirect == 'Current Page') { 271 $(".login_form").attr('action', ""); 272 $(".login_form").submit(); 273 } 274 275 if (jsPassData.get_login_redirect == 'Custom URL') { 276 window.location.href = jsPassData.login_redirect; 277 } 278 }else { 279 console.log(data.login_status); 280 arlet_string = jsPassData.login_error; 281 $(".alert_status").val(arlet_string); 282 $(".alert_status").addClass('alert-error'); 283 $(".alert_status").show(); 284 } 285 }, 286 error: function(jqXHR, textStatus, errorThrown) { 287 // Handle any errors 288 } 289 }); 290 } 291 }); 292 293 //register form ajax. 294 $("#register_submit").click(function(e) { 295 e.preventDefault(); 296 e.stopPropagation(); 297 if (register_form.valid()) { 298 var register_user = $("#register_user").val(); 299 var register_email = $("#register_email").val(); 300 var password_register = $("#register_pass").val(); 301 var repass_register = $("#confirm_pass").val(); 302
303 //gcaptcha data 304 var dataArray = $("#register_form").serializeArray(), 305 len = dataArray.length, 306 dataObj = {}; 307 for (i=0; i<len; i++) { 308 dataObj[dataArray[i].name] = dataArray[i].value; 309 } 310 311 var arlet_string = ''; 312 $(".alert_status").hide(); 313 $.ajax({ 314 type: 'POST', 315 data: { 316 'action': 'cshlg_register_submit', 317 'register_user': register_user, 318 'register_email': register_email, 319 'password_register': password_register, 320 'g-recaptcha-response': dataObj['g-recaptcha-response'], 321 }, 322 url: jsPassData.ajax_url, 323 success: function(data) { 324 if (data.captcha == 'INCORRECT') { 325 arlet_string = 'Captcha is required!'; 326 $(".alert_status").val(arlet_string); 327 $(".alert_status").show(); 328 }else { 329 if (data.register_status == "OK") { 330 if (jsPassData.generated_pass == 'on') { 331 arlet_string = 'Register Successfull!'; 332 }else{ 333 arlet_string = 'Register Successfull, Check your E-mail'; 334 } 335 336 $(".alert_status").val(arlet_string); 337 $(".alert_status").show(); 338 setTimeout(function() { 339 window.location = jsPassData.register_redirect; 340 }, 2000); 341 }else { 342 if (data.register_status == 'ERRORMAIL') { 343 arlet_string = 'Sorry! We cant sent email for you'; 344 }else{ 345 arlet_string = 'Email already exists'; 346 } 347 $(".alert_status").val(arlet_string); 348 $(".alert_status").show(); 349 } 350 } 351 352 }, 353 error: function(jqXHR, textStatus, errorThrown) { 354 // Handle any errors 355 } 356 }); 357 } 358 }); 359 360 //lost password form. 361 $("#lost_pwd_submit").click(function(e) { 362 e.preventDefault(); 363 e.stopPropagation(); 364 if (lost_pwd_form.valid()) { 365 var lost_pwd_user_email = $("#lost_pwd_user_email").val(); 366 var arlet_string = ''; 367 $(".alert_status").hide(); 368 $.ajax({ 369 type: 'POST', 370 data: { 371 'action': 'cshlg_lost_pwd_submit', 372 'lost_pwd_user_email': lost_pwd_user_email, 373 }, 374 url: jsPassData.ajax_url, 375 success: function(data) { 376 if (data.lost_pwd_status == "OK") { 377 arlet_string = 'Check your email for a link to reset your password. '; 378 $(".alert_status").val(arlet_string); 379 $(".alert_status").show(); 380 }else { 381 if (data.lost_pwd_status == 'ERRORMAIL') { 382 arlet_string = 'Cant sent Email'; 383 }else{ 384 arlet_string = 'Not registered User or Email'; 385 } 386 $(".alert_status").val(arlet_string); 387 $(".alert_status").show(); 388 } 389 }, 390 error: function(jqXHR, textStatus, errorThrown) { 391 // Handle any errors 392 } 393 }); 394 } 395 }); 396 //for login facebook. 397 if (window.location.hash == '#_=_'){ 398 // Check if the browser supports history.replaceState. 399 if (history.replaceState) { 400 // Keep the exact URL up to the hash. 401 var cleanHref = window.location.href.split('#')[0]; 402 // Replace the URL in the address bar without messing with the back button. 403 history.replaceState(null, null, cleanHref); 404 405 }else { 406 // Well, you're on an old browser, we can get rid of the _=_ but not the #. 407 window.location.hash = ''; 408 409 } 410 } 411 412 $(document).find('input.cshlg-inline-css[type=hidden]').each(function () { 413 var _this = $(this); 414 $('head').append("<style>"+_this.val()+"</style>"); 415 _this.remove(); 416 }); 417 418});
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.