aboutsummaryrefslogtreecommitdiff
path: root/mod/uservalidationbyemail/views/default/uservalidationbyemail/js.php
blob: 35f1ada7faa00021269d71e34df0f9c4685c8044 (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
elgg.provide('elgg.uservalidationbyemail');

elgg.uservalidationbyemail.init = function() {
	$('.unvalidated-users-checkall').click(function() {
		checked = $(this).attr('checked') == 'checked';
		$('form#unvalidated-users').find('input[type=checkbox]').attr('checked', checked);
	});

	$('.unvalidated-users-bulk-post').click(function(event) {
		$form = $('form#unvalidated-users');
		event.preventDefault();

		// check if there are selected users
		if ($form.find('input[type=checkbox]:checked').length < 1) {
			return false;
		}

		// confirmation
		if (!confirm($(this).attr('title'))) {
			return false;
		}

		$form.attr('action', $(this).attr('href')).submit();
	});
}

elgg.register_hook_handler('init', 'system', elgg.uservalidationbyemail.init);