PageSourceSearch

https://www.anzsleepscience.org/includes/javascript/pages/login.js

js anzsleepscience.org collected 2026-10-08 02:52:36 UTC 4,330 bytes, 136 lines download raw bytes

1$(document).ready(function() {
2
3	//inline login
4	$("#login-submit").on('click',function(event){
5		$("#login-failed-msg").fadeOut('fast');
6		$("#login-form").showLoading();
7		email = $("#login-email").val();
8		password = $("#login-password").val();
9		remember = false;
10
11		$.post( '/index.cfm/member/dologin/', { email: email, password: password, remember: remember } )
12		.done(function(response) {
13
14			if (response.STATUS == 'success'){
15				location.reload();	
16
17			} else if (response.STATUS == 'failed_pendingrenewal'){
18				location.href='/index.cfm/_membership.renewal/lapsedrenewal/';
19			} else {
20				$("#login-form").hideLoading();
21				$("#login-failed-msg").slideDown('fast');
22			}
23		});
24	});
25
26
27	//modal login
28	$("#login-submit-inline").on('click',function(event){
29		$("#login-failed-msg-inline").fadeOut('fast');
30		$("#login-form-inline").showLoading();
31		email = $("#login-email-inline").val();
32		password = $("#login-password-inline").val();
33		remember = false;
34
35		$.post( '/index.cfm/member/dologin/', { email: email, password: password, remember: remember } )
36		.done(function(response) {
37
38			if (response.STATUS == 'success'){
39				location.reload();
40
41			} else if (response.STATUS == 'failed_pendingrenewal'){
42				location.href='/index.cfm/_membership.renewal/lapsedrenewal/';
43			} else {
44				$("#login-form-inline").hideLoading();
45				$("#login-failed-msg-inline").slideDown('fast');
46			}
47		});
48	});
49
50	$("#oauth-login-submit").on('click',function(event){
51		$("#login-failed-msg").fadeOut('fast');
52		email = $("#login-email").val();
53		password = $("#login-password").val();
54		if($("#redirect_uri") && $("#redirect_uri").length){
55			redirect_uri = $("#redirect_uri").val();
56		}
57		if($("#state") && $("#state").length){
58			state = $("#state").val();
59		}
60
61		$.post( '/index.cfm/member/oauthdologin/', { email: email, password: password, redirect_uri: redirect_uri } )
62		.done(function(response) {
63
64			if (response.status == 'success'){
65				a = document.createElement('a');
66				a.href = redirect_uri;
67
68				var destination = redirect_uri;
69				destination += (a.search && a.search.trim().length > 0) ? "&" : "?";
70
71				destination += "code=" + response.authtoken + "&profileid=" + response.profileid + "&email=" + response.email;
72
73				if(typeof state !== 'undefined') destination += "&state=" + state;
74				window.location.replace(destination);
75
76			} else if (response.status == 'failed_pendingrenewal'){
77				location.href='/index.cfm/_membership.renewal/lapsedrenewal/';
78			} else {
79				$("#login-failed-msg").text("Login failed. Please try again.");
80				$("#login-failed-msg").slideDown('fast');
81			}
82		});
83	});
84
85	$("#oauth-resetpassword-submit").on('click',function(event){
86		$("#login-failed-msg").fadeOut('fast');
87		email = $("#current-email").val();
88		redirect_uri = $("#redirect_uri").val();
89		state = $("#state").val();
90
91		$.post( '/index.cfm/member/retrievepassword/', { email: email, redirect_uri: redirect_uri, state: state } )
92		.done(function(response) {
93			if (response.message){
94				$("#login-failed-msg").text(response.message);
95				$("#login-failed-msg").slideDown('fast');
96			}
97		});
98	});
99
100	$("#oauth-doresetpassword-submit").on('click',function(event){
101		$("#login-failed-msg").fadeOut('fast');
102		pw = $("#newpassword").val();
103		verify = $("#verifypassword").val();
104		redirect_uri = $("#redirect_uri").val();
105		state = $("#state").val();
106
107		$.post( '/index.cfm/member/oauth_resetpassword_do/', {
108			password_reset: pw, reset_confirm: verify,
109			i1: $("#i1").val(), i2: $("#i2").val(), i3: $("#i3").val(), i4: $("#i4").val(), i5: $("#i5").val()
110		} )
111		.done(function(response) {
112			if (response.message){
113				$("#login-failed-msg").text(response.message);
114				$("#login-failed-msg").slideDown('fast');
115			}
116		});
117	});
118
119	$("#forgetpasswordlink").on('click',function(event){
120		$("#login-failed-msg").hide();
121		$("#login").fadeOut('fast', function(){$("#forgetpassword").fadeIn('slow')});
122		event.preventDefault();
123	});
124
125	$("#backtologinlink").on('click',function(event){
126		$("#login-failed-msg").hide();
127		$("#forgetpassword").fadeOut('fast', function(){$("#login").fadeIn('slow')});
128		event.preventDefault();
129	});
130
131	$("#gotologinlink").on('click',function(event){
132		$("#login-failed-msg").hide();
133		$("#resetpassword").fadeOut('fast', function(){$("#login").fadeIn('slow')});
134		event.preventDefault();
135	});
136});

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.