// $Id$ /** * 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.host + 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 +"
"); } }}); } /** * Internal function to check using Ajax if clean URLs can be enabled on the * install page. * * This function is not used to verify whether or not clean URLs * are currently enabled. */ Drupal.cleanURLsInstallCheck = function() { var pathname = location.pathname +""; var url = pathname.replace(/\/[^\/]*?$/, '/') +"node"; $("#clean-url .description").append('
'+ Drupal.settings.cleanURL.testing +"
"); $("#clean-url.install").css("display", "block"); $.ajax({url: location.protocol +"//"+ location.host + 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 +"
"); $("#clean-url input.form-radio").attr("checked", 1); } else { // Check failed. $("#clean-url .description span").append('
'+ Drupal.settings.cleanURL.failure +"
"); } }}); } Drupal.installDefaultTimezone = function() { var offset = new Date().getTimezoneOffset() * -60; $("#edit-date-default-timezone").val(offset); }