diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/block/block.js | 2 | ||||
-rw-r--r-- | modules/color/color.js | 4 | ||||
-rw-r--r-- | modules/comment/comment.js | 2 | ||||
-rw-r--r-- | modules/profile/profile.js | 2 | ||||
-rw-r--r-- | modules/simpletest/simpletest.js | 18 | ||||
-rw-r--r-- | modules/system/system.js | 18 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.js | 18 | ||||
-rw-r--r-- | modules/user/user.js | 12 |
8 files changed, 38 insertions, 38 deletions
diff --git a/modules/block/block.js b/modules/block/block.js index c9c00fab2..f095c3dbc 100644 --- a/modules/block/block.js +++ b/modules/block/block.js @@ -8,7 +8,7 @@ * objects initialized in that behavior to update the row. */ Drupal.behaviors.blockDrag = { - attach: function(context) { + attach: function(context, settings) { var table = $('table#blocks'); var tableDrag = Drupal.tableDrag.blocks; // Get the blocks tableDrag object. diff --git a/modules/color/color.js b/modules/color/color.js index ff2e51952..8ab30fa90 100644 --- a/modules/color/color.js +++ b/modules/color/color.js @@ -2,7 +2,7 @@ (function($) { Drupal.behaviors.color = { - attach: function(context) { + 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; @@ -18,7 +18,7 @@ Drupal.behaviors.color = { var farb = $.farbtastic('#placeholder'); // Decode reference colors to HSL. - var reference = Drupal.settings.color.reference; + var reference = settings.color.reference; for (i in reference) { reference[i] = farb.RGBToHSL(farb.unpack(reference[i])); } diff --git a/modules/comment/comment.js b/modules/comment/comment.js index acd450200..38a026b72 100644 --- a/modules/comment/comment.js +++ b/modules/comment/comment.js @@ -2,7 +2,7 @@ (function($) { Drupal.behaviors.comment = { - attach: function(context) { + attach: function(context, settings) { var parts = new Array("name", "homepage", "mail"); var cookie = ''; for (i=0;i<3;i++) { diff --git a/modules/profile/profile.js b/modules/profile/profile.js index 7668e0ac5..f1d53378b 100644 --- a/modules/profile/profile.js +++ b/modules/profile/profile.js @@ -9,7 +9,7 @@ * a warning message when removing the last field from a profile category. */ Drupal.behaviors.profileDrag = { - attach: function(context) { + attach: function(context, settings) { var table = $('#profile-fields'); var tableDrag = Drupal.tableDrag['profile-fields']; // Get the profile tableDrag object. diff --git a/modules/simpletest/simpletest.js b/modules/simpletest/simpletest.js index 9026de11b..06fb70f30 100644 --- a/modules/simpletest/simpletest.js +++ b/modules/simpletest/simpletest.js @@ -5,18 +5,18 @@ * Add the cool table collapsing on the testing overview page. */ Drupal.behaviors.simpleTestMenuCollapse = { - attach: function() { + attach: function(context, settings) { var timeout = null; // Adds expand-collapse functionality. $('div.simpletest-image').each(function() { - direction = Drupal.settings.simpleTest[$(this).attr('id')].imageDirection; - $(this).html(Drupal.settings.simpleTest.images[direction]); + 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() { - var trs = $(this).parents('tbody').children('.' + Drupal.settings.simpleTest[this.id].testClass); - var direction = Drupal.settings.simpleTest[this.id].imageDirection; + 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; // If clicked in the middle of expanding a group, stop so we can switch directions. @@ -48,8 +48,8 @@ Drupal.behaviors.simpleTestMenuCollapse = { rowToggle(); // Toggle the arrow image next to the test group title. - $(this).html(Drupal.settings.simpleTest.images[(direction ? 0 : 1)]); - Drupal.settings.simpleTest[this.id].imageDirection = !direction; + $(this).html(settings.simpleTest.images[(direction ? 0 : 1)]); + settings.simpleTest[this.id].imageDirection = !direction; }); } @@ -60,9 +60,9 @@ Drupal.behaviors.simpleTestMenuCollapse = { * selected/deselected. */ Drupal.behaviors.simpleTestSelectAll = { - attach: function() { + attach: function(context, settings) { $('td.simpletest-select-all').each(function() { - var testCheckboxes = Drupal.settings.simpleTest['simpletest-test-group-' + $(this).attr('id')].testNames; + 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 diff --git a/modules/system/system.js b/modules/system/system.js index 8a47c3d10..221b03b23 100644 --- a/modules/system/system.js +++ b/modules/system/system.js @@ -9,14 +9,14 @@ * are currently enabled. */ Drupal.behaviors.cleanURLsSettingsCheck = { - attach: function(context) { + 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. if ($("#clean-url.clean-url-processed, #clean-url.install").size()) { return; } - var url = Drupal.settings.basePath +"admin/settings/clean-urls/check"; + var url = settings.basePath +"admin/settings/clean-urls/check"; $("#clean-url .description span").html('<div id="testing">'+ Drupal.t('Testing clean URLs...') +"</div>"); $("#clean-url p").hide(); $.ajax({ @@ -77,10 +77,10 @@ Drupal.cleanURLsInstallCheck = function() { * administrator e-mail address with the same value as the site e-mail address. */ Drupal.behaviors.copyFieldValue = { - attach: function(context) { - for (var sourceId in Drupal.settings.copyFieldValue) { + attach: function(context, settings) { + for (var sourceId in settings.copyFieldValue) { // Get the list of target fields. - targetIds = Drupal.settings.copyFieldValue[sourceId]; + 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); @@ -102,7 +102,7 @@ Drupal.behaviors.copyFieldValue = { * Show/hide custom format sections on the date-time settings page. */ Drupal.behaviors.dateTime = { - attach: function(context) { + 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"](); @@ -111,7 +111,7 @@ Drupal.behaviors.dateTime = { // 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 = Drupal.settings.dateTime.lookup +(Drupal.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); }); @@ -126,9 +126,9 @@ Drupal.behaviors.dateTime = { * Show the powered by Drupal image preview */ Drupal.behaviors.poweredByPreview = { - attach: function(context) { + attach: function(context, settings) { $('#edit-color, #edit-size').change(function() { - var path = Drupal.settings.basePath + 'misc/' + $('#edit-color').val() + '-' + $('#edit-size').val() + '.png'; + 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 2ea68eb08..d047950df 100644 --- a/modules/taxonomy/taxonomy.js +++ b/modules/taxonomy/taxonomy.js @@ -8,7 +8,7 @@ * objects initialized in that behavior to update the row. */ Drupal.behaviors.termDrag = { - attach: function(context) { + attach: function(context, settings) { var table = $('#taxonomy', context); var tableDrag = Drupal.tableDrag.taxonomy; // Get the blocks tableDrag object. var rows = $('tr', table).size(); @@ -19,20 +19,20 @@ Drupal.behaviors.termDrag = { $('tr.taxonomy-term-divider-top', table).removeClass('taxonomy-term-divider-top'); $('tr.taxonomy-term-divider-bottom', table).removeClass('taxonomy-term-divider-bottom'); - if (Drupal.settings.taxonomy.backPeddle) { - for (var n = 0; n < Drupal.settings.taxonomy.backPeddle; n++) { + if (settings.taxonomy.backPeddle) { + for (var n = 0; n < settings.taxonomy.backPeddle; n++) { $(table[0].tBodies[0].rows[n]).addClass('taxonomy-term-preview'); } - $(table[0].tBodies[0].rows[Drupal.settings.taxonomy.backPeddle - 1]).addClass('taxonomy-term-divider-top'); - $(table[0].tBodies[0].rows[Drupal.settings.taxonomy.backPeddle]).addClass('taxonomy-term-divider-bottom'); + $(table[0].tBodies[0].rows[settings.taxonomy.backPeddle - 1]).addClass('taxonomy-term-divider-top'); + $(table[0].tBodies[0].rows[settings.taxonomy.backPeddle]).addClass('taxonomy-term-divider-bottom'); } - if (Drupal.settings.taxonomy.forwardPeddle) { - for (var n = rows - Drupal.settings.taxonomy.forwardPeddle - 1; n < rows - 1; n++) { + if (settings.taxonomy.forwardPeddle) { + for (var n = rows - settings.taxonomy.forwardPeddle - 1; n < rows - 1; n++) { $(table[0].tBodies[0].rows[n]).addClass('taxonomy-term-preview'); } - $(table[0].tBodies[0].rows[rows - Drupal.settings.taxonomy.forwardPeddle - 2]).addClass('taxonomy-term-divider-top'); - $(table[0].tBodies[0].rows[rows - Drupal.settings.taxonomy.forwardPeddle - 1]).addClass('taxonomy-term-divider-bottom'); + $(table[0].tBodies[0].rows[rows - settings.taxonomy.forwardPeddle - 2]).addClass('taxonomy-term-divider-top'); + $(table[0].tBodies[0].rows[rows - settings.taxonomy.forwardPeddle - 1]).addClass('taxonomy-term-divider-bottom'); } }; } diff --git a/modules/user/user.js b/modules/user/user.js index 0d3727a66..66e74e890 100644 --- a/modules/user/user.js +++ b/modules/user/user.js @@ -6,8 +6,8 @@ * that its confirmation is correct. */ Drupal.behaviors.password = { - attach: function(context) { - var translate = Drupal.settings.password; + attach: function(context, settings) { + var translate = settings.password; $("input.password-field:not(.password-processed)", context).each(function() { var passwordInput = $(this).addClass('password-processed'); var innerWrapper = $(this).parent(); @@ -34,7 +34,7 @@ Drupal.behaviors.password = { var passwordCheck = function () { // Evaluate the password strength. - var result = Drupal.evaluatePasswordStrength(passwordInput.val()); + var result = Drupal.evaluatePasswordStrength(passwordInput.val(), settings.password); // Update the suggestions for how to improve the password. if (passwordDescription.html() != result.message) { @@ -92,8 +92,8 @@ Drupal.behaviors.password = { * * Returns the estimated strength and the relevant output message. */ -Drupal.evaluatePasswordStrength = function (password) { - var weaknesses = 0, strength = 100, msg = [], translate = Drupal.settings.password; +Drupal.evaluatePasswordStrength = function (password, translate) { + var weaknesses = 0, strength = 100, msg = []; var hasLowercase = password.match(/[a-z]+/); var hasUppercase = password.match(/[A-Z]+/); @@ -166,7 +166,7 @@ Drupal.evaluatePasswordStrength = function (password) { * "Picture support" radio buttons. */ Drupal.behaviors.userSettings = { - attach: function(context) { + 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]](); }); |