1 // $Id: update.js 144 2007-03-28 07:52:20Z thierry $
4 addLoadEvent(function() {
5 if ($('edit-has_js')) {
6 $('edit-has_js').value = 1;
10 // Success: redirect to the summary.
11 var updateCallback = function (progress, status, pb) {
12 if (progress == 100) {
14 window.location = window.location.href.split('op=')[0] +'op=finished';
18 // Failure: point out error message and provide link to the summary.
19 var errorCallback = function (pb) {
20 var div = document.createElement('p');
21 div.className = 'error';
22 div.innerHTML = 'An unrecoverable error has occured. You can find the error message below. It is advised to copy it to the clipboard for reference. Please continue to the <a href="update.php?op=error">update summary</a>';
23 $('progress').insertBefore(div, $('progress').firstChild);
24 $('wait').style.display = 'none';
27 var progress = new progressBar('updateprogress', updateCallback, HTTPPost, errorCallback);
28 progress.setProgress(-1, 'Starting updates');
29 $('progress').appendChild(progress.element);
30 progress.startMonitoring('update.php?op=do_update', 0);