Skip to content
Snippets Groups Projects
Select Git revision
  • 3d97e54728fbd87ebcef7732aca30e7aaeda408c
  • master default protected
  • optimize-images
  • 5.0
  • 4.1
5 results

example_style1.php

Blame
  • Forked from Digital Experience Group / UNL_Search
    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);