install.js 1014 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. $(function() {
  2. // prevent double-submission of forms
  3. $('form').submit(function() {
  4. if ($(this).data('submitted')) {
  5. return false;
  6. }
  7. $(this).data('submitted', true);
  8. return true;
  9. });
  10. // toggle the disable attribute of text box based on checkbox
  11. $('.elgg-combo-checkbox').click(function() {
  12. if ($(this).is(':checked')) {
  13. $(this).prev().attr('disabled', true);
  14. $(this).prev().val('');
  15. } else {
  16. $(this).prev().attr('disabled', false);
  17. }
  18. });
  19. });
  20. elgg = {
  21. installer: {}
  22. };
  23. /**
  24. * Check the rewrite address for "success" and then allows the installation to proceed.
  25. */
  26. elgg.installer.rewriteTest = function(url, success_msg, nextURL) {
  27. $.ajax(url, {
  28. success: function(data, status, xhr) {
  29. if (data == 'success') {
  30. $('.elgg-require-rewrite li').attr('class', 'pass');
  31. $('.elgg-require-rewrite li').html('<p>' + success_msg + '</p>');
  32. $('.elgg-install-nav a.elgg-state-disabled')
  33. .removeClass('elgg-state-disabled')
  34. .attr('href', nextURL);
  35. }
  36. }
  37. });
  38. };