[ Index ]
 

Code source de Drupal 5.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/misc/ -> update.js (source)

   1  // $Id: update.js,v 1.10 2006/12/27 14:11:45 unconed Exp $
   2  
   3  if (Drupal.jsEnabled) {
   4    $(document).ready(function() {
   5      $('#edit-has-js').each(function() { this.value = 1; });
   6      $('#progress').each(function () {
   7        var holder = this;
   8  
   9        // Success: redirect to the summary.
  10        var updateCallback = function (progress, status, pb) {
  11          if (progress == 100) {
  12            pb.stopMonitoring();
  13            window.location = window.location.href.split('op=')[0] +'op=finished';
  14          }
  15        }
  16  
  17        // Failure: point out error message and provide link to the summary.
  18        var errorCallback = function (pb) {
  19          var div = document.createElement('p');
  20          div.className = 'error';
  21          $(div).html('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>');
  22          $(holder).prepend(div);
  23          $('#wait').hide();
  24        }
  25  
  26        var progress = new Drupal.progressBar('updateprogress', updateCallback, "POST", errorCallback);
  27        progress.setProgress(-1, 'Starting updates');
  28        $(holder).append(progress.element);
  29        progress.startMonitoring('update.php?op=do_update', 0);
  30      });
  31    });
  32  }


Généré le : Fri Nov 30 16:20:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics