aboutsummaryrefslogtreecommitdiff
path: root/install/js/install.js
blob: 37e5b0dc3251fdc0f09ce1dc2109be16a64192cd (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
42
$(function() {
	// prevent double-submission of forms
	$('form').submit(function() {
		if ($(this).data('submitted')) {
			return false;
		}
		$(this).data('submitted', true);
		return true;
	});

	// toggle the disable attribute of text box based on checkbox
	$('.elgg-combo-checkbox').click(function() {
		if ($(this).is(':checked')) {
			$(this).prev().attr('disabled', true);
			$(this).prev().val('');
		} else {
			$(this).prev().attr('disabled', false);
		}
	});
});

elgg = {
	installer: {}
};

/**
 * Check the rewrite address for "success" and then allows the installation to proceed.
 */
elgg.installer.rewriteTest = function(url, success_msg, nextURL) {
	$.ajax(url, {
		success: function(data, status, xhr) {
			if (data == 'success') {
				$('.elgg-require-rewrite li').attr('class', 'pass');
				$('.elgg-require-rewrite li').html('<p>' + success_msg + '</p>');
				$('.elgg-install-nav a.elgg-state-disabled')
					.removeClass('elgg-state-disabled')
					.attr('href', nextURL);
			}
		}
	});
}