Welcome to mirror list, hosted at ThFree Co, Russian Federation.

login.js « js « core - github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 012b4e0280e74d760f54f475e1774524fb7bd57b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
 * Copyright (c) 2015
 *  Vincent Petry <pvince81@owncloud.com>
 *  Jan-Christoph Borchardt, http://jancborchardt.net
 * This file is licensed under the Affero General Public License version 3 or later.
 * See the COPYING-README file.
 */

/**
 * @namespace
 * @memberOf OC
 */
OC.Login = _.extend(OC.Login || {}, {
	onLogin: function () {
		// Only if password reset form is not active
		if($('form[name=login][action]').length === 0) {
			$('#submit-wrapper .submit-icon')
				.removeClass('icon-confirm-white')
				.addClass('icon-loading-small-dark');
			$('#submit')
				.attr('value', t('core', 'Logging in …'));
			$('.login-additional').fadeOut();
			return true;
		}
		return false;
	},

	rememberLogin: function(){
		if($(this).is(":checked")){
			if($("#user").val() && $("#password").val()) {
				$('#submit').trigger('click');
			}
		}
	}
});

$(document).ready(function() {
	$('form[name=login]').submit(OC.Login.onLogin);

	$('#remember_login').click(OC.Login.rememberLogin);
});