I have the same problem. I am currently using an iframe that targets the form. This allows you to execute xhr requests during publishing. While this works, it does not degrade gracefully if someone disables javascript (I could not load the next page outside the iframe without js). Therefore, if someone has a more pleasant solution, I would appreciate it if I heard it.
Here's the jQuery script for reference:
$(function() { $('form[enctype=multipart/form-data]').submit(function(){ // Prevent multiple submits if ($.data(this, 'submitted')) return false; var freq = 500; // freqency of update in ms var progress_url = '{% url checker_progress %}'; // ajax view serving progress info $("#progressbar").progressbar({ value: 0 }); $("#progress").overlay({ top: 272, api: true, closeOnClick: false, closeOnEsc: false, expose: { color: '#333', loadSpeed: 1000, opacity: 0.9 }, }).load(); // Update progress bar function update_progress_info() { $.getJSON(progress_url, {}, function(data, status){ if (data) { var progresse = parseInt(data.progress); $('#progressbar div').animate({width: progresse + '%' },{ queue:'false', duration:500, easing:"swing" }); } window.setTimeout(update_progress_info, freq); }); }; window.setTimeout(update_progress_info, freq); $.data(this, 'submitted', true); // mark form as submitted. }); });
source share