Skip to content
Snippets Groups Projects
Select Git revision
  • 2011-01-11
  • master default
  • issue-752
  • develop
  • issue-677
  • issue-677-original-with-migrate
  • issue-716
  • issue-654
  • issue-732
  • issue-737
  • issue-735
  • issue-707
  • issue-706
  • issue-705
  • issue-703
  • issue-696
  • issue-690
  • issue-675
  • issue-670
  • issue-635
  • issue-404
  • 7.19
  • 2012-04-18
  • 2012-04-03
  • 2012-04-02
  • 2012-03-01
  • 2012-02-07
  • 20120207
  • 2012-01-13
  • 2012-01-12
  • 2011-12-16
  • 2011-12-05
  • 2011-11-17
  • 2011-11-14
  • 2011-11-08.2
  • 2011-11-08
  • 2011-11-01
  • 2011-10-27
  • 2011-10-06
  • 2011-10-03
  • 2011-09-19
41 results

batch.js

Blame
  • Forked from UNL Information Services / UNL-CMS
    Source project has a limited visibility.
    batch.js 995 B
    // $Id: batch.js,v 1.10 2009/08/31 05:51:07 dries Exp $
    (function ($) {
    
    /**
     * Attaches the batch behavior to progress bars.
     */
    Drupal.behaviors.batch = {
      attach: function (context, settings) {
        $('#progress', context).once('batch', function () {
          var holder = $(this);
    
          // Success: redirect to the summary.
          var updateCallback = function (progress, status, pb) {
            if (progress == 100) {
              pb.stopMonitoring();
              window.location = settings.batch.uri + '&op=finished';
            }
          };
    
          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, settings.batch.initMessage);
          holder.append(progress.element);
          progress.startMonitoring(settings.batch.uri + '&op=do', 10);
        });
      }
    };
    
    })(jQuery);