summaryrefslogtreecommitdiff
path: root/misc/update.js
blob: 2586fbf505c2bd9a6574fca4c242cba299b05e0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
if (isJsEnabled()) {
  addLoadEvent(function() {
    if ($('edit-has_js')) {
      $('edit-has_js').value = 1;
    }

    if ($('progress')) {
      updateCallback = function (progress, status, pb) {
        if (progress == 100) {
          pb.stopMonitoring();
          window.location = window.location.href.split('op=')[0] +'op=finished';
        }
      }

      var progress = new progressBar('updateprogress', updateCallback, HTTPPost);
      progress.setProgress(-1, 'Starting updates');
      $('progress').appendChild(progress.element);
      progress.startMonitoring('update.php?op=do_update', 0);
    }
  });
}