diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/block/block.js | 20 | ||||
-rw-r--r-- | modules/book/book.js | 6 | ||||
-rw-r--r-- | modules/color/color.js | 20 | ||||
-rw-r--r-- | modules/comment/comment-node-form.js | 6 | ||||
-rw-r--r-- | modules/comment/comment.js | 8 | ||||
-rw-r--r-- | modules/menu/menu.js | 6 | ||||
-rw-r--r-- | modules/node/content_types.js | 8 | ||||
-rw-r--r-- | modules/node/node.js | 12 | ||||
-rw-r--r-- | modules/openid/openid.js | 8 | ||||
-rw-r--r-- | modules/path/path.js | 6 | ||||
-rw-r--r-- | modules/profile/profile.js | 10 | ||||
-rw-r--r-- | modules/simpletest/simpletest.js | 20 | ||||
-rw-r--r-- | modules/simpletest/tests/common.test | 4 | ||||
-rw-r--r-- | modules/system/system.js | 28 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.js | 6 | ||||
-rw-r--r-- | modules/upload/upload.js | 6 | ||||
-rw-r--r-- | modules/user/user.js | 16 |
17 files changed, 95 insertions, 95 deletions
diff --git a/modules/block/block.js b/modules/block/block.js index f8f96111c..3fd6a5aba 100644 --- a/modules/block/block.js +++ b/modules/block/block.js @@ -1,5 +1,5 @@ // $Id$ -(function($) { +(function ($) { /** * Move a block in the blocks table from one region to another via select list. @@ -8,22 +8,22 @@ * objects initialized in that behavior to update the row. */ Drupal.behaviors.blockDrag = { - attach: function(context, settings) { + attach: function (context, settings) { var table = $('table#blocks'); var tableDrag = Drupal.tableDrag.blocks; // Get the blocks tableDrag object. // Add a handler for when a row is swapped, update empty regions. - tableDrag.row.prototype.onSwap = function(swappedRow) { + tableDrag.row.prototype.onSwap = function (swappedRow) { checkEmptyRegions(table, this); }; // A custom message for the blocks page specifically. - Drupal.theme.tableDragChangedWarning = function() { + Drupal.theme.tableDragChangedWarning = function () { return '<div class="warning">' + Drupal.theme('tableDragChangedMarker') + ' ' + Drupal.t('The changes to these blocks will not be saved until the <em>Save blocks</em> button is clicked.') + '</div>'; }; // Add a handler so when a row is dropped, update fields dropped into new regions. - tableDrag.onDrop = function() { + tableDrag.onDrop = function () { dragObject = this; if ($(dragObject.rowObject.element).prev('tr').is('.region-message')) { var regionRow = $(dragObject.rowObject.element).prev('tr').get(0); @@ -41,15 +41,15 @@ Drupal.behaviors.blockDrag = { }; // Add the behavior to each region select list. - $('select.block-region-select:not(.blockregionselect-processed)', context).each(function() { - $(this).change(function(event) { + $('select.block-region-select:not(.blockregionselect-processed)', context).each(function () { + $(this).change(function (event) { // Make our new row and select field. var row = $(this).parents('tr:first'); var select = $(this); tableDrag.rowObject = new tableDrag.row(row); // Find the correct region and insert the row as the first in the region. - $('tr.region-message', table).each(function() { + $('tr.region-message', table).each(function () { if ($(this).is('.region-' + select[0].value + '-message')) { // Add the new row and remove the old one. $(this).after(row); @@ -75,8 +75,8 @@ Drupal.behaviors.blockDrag = { $(this).addClass('blockregionselect-processed'); }); - var checkEmptyRegions = function(table, rowObject) { - $('tr.region-message', table).each(function() { + var checkEmptyRegions = function (table, rowObject) { + $('tr.region-message', table).each(function () { // If the dragged row is in this region, but above the message row, swap it down one space. if ($(this).prev('tr').get(0) == rowObject.element) { // Prevent a recursion problem when using the keyboard to move rows up. diff --git a/modules/book/book.js b/modules/book/book.js index 74baffccf..cc3e66847 100644 --- a/modules/book/book.js +++ b/modules/book/book.js @@ -1,10 +1,10 @@ // $Id$ -(function($) { +(function ($) { Drupal.behaviors.bookFieldsetSummaries = { - attach: function(context) { - $('fieldset#edit-book', context).setSummary(function(context) { + attach: function (context) { + $('fieldset#edit-book', context).setSummary(function (context) { var val = $('#edit-book-bid').val(); if (val === '0') { diff --git a/modules/color/color.js b/modules/color/color.js index 1b1199899..5c978d4d5 100644 --- a/modules/color/color.js +++ b/modules/color/color.js @@ -1,8 +1,8 @@ // $Id$ -(function($) { +(function ($) { Drupal.behaviors.color = { - attach: function(context, settings) { + attach: function (context, settings) { // This behavior attaches by ID, so is only valid once on a page. if ($('#color_scheme_form .color-form.color-processed').size()) { return; @@ -42,7 +42,7 @@ Drupal.behaviors.color = { } // Set up colorscheme selector. - $('#edit-scheme', form).change(function() { + $('#edit-scheme', form).change(function () { var colors = this.options[this.selectedIndex].value; if (colors != '') { colors = colors.split(','); @@ -75,7 +75,7 @@ Drupal.behaviors.color = { var accum = top; // Render gradient lines. - $('#gradient > div', form).each(function() { + $('#gradient > div', form).each(function () { for (i in accum) { accum[i] += delta[i]; } @@ -175,7 +175,7 @@ Drupal.behaviors.color = { * Reset the color scheme selector. */ function resetScheme() { - $('#edit-scheme', form).each(function() { + $('#edit-scheme', form).each(function () { this.selectedIndex = this.options.length - 1; }); } @@ -190,7 +190,7 @@ Drupal.behaviors.color = { // Add new bindings. focused = this; - farb.linkTo(function(color) { callback(input, color, true, false); }); + farb.linkTo(function (color) { callback(input, color, true, false); }); farb.setColor(this.value); $(focused).keyup(farb.updateValue).keyup(preview).keyup(resetScheme) .parent().addClass('item-selected'); @@ -198,18 +198,18 @@ Drupal.behaviors.color = { // Initialize color fields. $('#palette input.form-text', form) - .each(function() { + .each(function () { // Extract palette field name this.key = this.id.substring(13); // Link to color picker temporarily to initialize. - farb.linkTo(function() {}).setColor('#000').linkTo(this); + farb.linkTo(function () {}).setColor('#000').linkTo(this); // Add lock. var i = inputs.length; if (inputs.length) { var lock = $('<div class="lock"></div>').toggle( - function() { + function () { $(this).addClass('unlocked'); $(hooks[i - 1]).attr('class', locks[i - 2] && $(locks[i - 2]).is(':not(.unlocked)') ? 'hook up' : 'hook' @@ -218,7 +218,7 @@ Drupal.behaviors.color = { locks[i] && $(locks[i]).is(':not(.unlocked)') ? 'hook down' : 'hook' ); }, - function() { + function () { $(this).removeClass('unlocked'); $(hooks[i - 1]).attr('class', locks[i - 2] && $(locks[i - 2]).is(':not(.unlocked)') ? 'hook both' : 'hook down' diff --git a/modules/comment/comment-node-form.js b/modules/comment/comment-node-form.js index 9c7dea7cc..20d8729f4 100644 --- a/modules/comment/comment-node-form.js +++ b/modules/comment/comment-node-form.js @@ -1,10 +1,10 @@ // $Id$ -(function($) { +(function ($) { Drupal.behaviors.commentFieldsetSummaries = { - attach: function(context) { - $('fieldset#edit-comment-settings', context).setSummary(function(context) { + attach: function (context) { + $('fieldset#edit-comment-settings', context).setSummary(function (context) { return Drupal.checkPlain($('input:checked', context).parent().text()); }); } diff --git a/modules/comment/comment.js b/modules/comment/comment.js index 3d2b92edd..bdd1c3b95 100644 --- a/modules/comment/comment.js +++ b/modules/comment/comment.js @@ -1,9 +1,9 @@ // $Id$ -(function($) { +(function ($) { Drupal.behaviors.comment = { - attach: function(context, settings) { - $.each(['name', 'homepage', 'mail'], function() { + attach: function (context, settings) { + $.each(['name', 'homepage', 'mail'], function () { var cookie = Drupal.comment.getCookie('comment_info_' + this); if (cookie) { $('#comment-form input[name=' + this + ']:not(.comment-processed)', context) @@ -16,7 +16,7 @@ Drupal.behaviors.comment = { Drupal.comment = {}; -Drupal.comment.getCookie = function(name) { +Drupal.comment.getCookie = function (name) { var search = name + '='; var returnValue = ''; diff --git a/modules/menu/menu.js b/modules/menu/menu.js index cc39e7e8e..255891df1 100644 --- a/modules/menu/menu.js +++ b/modules/menu/menu.js @@ -1,10 +1,10 @@ // $Id$ -(function($) { +(function ($) { Drupal.behaviors.menuFieldsetSummaries = { - attach: function(context) { - $('fieldset#edit-menu', context).setSummary(function(context) { + attach: function (context) { + $('fieldset#edit-menu', context).setSummary(function (context) { return Drupal.checkPlain($('#edit-menu-link-title', context).val()) || Drupal.t('Not in menu'); }); } diff --git a/modules/node/content_types.js b/modules/node/content_types.js index 8b32ae8ea..bee78bc83 100644 --- a/modules/node/content_types.js +++ b/modules/node/content_types.js @@ -1,15 +1,15 @@ // $Id$ -(function($) { +(function ($) { Drupal.behaviors.contentTypes = { - attach: function() { + attach: function () { if ($('#edit-type').val() == $('#edit-name').val().toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/_+/g, '_') || $('#edit-type').val() == '') { $('#edit-type-wrapper').hide(); - $('#edit-name').keyup(function() { + $('#edit-name').keyup(function () { var machine = $(this).val().toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/_+/g, '_'); if (machine != '_' && machine != '') { $('#edit-type').val(machine); - $('#node-type-name-suffix').empty().append(' Machine name: ' + machine + ' [').append($('<a href="#">' + Drupal.t('Edit') + '</a>').click(function() { + $('#node-type-name-suffix').empty().append(' Machine name: ' + machine + ' [').append($('<a href="#">' + Drupal.t('Edit') + '</a>').click(function () { $('#edit-type-wrapper').show(); $('#node-type-name-suffix').hide(); $('#edit-name').unbind('keyup'); diff --git a/modules/node/node.js b/modules/node/node.js index 59647b34e..4a0c49d63 100644 --- a/modules/node/node.js +++ b/modules/node/node.js @@ -1,26 +1,26 @@ // $Id$ -(function($) { +(function ($) { Drupal.behaviors.nodeFieldsetSummaries = { - attach: function(context) { - $('fieldset#edit-revision-information', context).setSummary(function(context) { + attach: function (context) { + $('fieldset#edit-revision-information', context).setSummary(function (context) { return $('#edit-revision', context).is(':checked') ? Drupal.t('New revision') : Drupal.t('No revision'); }); - $('fieldset#edit-author', context).setSummary(function(context) { + $('fieldset#edit-author', context).setSummary(function (context) { var name = $('#edit-name').val(), date = $('#edit-date').val(); return date ? Drupal.t('By @name on @date', { '@name': name, '@date': date }) : Drupal.t('By @name', { '@name': name }); }); - $('fieldset#edit-options', context).setSummary(function(context) { + $('fieldset#edit-options', context).setSummary(function (context) { var vals = []; - $('input:checked', context).parent().each(function() { + $('input:checked', context).parent().each(function () { vals.push(Drupal.checkPlain($.trim($(this).text()))); }); diff --git a/modules/openid/openid.js b/modules/openid/openid.js index 14d70d3a1..78c1d2b3f 100644 --- a/modules/openid/openid.js +++ b/modules/openid/openid.js @@ -1,8 +1,8 @@ // $Id$ -(function($) { +(function ($) { Drupal.behaviors.openid = { - attach: function(context) { + attach: function (context) { var loginElements = $('#edit-name-wrapper, #edit-pass-wrapper, li.openid-link'); var openidElements = $('#edit-openid-identifier-wrapper, li.user-link'); @@ -15,7 +15,7 @@ Drupal.behaviors.openid = { } $('li.openid-link:not(.openid-processed)', context) .addClass('openid-processed') - .click(function() { + .click(function () { loginElements.hide(); openidElements.css('display', 'block'); // Remove possible error message. @@ -27,7 +27,7 @@ Drupal.behaviors.openid = { }); $('li.user-link:not(.openid-processed)', context) .addClass('openid-processed') - .click(function() { + .click(function () { openidElements.hide(); loginElements.css('display', 'block'); // Clear OpenID Identifier field and remove possible error message. diff --git a/modules/path/path.js b/modules/path/path.js index e801a9a26..388c1f53e 100644 --- a/modules/path/path.js +++ b/modules/path/path.js @@ -1,10 +1,10 @@ // $Id$ -(function($) { +(function ($) { Drupal.behaviors.pathFieldsetSummaries = { - attach: function(context) { - $('fieldset#edit-path', context).setSummary(function(context) { + attach: function (context) { + $('fieldset#edit-path', context).setSummary(function (context) { var path = $('#edit-path-1').val(); return path ? diff --git a/modules/profile/profile.js b/modules/profile/profile.js index 334d71df6..9f52559f5 100644 --- a/modules/profile/profile.js +++ b/modules/profile/profile.js @@ -1,5 +1,5 @@ // $Id$ -(function($) { +(function ($) { /** * Add functionality to the profile drag and drop table. @@ -9,14 +9,14 @@ * a warning message when removing the last field from a profile category. */ Drupal.behaviors.profileDrag = { - attach: function(context, settings) { + attach: function (context, settings) { var table = $('#profile-fields'); var tableDrag = Drupal.tableDrag['profile-fields']; // Get the profile tableDrag object. // Add a handler for when a row is swapped, update empty categories. - tableDrag.row.prototype.onSwap = function(swappedRow) { + tableDrag.row.prototype.onSwap = function (swappedRow) { var rowObject = this; - $('tr.category-message', table).each(function() { + $('tr.category-message', table).each(function () { // If the dragged row is in this category, but above the message row, swap it down one space. if ($(this).prev('tr').get(0) == rowObject.element) { // Prevent a recursion problem when using the keyboard to move rows up. @@ -36,7 +36,7 @@ Drupal.behaviors.profileDrag = { }; // Add a handler so when a row is dropped, update fields dropped into new categories. - tableDrag.onDrop = function() { + tableDrag.onDrop = function () { dragObject = this; if ($(dragObject.rowObject.element).prev('tr').is('.category-message')) { var categoryRow = $(dragObject.rowObject.element).prev('tr').get(0); diff --git a/modules/simpletest/simpletest.js b/modules/simpletest/simpletest.js index 91912599f..dc11cfca4 100644 --- a/modules/simpletest/simpletest.js +++ b/modules/simpletest/simpletest.js @@ -1,20 +1,20 @@ // $Id$ -(function($) { +(function ($) { /** * Add the cool table collapsing on the testing overview page. */ Drupal.behaviors.simpleTestMenuCollapse = { - attach: function(context, settings) { + attach: function (context, settings) { var timeout = null; // Adds expand-collapse functionality. - $('div.simpletest-image').each(function() { + $('div.simpletest-image').each(function () { direction = settings.simpleTest[$(this).attr('id')].imageDirection; $(this).html(settings.simpleTest.images[direction]); }); // Adds group toggling functionality to arrow images. - $('div.simpletest-image').click(function() { + $('div.simpletest-image').click(function () { var trs = $(this).parents('tbody').children('.' + settings.simpleTest[this.id].testClass); var direction = settings.simpleTest[this.id].imageDirection; var row = direction ? trs.size() - 1 : 0; @@ -60,17 +60,17 @@ Drupal.behaviors.simpleTestMenuCollapse = { * selected/deselected. */ Drupal.behaviors.simpleTestSelectAll = { - attach: function(context, settings) { - $('td.simpletest-select-all').each(function() { + attach: function (context, settings) { + $('td.simpletest-select-all').each(function () { var testCheckboxes = settings.simpleTest['simpletest-test-group-' + $(this).attr('id')].testNames; var groupCheckbox = $('<input type="checkbox" class="form-checkbox" id="' + $(this).attr('id') + '-select-all" />'); // Each time a single-test checkbox is checked or unchecked, make sure // that the associated group checkbox gets the right state too. - var updateGroupCheckbox = function() { + var updateGroupCheckbox = function () { var checkedTests = 0; for (var i = 0; i < testCheckboxes.length; i++) { - $('#' + testCheckboxes[i]).each(function() { + $('#' + testCheckboxes[i]).each(function () { if (($(this).attr('checked'))) { checkedTests++; } @@ -80,7 +80,7 @@ Drupal.behaviors.simpleTestSelectAll = { }; // Have the single-test checkboxes follow the group checkbox. - groupCheckbox.change(function() { + groupCheckbox.change(function () { var checked = !!($(this).attr('checked')); for (var i = 0; i < testCheckboxes.length; i++) { $('#' + testCheckboxes[i]).attr('checked', checked); @@ -89,7 +89,7 @@ Drupal.behaviors.simpleTestSelectAll = { // Have the group checkbox follow the single-test checkboxes. for (var i = 0; i < testCheckboxes.length; i++) { - $('#' + testCheckboxes[i]).change(function() { + $('#' + testCheckboxes[i]).change(function () { updateGroupCheckbox(); }); } diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test index a6ff854ba..735360eb8 100644 --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -493,7 +493,7 @@ class JavaScriptTestCase extends DrupalWebTestCase { * Test adding inline scripts. */ function testAddInline() { - $inline = 'jQuery(function(){});'; + $inline = 'jQuery(function () { });'; $javascript = drupal_add_js($inline, array('type' => 'inline', 'scope' => 'footer')); $this->assertTrue(array_key_exists('misc/jquery.js', $javascript), t('jQuery is added when inline scripts are added.')); $data = end($javascript); @@ -515,7 +515,7 @@ class JavaScriptTestCase extends DrupalWebTestCase { * Test drupal_get_js() with a footer scope. */ function testFooterHTML() { - $inline = 'jQuery(function(){});'; + $inline = 'jQuery(function () { });'; drupal_add_js($inline, array('type' => 'inline', 'scope' => 'footer')); $javascript = drupal_get_js('footer'); $this->assertTrue(strpos($javascript, $inline) > 0, t('Rendered JavaScript footer returns the inline code.')); diff --git a/modules/system/system.js b/modules/system/system.js index 0b424812a..3422cd879 100644 --- a/modules/system/system.js +++ b/modules/system/system.js @@ -1,5 +1,5 @@ // $Id$ -(function($) { +(function ($) { /** * Internal function to check using Ajax if clean URLs can be enabled on the @@ -9,7 +9,7 @@ * are currently enabled. */ Drupal.behaviors.cleanURLsSettingsCheck = { - attach: function(context, settings) { + attach: function (context, settings) { // 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. @@ -22,13 +22,13 @@ Drupal.behaviors.cleanURLsSettingsCheck = { $.ajax({ 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('<div class="ok">' + Drupal.t('Your server has been successfully tested to support this feature.') + '</div>'); $('#testing').hide(); }, - error: function() { + error: function () { // Check failed. $('#clean-url .description span').append('<div class="warning">' + Drupal.t('Your system configuration does not currently support this feature. The <a href="http://drupal.org/node/15365">handbook page on Clean URLs</a> has additional troubleshooting information.') + '</div>'); $('#testing').hide(); @@ -45,7 +45,7 @@ Drupal.behaviors.cleanURLsSettingsCheck = { * This function is not used to verify whether or not clean URLs * are currently enabled. */ -Drupal.cleanURLsInstallCheck = function() { +Drupal.cleanURLsInstallCheck = function () { 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. @@ -53,7 +53,7 @@ Drupal.cleanURLsInstallCheck = function() { async: false, url: url, dataType: 'json', - success: function() { + success: function () { // Check was successful. $('#edit-clean-url').attr('value', 1); } @@ -67,14 +67,14 @@ Drupal.cleanURLsInstallCheck = function() { * administrator e-mail address with the same value as the site e-mail address. */ Drupal.behaviors.copyFieldValue = { - attach: function(context, settings) { + attach: function (context, settings) { for (var sourceId in settings.copyFieldValue) { // Get the list of target fields. targetIds = settings.copyFieldValue[sourceId]; if (!$('#'+ sourceId + '.copy-field-values-processed', context).size()) { // Add the behavior to update target fields on blur of the primary field. sourceField = $('#' + sourceId); - sourceField.bind('blur', function() { + sourceField.bind('blur', function () { for (var delta in targetIds) { var targetField = $('#'+ targetIds[delta]); if (targetField.val() == '') { @@ -92,17 +92,17 @@ Drupal.behaviors.copyFieldValue = { * Show/hide custom format sections on the regional settings page. */ Drupal.behaviors.dateTime = { - attach: function(context, settings) { + attach: function (context, settings) { // Show/hide custom format depending on the select's value. - $('select.date-format:not(.date-time-processed)', context).change(function() { + $('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'](); }); // Attach keyup handler to custom format inputs. - $('input.custom-format:not(.date-time-processed)', context).addClass('date-time-processed').keyup(function() { + $('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()); - $.getJSON(url, function(data) { + $.getJSON(url, function (data) { $('div.description span', input.parent()).html(data); }); }); @@ -116,8 +116,8 @@ Drupal.behaviors.dateTime = { * Show the powered by Drupal image preview */ Drupal.behaviors.poweredByPreview = { - attach: function(context, settings) { - $('#edit-color, #edit-size').change(function() { + attach: function (context, settings) { + $('#edit-color, #edit-size').change(function () { var path = settings.basePath + 'misc/' + $('#edit-color').val() + '-' + $('#edit-size').val() + '.png'; $('img.powered-by-preview').attr('src', path); }); diff --git a/modules/taxonomy/taxonomy.js b/modules/taxonomy/taxonomy.js index d047950df..a9539b206 100644 --- a/modules/taxonomy/taxonomy.js +++ b/modules/taxonomy/taxonomy.js @@ -1,5 +1,5 @@ // $Id$ -(function($) { +(function ($) { /** * Move a block in the blocks table from one region to another via select list. @@ -8,13 +8,13 @@ * objects initialized in that behavior to update the row. */ Drupal.behaviors.termDrag = { - attach: function(context, settings) { + attach: function (context, settings) { var table = $('#taxonomy', context); var tableDrag = Drupal.tableDrag.taxonomy; // Get the blocks tableDrag object. var rows = $('tr', table).size(); // When a row is swapped, keep previous and next page classes set. - tableDrag.row.prototype.onSwap = function(swappedRow) { + tableDrag.row.prototype.onSwap = function (swappedRow) { $('tr.taxonomy-term-preview', table).removeClass('taxonomy-term-preview'); $('tr.taxonomy-term-divider-top', table).removeClass('taxonomy-term-divider-top'); $('tr.taxonomy-term-divider-bottom', table).removeClass('taxonomy-term-divider-bottom'); diff --git a/modules/upload/upload.js b/modules/upload/upload.js index 16f1ad3da..1aae5d1b7 100644 --- a/modules/upload/upload.js +++ b/modules/upload/upload.js @@ -1,10 +1,10 @@ // $Id$ -(function($) { +(function ($) { Drupal.behaviors.uploadFieldsetSummaries = { - attach: function(context) { - $('fieldset#edit-attachments', context).setSummary(function(context) { + attach: function (context) { + $('fieldset#edit-attachments', context).setSummary(function (context) { var size = $('#upload-attachments tbody tr').size(); return Drupal.formatPlural(size, '1 attachment', '@count attachments'); }); diff --git a/modules/user/user.js b/modules/user/user.js index 10077434c..3f2a6a07e 100644 --- a/modules/user/user.js +++ b/modules/user/user.js @@ -1,14 +1,14 @@ // $Id$ -(function($) { +(function ($) { /** * Attach handlers to evaluate the strength of any password fields and to check * that its confirmation is correct. */ Drupal.behaviors.password = { - attach: function(context, settings) { + attach: function (context, settings) { var translate = settings.password; - $('input.password-field:not(.password-processed)', context).each(function() { + $('input.password-field:not(.password-processed)', context).each(function () { var passwordInput = $(this).addClass('password-processed'); var innerWrapper = $(this).parent(); var outerWrapper = $(this).parent().parent(); @@ -31,7 +31,7 @@ Drupal.behaviors.password = { var confirmChild = $('span', confirmResult); // Check the password strength. - var passwordCheck = function() { + var passwordCheck = function () { // Evaluate the password strength. var result = Drupal.evaluatePasswordStrength(passwordInput.val(), settings.password); @@ -56,7 +56,7 @@ Drupal.behaviors.password = { }; // Check that password and confirmation inputs match. - var passwordCheckMatch = function() { + var passwordCheckMatch = function () { if (confirmInput.val()) { var success = passwordInput.val() === confirmInput.val(); @@ -92,7 +92,7 @@ Drupal.behaviors.password = { * * Returns the estimated strength and the relevant output message. */ -Drupal.evaluatePasswordStrength = function(password, translate) { +Drupal.evaluatePasswordStrength = function (password, translate) { var weaknesses = 0, strength = 100, msg = []; var hasLowercase = password.match(/[a-z]+/); @@ -166,8 +166,8 @@ Drupal.evaluatePasswordStrength = function(password, translate) { * "Picture support" radio buttons. */ Drupal.behaviors.userSettings = { - attach: function(context, settings) { - $('div.user-admin-picture-radios input[type=radio]:not(.userSettings-processed)', context).addClass('userSettings-processed').click(function() { + attach: function (context, settings) { + $('div.user-admin-picture-radios input[type=radio]:not(.userSettings-processed)', context).addClass('userSettings-processed').click(function () { $('div.user-admin-picture-settings', context)[['hide', 'show'][this.value]](); }); } |