diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-04-26 19:18:46 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-04-26 19:18:46 +0000 |
commit | bda52632a5aa033d44151c224a39236b223c6b0e (patch) | |
tree | da56b8095f58963707655312071d41de95adca84 /misc/batch.js | |
parent | a4dc8467bbe69ba984be31309f536af74dc64e73 (diff) | |
download | brdo-bda52632a5aa033d44151c224a39236b223c6b0e.tar.gz brdo-bda52632a5aa033d44151c224a39236b223c6b0e.tar.bz2 |
#444402 by kkaefer and RobLoach: Enforce coding standards on all core JavaScript.
Diffstat (limited to 'misc/batch.js')
-rw-r--r-- | misc/batch.js | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/misc/batch.js b/misc/batch.js index b603a2ffc..fc334617d 100644 --- a/misc/batch.js +++ b/misc/batch.js @@ -10,32 +10,26 @@ Drupal.behaviors.batch = { if ($('#progress.batch-processed').size()) { return; } - $('#progress', context).addClass('batch-processed').each(function () { - var holder = this; - var uri = settings.batch.uri; - var initMessage = settings.batch.initMessage; - var errorMessage = settings.batch.errorMessage; + $('#progress', context).addClass('batch-processed').each(function() { + var holder = $(this); // Success: redirect to the summary. - var updateCallback = function (progress, status, pb) { + var updateCallback = function(progress, status, pb) { if (progress == 100) { pb.stopMonitoring(); - window.location = uri+'&op=finished'; + window.location = settings.batch.uri + '&op=finished'; } }; - var errorCallback = function (pb) { - var div = document.createElement('p'); - div.className = 'error'; - $(div).html(errorMessage); - $(holder).prepend(div); + var errorCallback = function(pb) { + holder.prepend($('<p class="error"></p>').html(settings.batch.errorMessage)); $('#wait').hide(); }; - var progress = new Drupal.progressBar('updateprogress', updateCallback, "POST", errorCallback); - progress.setProgress(-1, initMessage); - $(holder).append(progress.element); - progress.startMonitoring(uri+'&op=do', 10); + var progress = new Drupal.progressBar('updateprogress', updateCallback, 'POST', errorCallback); + progress.setProgress(-1, settings.batch.initMessage); + holder.append(progress.element); + progress.startMonitoring(settings.batch.uri + '&op=do', 10); }); } }; |