Index: misc/ahah.js =================================================================== RCS file: /cvs/drupal/drupal/misc/ahah.js,v retrieving revision 1.11 diff -u -p -r1.11 ahah.js --- misc/ahah.js 8 Mar 2009 03:16:26 -0000 1.11 +++ misc/ahah.js 8 Mar 2009 03:38:07 -0000 @@ -17,10 +17,10 @@ * Attaches the ahah behavior to each ahah form element. */ Drupal.behaviors.ahah = { - attach: function(context) { - for (var base in Drupal.settings.ahah) { + attach: function(context, settings) { + for (var base in settings.ahah) { if (!$('#'+ base + '.ahah-processed').size()) { - var element_settings = Drupal.settings.ahah[base]; + var element_settings = settings.ahah[base]; $(element_settings.selector).each(function() { element_settings.element = this; Index: misc/autocomplete.js =================================================================== RCS file: /cvs/drupal/drupal/misc/autocomplete.js,v retrieving revision 1.26 diff -u -p -r1.26 autocomplete.js --- misc/autocomplete.js 18 Feb 2009 13:46:52 -0000 1.26 +++ misc/autocomplete.js 8 Mar 2009 03:38:07 -0000 @@ -5,7 +5,7 @@ * Attaches the autocomplete behavior to all required fields. */ Drupal.behaviors.autocomplete = { - attach: function(context) { + attach: function(context, settings) { var acdb = []; $('input.autocomplete:not(.autocomplete-processed)', context).each(function () { var uri = this.value; Index: misc/batch.js =================================================================== RCS file: /cvs/drupal/drupal/misc/batch.js,v retrieving revision 1.6 diff -u -p -r1.6 batch.js --- misc/batch.js 18 Feb 2009 13:46:52 -0000 1.6 +++ misc/batch.js 8 Mar 2009 03:38:07 -0000 @@ -5,16 +5,16 @@ * Attaches the batch behavior to progress bars. */ Drupal.behaviors.batch = { - attach: function(context) { + attach: function(context, settings) { // This behavior attaches by ID, so is only valid once on a page. if ($('#progress.batch-processed').size()) { return; } $('#progress', context).addClass('batch-processed').each(function () { var holder = this; - var uri = Drupal.settings.batch.uri; - var initMessage = Drupal.settings.batch.initMessage; - var errorMessage = Drupal.settings.batch.errorMessage; + var uri = settings.batch.uri; + var initMessage = settings.batch.initMessage; + var errorMessage = settings.batch.errorMessage; // Success: redirect to the summary. var updateCallback = function (progress, status, pb) { Index: misc/collapse.js =================================================================== RCS file: /cvs/drupal/drupal/misc/collapse.js,v retrieving revision 1.19 diff -u -p -r1.19 collapse.js --- misc/collapse.js 18 Feb 2009 13:46:52 -0000 1.19 +++ misc/collapse.js 8 Mar 2009 03:38:07 -0000 @@ -52,7 +52,7 @@ Drupal.collapseScrollIntoView = function }; Drupal.behaviors.collapse = { - attach: function(context) { + attach: function(context, settings) { $('fieldset.collapsible > legend:not(.collapse-processed)', context).each(function() { var fieldset = $(this.parentNode); // Expand if there are errors inside Index: misc/drupal.js =================================================================== RCS file: /cvs/drupal/drupal/misc/drupal.js,v retrieving revision 1.50 diff -u -p -r1.50 drupal.js --- misc/drupal.js 18 Feb 2009 13:46:52 -0000 1.50 +++ misc/drupal.js 8 Mar 2009 03:38:07 -0000 @@ -52,12 +52,13 @@ Drupal.jsEnabled = document.getElementsB * An element to attach behaviors to. If none is given, the document element * is used. */ -Drupal.attachBehaviors = function(context) { +Drupal.attachBehaviors = function(context, settings) { context = context || document; + settings = settings || Drupal.settings; // Execute all of them. $.each(Drupal.behaviors, function() { if ($.isFunction(this.attach)) { - this.attach(context); + this.attach(context, settings); } }); }; @@ -81,12 +82,13 @@ Drupal.attachBehaviors = function(contex * * @see Drupal.attachBehaviors */ -Drupal.detachBehaviors = function(context) { +Drupal.detachBehaviors = function(context, settings) { context = context || document; + settings = settings || Drupal.settings; // Execute all of them. $.each(Drupal.behaviors, function() { if ($.isFunction(this.detach)) { - this.detach(context); + this.detach(context, settings); } }); }; @@ -320,7 +322,7 @@ if (Drupal.jsEnabled) { document.cookie = 'has_js=1; path=/'; // Attach all behaviors. $(document).ready(function() { - Drupal.attachBehaviors(this); + Drupal.attachBehaviors(this, Drupal.settings); }); } Index: misc/form.js =================================================================== RCS file: /cvs/drupal/drupal/misc/form.js,v retrieving revision 1.4 diff -u -p -r1.4 form.js --- misc/form.js 8 Mar 2009 01:43:57 -0000 1.4 +++ misc/form.js 8 Mar 2009 03:38:07 -0000 @@ -2,7 +2,7 @@ (function($) { Drupal.behaviors.multiselectSelector = { - attach: function(context) { + attach: function(context, settings) { // Automatically selects the right radio button in a multiselect control. $('.multiselect select:not(.multiselectSelector-processed)', context) .addClass('multiselectSelector-processed').change(function() { Index: misc/tabledrag.js =================================================================== RCS file: /cvs/drupal/drupal/misc/tabledrag.js,v retrieving revision 1.24 diff -u -p -r1.24 tabledrag.js --- misc/tabledrag.js 8 Mar 2009 03:16:26 -0000 1.24 +++ misc/tabledrag.js 8 Mar 2009 03:38:07 -0000 @@ -13,10 +13,10 @@ * See blocks.js for an example of adding additional functionality to tableDrag. */ Drupal.behaviors.tableDrag = { - attach: function(context) { - for (var base in Drupal.settings.tableDrag) { + attach: function(context, settings) { + for (var base in settings.tableDrag) { if (!$('#' + base + '.tabledrag-processed', context).size()) { - var tableSettings = Drupal.settings.tableDrag[base]; + var tableSettings = settings.tableDrag[base]; $('#' + base).filter(':not(.tabledrag-processed)').each(function() { // Create the new tableDrag instance. Save in the Drupal variable Index: misc/tableheader.js =================================================================== RCS file: /cvs/drupal/drupal/misc/tableheader.js,v retrieving revision 1.21 diff -u -p -r1.21 tableheader.js --- misc/tableheader.js 18 Feb 2009 13:46:52 -0000 1.21 +++ misc/tableheader.js 8 Mar 2009 03:38:08 -0000 @@ -8,7 +8,7 @@ Drupal.tableHeaderDoScroll = function() }; Drupal.behaviors.tableHeader = { - attach: function(context) { + attach: function(context, settings) { // This breaks in anything less than IE 7. Prevent it from running. if ($.browser.msie && parseInt($.browser.version, 10) < 7) { return; Index: misc/tableselect.js =================================================================== RCS file: /cvs/drupal/drupal/misc/tableselect.js,v retrieving revision 1.10 diff -u -p -r1.10 tableselect.js --- misc/tableselect.js 18 Feb 2009 13:46:52 -0000 1.10 +++ misc/tableselect.js 8 Mar 2009 03:38:08 -0000 @@ -2,7 +2,7 @@ (function($) { Drupal.behaviors.tableSelect = { - attach: function(context) { + attach: function(context, settings) { $('form table:has(th.select-all):not(.tableSelect-processed)', context).each(Drupal.tableSelect); } }; Index: misc/teaser.js =================================================================== RCS file: /cvs/drupal/drupal/misc/teaser.js,v retrieving revision 1.16 diff -u -p -r1.16 teaser.js --- misc/teaser.js 8 Mar 2009 03:16:26 -0000 1.16 +++ misc/teaser.js 8 Mar 2009 03:38:08 -0000 @@ -7,13 +7,13 @@ * Note: depends on resizable textareas. */ Drupal.behaviors.teaser = { - attach: function(context) { + attach: function(context, settings) { $('textarea.teaser:not(.teaser-processed)', context).each(function() { var teaser = $(this).addClass('teaser-processed'); // Move teaser textarea before body, and remove its form-item wrapper. - var body = $('#'+ Drupal.settings.teaser[this.id]); - var checkbox = $('#'+ Drupal.settings.teaserCheckbox[this.id]).parent(); + var body = $('#'+ settings.teaser[this.id]); + var checkbox = $('#'+ settings.teaserCheckbox[this.id]).parent(); var checked = $(checkbox).children('input').attr('checked') ? true : false; var parent = teaser[0].parentNode; $(body).before(teaser); Index: misc/textarea.js =================================================================== RCS file: /cvs/drupal/drupal/misc/textarea.js,v retrieving revision 1.26 diff -u -p -r1.26 textarea.js --- misc/textarea.js 18 Feb 2009 13:46:52 -0000 1.26 +++ misc/textarea.js 8 Mar 2009 03:38:08 -0000 @@ -2,7 +2,7 @@ (function($) { Drupal.behaviors.textarea = { - attach: function(context) { + attach: function(context, settings) { $('textarea.resizable:not(.textarea-processed)', context).each(function() { // Avoid non-processed teasers. if ($(this).is(('textarea.teaser:not(.teaser-processed)'))) { Index: misc/timezone.js =================================================================== RCS file: /cvs/drupal/drupal/misc/timezone.js,v retrieving revision 1.3 diff -u -p -r1.3 timezone.js --- misc/timezone.js 18 Feb 2009 13:46:52 -0000 1.3 +++ misc/timezone.js 8 Mar 2009 03:38:08 -0000 @@ -5,7 +5,7 @@ * Set the client's system time zone as default values of form fields. */ Drupal.behaviors.setTimezone = { - attach: function(context) { + attach: function(context, settings) { $('select.timezone-detect:not(.timezone-processed)', context).addClass('timezone-processed').each(function() { var dateString = Date(); // In some client environments, date strings include a time zone @@ -51,7 +51,7 @@ Drupal.behaviors.setTimezone = { var element = this; $.ajax({ async: false, - url: Drupal.settings.basePath, + url: settings.basePath, data: { q: path, date: dateString }, dataType: 'json', success: function (data) { Index: modules/block/block.js =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.js,v retrieving revision 1.5 diff -u -p -r1.5 block.js --- modules/block/block.js 18 Feb 2009 13:46:53 -0000 1.5 +++ modules/block/block.js 8 Mar 2009 03:38:08 -0000 @@ -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. Index: modules/color/color.js =================================================================== RCS file: /cvs/drupal/drupal/modules/color/color.js,v retrieving revision 1.9 diff -u -p -r1.9 color.js --- modules/color/color.js 18 Feb 2009 13:46:53 -0000 1.9 +++ modules/color/color.js 8 Mar 2009 03:38:08 -0000 @@ -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])); } Index: modules/comment/comment.js =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.js,v retrieving revision 1.8 diff -u -p -r1.8 comment.js --- modules/comment/comment.js 18 Feb 2009 13:46:54 -0000 1.8 +++ modules/comment/comment.js 8 Mar 2009 03:38:08 -0000 @@ -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++) { Index: modules/profile/profile.js =================================================================== RCS file: /cvs/drupal/drupal/modules/profile/profile.js,v retrieving revision 1.4 diff -u -p -r1.4 profile.js --- modules/profile/profile.js 18 Feb 2009 13:46:54 -0000 1.4 +++ modules/profile/profile.js 8 Mar 2009 03:38:08 -0000 @@ -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. Index: modules/simpletest/simpletest.js =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.js,v retrieving revision 1.8 diff -u -p -r1.8 simpletest.js --- modules/simpletest/simpletest.js 18 Feb 2009 13:46:54 -0000 1.8 +++ modules/simpletest/simpletest.js 8 Mar 2009 03:38:08 -0000 @@ -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 = $(''); // Each time a single-test checkbox is checked or unchecked, make sure Index: modules/system/system.js =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.js,v retrieving revision 1.19 diff -u -p -r1.19 system.js --- modules/system/system.js 18 Feb 2009 13:46:55 -0000 1.19 +++ modules/system/system.js 8 Mar 2009 03:38:08 -0000 @@ -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('