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

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

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