From f9605d808aaba003bccd9d5c735e730ffbbe5555 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 13 Feb 2007 07:41:51 +0000 Subject: - Patch #97213 by neclimdul: usability improvement: implemented clean URL test with jQuery. --- modules/system/system.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 modules/system/system.js (limited to 'modules') 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('
'+ Drupal.settings.cleanURL.testing +"
"); + $("#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('
'+ Drupal.settings.cleanURL.success +"
"); + } + else { + // Check failed. + $("#clean-url .description span").append('
'+ Drupal.settings.cleanURL.failure +"
"); + } + }}); +} -- cgit v1.2.3