diff options
Diffstat (limited to 'install/js')
-rw-r--r-- | install/js/install.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/install/js/install.js b/install/js/install.js new file mode 100644 index 000000000..37e5b0dc3 --- /dev/null +++ b/install/js/install.js @@ -0,0 +1,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); + } + } + }); +} |