Chris@0: /** Chris@0: * DO NOT EDIT THIS FILE. Chris@0: * See the following change record for more information, Chris@0: * https://www.drupal.org/node/2815083 Chris@0: * @preserve Chris@0: **/ Chris@0: Chris@0: (function ($, Drupal) { Chris@0: Drupal.behaviors.batch = { Chris@0: attach: function attach(context, settings) { Chris@0: var batch = settings.batch; Chris@0: var $progress = $('[data-drupal-progress]').once('batch'); Chris@0: var progressBar = void 0; Chris@0: Chris@0: function updateCallback(progress, status, pb) { Chris@0: if (progress === '100') { Chris@0: pb.stopMonitoring(); Chris@0: window.location = batch.uri + '&op=finished'; Chris@0: } Chris@0: } Chris@0: Chris@0: function errorCallback(pb) { Chris@0: $progress.prepend($('
').html(batch.errorMessage)); Chris@0: $('#wait').hide(); Chris@0: } Chris@0: Chris@0: if ($progress.length) { Chris@0: progressBar = new Drupal.ProgressBar('updateprogress', updateCallback, 'POST', errorCallback); Chris@0: progressBar.setProgress(-1, batch.initMessage); Chris@0: progressBar.startMonitoring(batch.uri + '&op=do', 10); Chris@0: Chris@0: $progress.empty(); Chris@0: Chris@0: $progress.append(progressBar.element); Chris@0: } Chris@0: } Chris@0: }; Chris@0: })(jQuery, Drupal);