From bda52632a5aa033d44151c224a39236b223c6b0e Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 26 Apr 2009 19:18:46 +0000 Subject: #444402 by kkaefer and RobLoach: Enforce coding standards on all core JavaScript. --- modules/system/system.js | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'modules/system') diff --git a/modules/system/system.js b/modules/system/system.js index 3015a2a8a..0b424812a 100644 --- a/modules/system/system.js +++ b/modules/system/system.js @@ -13,28 +13,28 @@ Drupal.behaviors.cleanURLsSettingsCheck = { // This behavior attaches by ID, so is only valid once on a page. // Also skip if we are on an install page, as Drupal.cleanURLsInstallCheck will handle // the processing. - if ($(".clean-url-processed, #edit-clean-url.install").size()) { + if ($('.clean-url-processed, #edit-clean-url.install').size()) { return; } - var url = settings.basePath +"admin/settings/clean-urls/check"; - $("#clean-url .description span").html('
'+ Drupal.t('Testing clean URLs...') +"
"); - $("#clean-url p").hide(); + var url = settings.basePath + 'admin/settings/clean-urls/check'; + $('#clean-url .description span').html('
' + Drupal.t('Testing clean URLs...') + '
'); + $('#clean-url p').hide(); $.ajax({ - url: location.protocol +"//"+ location.host + url, + url: location.protocol + '//' + location.host + url, dataType: 'json', - success: function () { + success: function() { // Check was successful. - $("#clean-url input.form-radio").attr("disabled", false); - $("#clean-url .description span").append('
'+ Drupal.t('Your server has been successfully tested to support this feature.') +"
"); - $("#testing").hide(); + $('#clean-url input.form-radio').attr('disabled', false); + $('#clean-url .description span').append('
' + Drupal.t('Your server has been successfully tested to support this feature.') + '
'); + $('#testing').hide(); }, error: function() { // Check failed. - $("#clean-url .description span").append('
'+ Drupal.t('Your system configuration does not currently support this feature. The handbook page on Clean URLs has additional troubleshooting information.') +"
"); - $("#testing").hide(); + $('#clean-url .description span').append('
' + Drupal.t('Your system configuration does not currently support this feature. The handbook page on Clean URLs has additional troubleshooting information.') + '
'); + $('#testing').hide(); } }); - $("#clean-url").addClass('clean-url-processed'); + $('#clean-url').addClass('clean-url-processed'); } }; @@ -46,19 +46,19 @@ Drupal.behaviors.cleanURLsSettingsCheck = { * are currently enabled. */ Drupal.cleanURLsInstallCheck = function() { - var url = location.protocol +"//"+ location.host + Drupal.settings.basePath +"admin/settings/clean-urls/check"; + var url = location.protocol + '//' + location.host + Drupal.settings.basePath + 'admin/settings/clean-urls/check'; // Submit a synchronous request to avoid database errors associated with // concurrent requests during install. $.ajax({ async: false, url: url, dataType: 'json', - success: function () { + success: function() { // Check was successful. - $("#edit-clean-url").attr("value", 1); - }, + $('#edit-clean-url').attr('value', 1); + } }); - $("#edit-clean-url").addClass('clean-url-processed'); + $('#edit-clean-url').addClass('clean-url-processed'); }; /** @@ -95,15 +95,15 @@ Drupal.behaviors.dateTime = { attach: function(context, settings) { // Show/hide custom format depending on the select's value. $('select.date-format:not(.date-time-processed)', context).change(function() { - $(this).addClass('date-time-processed').parents("div.date-container").children("div.custom-container")[$(this).val() == "custom" ? "show" : "hide"](); + $(this).addClass('date-time-processed').parents('div.date-container').children('div.custom-container')[$(this).val() == 'custom' ? 'show' : 'hide'](); }); // Attach keyup handler to custom format inputs. $('input.custom-format:not(.date-time-processed)', context).addClass('date-time-processed').keyup(function() { var input = $(this); - var url = settings.dateTime.lookup +(settings.dateTime.lookup.match(/\?q=/) ? "&format=" : "?format=") + Drupal.encodeURIComponent(input.val()); + var url = settings.dateTime.lookup +(settings.dateTime.lookup.match(/\?q=/) ? '&format=' : '?format=') + Drupal.encodeURIComponent(input.val()); $.getJSON(url, function(data) { - $("div.description span", input.parent()).html(data); + $('div.description span', input.parent()).html(data); }); }); -- cgit v1.2.3