diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-02-13 07:41:51 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-02-13 07:41:51 +0000 |
commit | f9605d808aaba003bccd9d5c735e730ffbbe5555 (patch) | |
tree | 7719249cabbb7beec9c17f06e4581fd976f02a3d | |
parent | 153b5fcb3a8d93492180b94e804b1700930b9591 (diff) | |
download | brdo-f9605d808aaba003bccd9d5c735e730ffbbe5555.tar.gz brdo-f9605d808aaba003bccd9d5c735e730ffbbe5555.tar.bz2 |
- Patch #97213 by neclimdul: usability improvement: implemented clean URL test with jQuery.
-rw-r--r-- | modules/system/system.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/system/system.js b/modules/system/system.js new file mode 100644 index 000000000..a44d3ef2a --- /dev/null +++ b/modules/system/system.js @@ -0,0 +1,24 @@ +/** + * Internal function to check using Ajax if clean URLs can be enabled on the + * settings page. + * + * This function is not used to verify whether or not clean URLs + * are currently enabled. + */ +Drupal.cleanURLsSettingsCheck = function() { + var url = location.pathname +"admin/settings/clean-urls"; + $("#clean-url .description span").html('<div id="testing">'+ Drupal.settings.cleanURL.testing +"</div>"); + $("#clean-url p").hide(); + $.ajax({url: location.protocol +"//"+ location.hostname + url, type: "GET", data: " ", complete: function(response) { + $("#testing").toggle(); + if (response.status == 200) { + // Check was successful. + $("#clean-url input.form-radio").attr("disabled", ""); + $("#clean-url .description span").append('<div class="ok">'+ Drupal.settings.cleanURL.success +"</div>"); + } + else { + // Check failed. + $("#clean-url .description span").append('<div class="warning">'+ Drupal.settings.cleanURL.failure +"</div>"); + } + }}); +} |