Index: misc/autocomplete.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/autocomplete.js,v
retrieving revision 1.17
diff -u -r1.17 autocomplete.js
--- misc/autocomplete.js	9 Jan 2007 07:31:04 -0000	1.17
+++ misc/autocomplete.js	15 Mar 2007 00:03:31 -0000
@@ -3,9 +3,10 @@
 /**
  * Attaches the autocomplete behaviour to all required fields
  */
-Drupal.autocompleteAutoAttach = function () {
+Drupal.autocompleteAttach = function () {
   var acdb = [];
-  $('input.autocomplete').each(function () {
+  $('input.autocomplete:not(.autocomplete-processed)').each(function () {
+    $(this).addClass('autocomplete-processed');
     var uri = this.value;
     if (!acdb[uri]) {
       acdb[uri] = new Drupal.ACDB(uri);
@@ -299,5 +300,5 @@
 
 // Global Killswitch
 if (Drupal.jsEnabled) {
-  $(document).ready(Drupal.autocompleteAutoAttach);
+  $(document).ready(Drupal.autocompleteAttach);
 }
Index: misc/collapse.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/collapse.js,v
retrieving revision 1.11
diff -u -r1.11 collapse.js
--- misc/collapse.js	28 Feb 2007 20:29:38 -0000	1.11
+++ misc/collapse.js	15 Mar 2007 00:02:06 -0000
@@ -1,5 +1,30 @@
 // $Id: collapse.js,v 1.11 2007/02/28 20:29:38 dries Exp $
 
+Drupal.collapseAttach = function() {
+  $('fieldset.collapsible > legend:not(.collapse-processed)').each(function() {
+    var fieldset = $(this.parentNode);
+    // Expand if there are errors inside
+    if ($('input.error, textarea.error, select.error', fieldset).size() > 0) {
+      fieldset.removeClass('collapsed');
+    }
+
+    // Turn the legend into a clickable link and wrap the contents of the fieldset
+    // in a div for easier animation
+    var text = this.innerHTML;
+    $(this)
+      .addClass('collapse-processed')
+      .empty().append($('<a href="#">'+ text +'</a>').click(function() {
+        var fieldset = $(this).parents('fieldset:first')[0];
+        // Don't animate multiple times
+        if (!fieldset.animating) {
+          fieldset.animating = true;
+          Drupal.toggleFieldset(fieldset);
+        }
+        return false;
+      })).after($('<div class="fieldset-wrapper"></div>').append(fieldset.children(':not(legend)')));
+  });
+}
+
 /**
  * Toggle the visibility of a fieldset using smooth animations
  */
@@ -46,26 +71,5 @@
 
 // Global Killswitch
 if (Drupal.jsEnabled) {
-  $(document).ready(function() {
-    $('fieldset.collapsible > legend').each(function() {
-      var fieldset = $(this.parentNode);
-      // Expand if there are errors inside
-      if ($('input.error, textarea.error, select.error', fieldset).size() > 0) {
-        fieldset.removeClass('collapsed');
-      }
-
-      // Turn the legend into a clickable link and wrap the contents of the fieldset
-      // in a div for easier animation
-      var text = this.innerHTML;
-      $(this).empty().append($('<a href="#">'+ text +'</a>').click(function() {
-        var fieldset = $(this).parents('fieldset:first')[0];
-        // Don't animate multiple times
-        if (!fieldset.animating) {
-          fieldset.animating = true;
-          Drupal.toggleFieldset(fieldset);
-        }
-        return false;
-      })).after($('<div class="fieldset-wrapper"></div>').append(fieldset.children(':not(legend)')));
-    });
-  });
+  $(document).ready(Drupal.collapseAttach);
 }
Index: misc/textarea.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/textarea.js,v
retrieving revision 1.12
diff -u -r1.12 textarea.js
--- misc/textarea.js	15 Feb 2007 07:10:11 -0000	1.12
+++ misc/textarea.js	18 Feb 2007 18:31:09 -0000
@@ -1,8 +1,8 @@
 // $Id: textarea.js,v 1.12 2007/02/15 07:10:11 dries Exp $
 
 Drupal.textareaAttach = function() {
-  $('textarea.resizable:not(.processed)').each(function() {
-    var textarea = $(this).addClass('processed'), staticOffset = null;
+  $('textarea.resizable:not(.textarea-processed)').each(function() {
+    var textarea = $(this).addClass('textarea-processed'), staticOffset = null;
 
     $(this).wrap('<div class="resizable-textarea"></div>')
       .parent().append($('<div class="grippie"></div>').mousedown(startDrag));
Index: misc/update.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/update.js,v
retrieving revision 1.10
diff -u -r1.10 update.js
--- misc/update.js	27 Dec 2006 14:11:45 -0000	1.10
+++ misc/update.js	15 Mar 2007 00:04:54 -0000
@@ -1,32 +1,34 @@
 // $Id: update.js,v 1.10 2006/12/27 14:11:45 unconed Exp $
 
-if (Drupal.jsEnabled) {
-  $(document).ready(function() {
-    $('#edit-has-js').each(function() { this.value = 1; });
-    $('#progress').each(function () {
-      var holder = this;
+Drupal.updateAttach = function() {
+  $('#edit-has-js').each(function() { this.value = 1; });
+  $('#progress').each(function () {
+    var holder = this;
 
-      // Success: redirect to the summary.
-      var updateCallback = function (progress, status, pb) {
-        if (progress == 100) {
-          pb.stopMonitoring();
-          window.location = window.location.href.split('op=')[0] +'op=finished';
-        }
+    // Success: redirect to the summary.
+    var updateCallback = function (progress, status, pb) {
+      if (progress == 100) {
+        pb.stopMonitoring();
+        window.location = window.location.href.split('op=')[0] +'op=finished';
       }
+    }
 
-      // Failure: point out error message and provide link to the summary.
-      var errorCallback = function (pb) {
-        var div = document.createElement('p');
-        div.className = 'error';
-        $(div).html('An unrecoverable error has occured. You can find the error message below. It is advised to copy it to the clipboard for reference. Please continue to the <a href="update.php?op=error">update summary</a>');
-        $(holder).prepend(div);
-        $('#wait').hide();
-      }
+    // Failure: point out error message and provide link to the summary.
+    var errorCallback = function (pb) {
+      var div = document.createElement('p');
+      div.className = 'error';
+      $(div).html('An unrecoverable error has occured. You can find the error message below. It is advised to copy it to the clipboard for reference. Please continue to the <a href="update.php?op=error">update summary</a>');
+      $(holder).prepend(div);
+      $('#wait').hide();
+    }
 
-      var progress = new Drupal.progressBar('updateprogress', updateCallback, "POST", errorCallback);
-      progress.setProgress(-1, 'Starting updates');
-      $(holder).append(progress.element);
-      progress.startMonitoring('update.php?op=do_update', 0);
-    });
+    var progress = new Drupal.progressBar('updateprogress', updateCallback, "POST", errorCallback);
+    progress.setProgress(-1, 'Starting updates');
+    $(holder).append(progress.element);
+    progress.startMonitoring('update.php?op=do_update', 0);
   });
 }
+
+if (Drupal.jsEnabled) {
+  $(document).ready(Drupal.updateAttach);
+}
Index: misc/upload.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/upload.js,v
retrieving revision 1.11
diff -u -r1.11 upload.js
--- misc/upload.js	31 Aug 2006 23:31:25 -0000	1.11
+++ misc/upload.js	15 Mar 2007 00:06:22 -0000
@@ -3,8 +3,9 @@
 /**
  * Attaches the upload behaviour to the upload form.
  */
-Drupal.uploadAutoAttach = function() {
-  $('input.upload').each(function () {
+Drupal.uploadAttach = function() {
+  $('input.upload:not(.upload-processed)').each(function () {
+    $(this).addClass('upload-processed');
     var uri = this.value;
     // Extract the base name from the id (edit-attach-url -> attach).
     var base = this.id.substring(5, this.id.length - 4);
@@ -112,5 +113,5 @@
 
 // Global killswitch
 if (Drupal.jsEnabled) {
-  $(document).ready(Drupal.uploadAutoAttach);
+  $(document).ready(Drupal.uploadAttach);
 }
