? generate-content.php
? generate-taxonomy.php
? generate-users.php
? import-taxonomy-terms.php
? theme-js.patch.txt
? misc/drupal.js
? misc/theme.js
? modules/user/access_control.js
? sites/all/modules
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.344
diff -u -d -F^\s*function -r1.344 theme.inc
--- includes/theme.inc	27 Mar 2007 05:13:53 -0000	1.344
+++ includes/theme.inc	4 Apr 2007 21:17:23 -0000
@@ -69,6 +69,11 @@ function init_theme() {
     }
   }
 
+  // Load the theme's main JavaScript file if it exists
+  if (file_exists($scripts = dirname($themes[$theme]->filename) .'/scripts.js')) {
+    drupal_add_js($scripts, 'theme');
+  }
+
   if (strpos($themes[$theme]->filename, '.theme')) {
    // file is a theme; include it
    include_once './' . $themes[$theme]->filename;
Index: misc/progress.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/progress.js,v
retrieving revision 1.14
diff -u -d -F^\s*function -r1.14 progress.js
--- misc/progress.js	14 Dec 2006 14:21:36 -0000	1.14
+++ misc/progress.js	4 Apr 2007 21:17:23 -0000
@@ -11,33 +11,34 @@
  *      some_element.appendChild(pb.element);
  */
 Drupal.progressBar = function (id, updateCallback, method, errorCallback) {
-  var pb = this;
   this.id = id;
   this.method = method || "GET";
   this.updateCallback = updateCallback;
   this.errorCallback = errorCallback;
 
-  this.element = document.createElement('div');
-  this.element.id = id;
-  this.element.className = 'progress';
-  $(this.element).html('<div class="percentage"></div>'+
-                       '<div class="message">&nbsp;</div>'+
-                       '<div class="bar"><div class="filled"></div></div>');
-}
+  Drupal.theme('progressBar').call(this);
+  this.container.attr('id', id);
+};
 
 /**
  * Set the percentage and status message for the progressbar.
  */
 Drupal.progressBar.prototype.setProgress = function (percentage, message) {
-  if (percentage >= 0 && percentage <= 100) {
-    $('div.filled', this.element).css('width', percentage +'%');
-    $('div.percentage', this.element).html(percentage +'%');
+  if (this.update) {
+    this.update.call(this, percentage, message);
   }
-  $('div.message', this.element).html(message);
+  else {
+    if (percentage >= 0 && percentage <= 100) {
+      this.filled.css('width', percentage +'%');
+      this.percentage.html(percentage +'%');
+    }
+    this.message.html(message);
+  }
+
   if (this.updateCallback) {
     this.updateCallback(percentage, message, this);
   }
-}
+};
 
 /**
  * Start monitoring progress via Ajax.
@@ -46,7 +47,7 @@
   this.delay = delay;
   this.uri = uri;
   this.sendPing();
-}
+};
 
 /**
  * Stop monitoring progress via Ajax.
@@ -54,8 +55,8 @@
 Drupal.progressBar.prototype.stopMonitoring = function () {
   clearTimeout(this.timer);
   // This allows monitoring to be stopped from within the callback
-  this.uri = null;
-}
+  delete this.uri;
+};
 
 /**
  * Request progress data from server.
@@ -90,19 +91,54 @@
       }
     });
   }
-}
+};
 
 /**
  * Display errors on the page.
  */
 Drupal.progressBar.prototype.displayError = function (string) {
-  var error = document.createElement('div');
-  error.className = 'error';
-  error.innerHTML = string;
-
-  $(this.element).before(error).hide();
+  $(this.container).before(Drupal.theme('progressError')(string)).hide();
 
   if (this.errorCallback) {
     this.errorCallback(this);
   }
-}
+};
+
+/**
+ * Themes a progress bar.
+ *
+ * 'this' is the progress bar object.
+ * Used elements are:
+ *  - this.percentage: Shows the current percentage count.
+ *  - this.message: Holds the message for the current state.
+ *  - this.filled: An indicator to visually show the current percentage.
+ *  - this.container: An element that wraps all other progress bar elements.
+ *  - this.update: A function that updates the progress bar with following parameters:
+ *
+ *      this.update = function(percentage, message) {
+ *        // 'this' is the progress bar object
+ *        // Handle the update of the progress bar here.
+ *      }
+ */
+Drupal.theme.prototype.progressBar = function() {
+  this.percentage = $('<div class="percentage"></div>');
+  this.message = $('<div class="message">&nbsp;</div>');
+  this.filled = $('<div class="filled"></div>');
+
+  this.container = $('<div class="progress"></div>')
+    .append(this.percentage)
+    .append(this.message)
+    .append($('<div class="bar"></div>').append(this.filled));
+};
+
+/**
+ * Themes a progress bar error message.
+ *
+ * @param str
+ *   The error message text.
+ * @return
+ *   Either a jQuery object or a DOM element containing the error message.
+ */
+Drupal.theme.prototype.progressError = function(str) {
+  return $('<div class="error"></div>').html(string);
+};
Index: misc/update.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/update.js,v
retrieving revision 1.10
diff -u -d -F^\s*function -r1.10 update.js
--- misc/update.js	27 Dec 2006 14:11:45 -0000	1.10
+++ misc/update.js	4 Apr 2007 21:17:23 -0000
@@ -25,7 +25,7 @@
 
       var progress = new Drupal.progressBar('updateprogress', updateCallback, "POST", errorCallback);
       progress.setProgress(-1, 'Starting updates');
-      $(holder).append(progress.element);
+      $(holder).append(progress.container);
       progress.startMonitoring('update.php?op=do_update', 0);
     });
   });
Index: misc/upload.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/upload.js,v
retrieving revision 1.11
diff -u -d -F^\s*function -r1.11 upload.js
--- misc/upload.js	31 Aug 2006 23:31:25 -0000	1.11
+++ misc/upload.js	4 Apr 2007 21:17:23 -0000
@@ -36,9 +36,8 @@
   this.progress.setProgress(-1, 'Uploading file');
 
   var hide = this.hide;
-  var el = this.progress.element;
   var offset = $(hide).get(0).offsetHeight;
-  $(el).css({
+  this.progress.container.css({
     width: '28em',
     height: offset +'px',
     paddingTop: '10px',
@@ -46,8 +45,8 @@
   });
   $(hide).css('position', 'absolute');
 
-  $(hide).after(el);
-  $(el).fadeIn('slow');
+  $(hide).after(this.progress.container);
+  this.progress.container.fadeIn('slow');
   $(hide).fadeOut('slow');
 }
 
