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

form.js « src - github.com/nextcloud/registration.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e46db8d4e76a106bfbf06278261650118166c807 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
document.addEventListener('DOMContentLoaded', function() {
	// Password toggle
	$('#showadminpass').click((e) => {
		e.preventDefault()
		const passwordTextField = $('#password')
		if (passwordTextField.attr('type') === 'password') {
			passwordTextField.attr('type', 'text')
		} else {
			passwordTextField.attr('type', 'password')
		}
	})

	// Disable submit after first click
	$('form').submit(() => {
		// prevent duplicate form submissions
		$(this).find(':submit').attr('disabled', 'disabled')
		$(this).find(':submit')[0].value = t('registration', 'Loading …')
	})
})