Issue #1996238 by sun, nod_, damiankloip, Wim Leers, longwave, alexpott, Xano, mdrummond, Mark Carver, Jeff Burnz, highrockmedia, joelpittet, et al: Replace hook_library_info() by *.libraries.yml file.
2014-02-23 04:56:51 +00:00
|
|
|
/**
|
2017-05-19 22:12:53 +00:00
|
|
|
* DO NOT EDIT THIS FILE.
|
|
|
|
* See the following change record for more information,
|
2017-05-23 14:30:14 +00:00
|
|
|
* https://www.drupal.org/node/2815083
|
2017-05-19 22:12:53 +00:00
|
|
|
* @preserve
|
|
|
|
**/
|
2015-06-08 14:04:39 +00:00
|
|
|
|
2012-08-22 22:13:51 +00:00
|
|
|
(function ($, Drupal) {
|
2014-01-27 21:41:32 +00:00
|
|
|
Drupal.behaviors.batch = {
|
2017-05-19 22:12:53 +00:00
|
|
|
attach: function attach(context, settings) {
|
2014-01-27 21:41:32 +00:00
|
|
|
var batch = settings.batch;
|
2014-02-25 14:05:43 +00:00
|
|
|
var $progress = $('[data-drupal-progress]').once('batch');
|
2017-07-06 06:21:40 +00:00
|
|
|
var progressBar = void 0;
|
2007-05-04 09:41:37 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
function updateCallback(progress, status, pb) {
|
|
|
|
if (progress === '100') {
|
|
|
|
pb.stopMonitoring();
|
|
|
|
window.location = batch.uri + '&op=finished';
|
|
|
|
}
|
2012-08-22 22:13:51 +00:00
|
|
|
}
|
2007-05-04 09:41:37 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
function errorCallback(pb) {
|
|
|
|
$progress.prepend($('<p class="error"></p>').html(batch.errorMessage));
|
|
|
|
$('#wait').hide();
|
|
|
|
}
|
2007-07-01 15:37:10 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
if ($progress.length) {
|
|
|
|
progressBar = new Drupal.ProgressBar('updateprogress', updateCallback, 'POST', errorCallback);
|
|
|
|
progressBar.setProgress(-1, batch.initMessage);
|
|
|
|
progressBar.startMonitoring(batch.uri + '&op=do', 10);
|
2017-05-19 22:12:53 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
$progress.empty();
|
2017-05-19 22:12:53 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
$progress.append(progressBar.element);
|
|
|
|
}
|
2012-08-22 22:13:51 +00:00
|
|
|
}
|
2014-01-27 21:41:32 +00:00
|
|
|
};
|
2017-05-19 22:12:53 +00:00
|
|
|
})(jQuery, Drupal);
|