(function ($) {

/**
 * A progressbar object. Initialized with the given id. Must be inserted into
 * the DOM afterwards through progressBar.element.
 *
 * method is the function which will perform the HTTP request to get the
 * progress bar state. Either "GET" or "POST".
 *
 * e.g. pb = new progressBar('myProgressBar');
 *      some_element.appendChild(pb.element);
 */
Drupal.progressBar = function (id, updateCallback, method, errorCallback) {
  var pb = this;
  this.id = id;
  this.method = method || 'GET';
  this.updateCallback = updateCallback;
  this.errorCallback = errorCallback;

  // The WAI-ARIA setting aria-live="polite" will announce changes after users
  // have completed their current activity and not interrupt the screen reader.
  this.element = $('<div class="progress" aria-live="polite"></div>').attr('id', id);
  this.element.html('<div class="bar"><div class="filled"></div></div>' +
                    '<div class="percentage"></div>' +
                    '<div class="message">&nbsp;</div>');
};

/**
 * Set the percentage and status message for the progressbar.
 */
Drupal.progressBar.prototype.setProgress = function (percentage, message) {
  if (percentage >= 0 && percentage <= 100) {
    $('div.filled', this.element).css('width', percentage + '%');
    $('div.percentage', this.element).html(percentage + '%');
  }
  $('div.message', this.element).html(message);
  if (this.updateCallback) {
    this.updateCallback(percentage, message, this);
  }
};

/**
 * Start monitoring progress via Ajax.
 */
Drupal.progressBar.prototype.startMonitoring = function (uri, delay) {
  this.delay = delay;
  this.uri = uri;
  this.sendPing();
};

/**
 * Stop monitoring progress via Ajax.
 */
Drupal.progressBar.prototype.stopMonitoring = function () {
  clearTimeout(this.timer);
  // This allows monitoring to be stopped from within the callback.
  this.uri = null;
};

/**
 * Request progress data from server.
 */
Drupal.progressBar.prototype.sendPing = function () {
  if (this.timer) {
    clearTimeout(this.timer);
  }
  if (this.uri) {
    var pb = this;
    // When doing a post request, you need non-null data. Otherwise a
    // HTTP 411 or HTTP 406 (with Apache mod_security) error may result.
    $.ajax({
      type: this.method,
      url: this.uri,
      data: '',
      dataType: 'json',
      success: function (progress) {
        // Display errors.
        if (progress.status == 0) {
          pb.displayError(progress.data);
          return;
        }
        // Update display.
        pb.setProgress(progress.percentage, progress.message);
        // Schedule next timer.
        pb.timer = setTimeout(function () { pb.sendPing(); }, pb.delay);
      },
      error: function (xmlhttp) {
        pb.displayError(Drupal.ajaxError(xmlhttp, pb.uri));
      }
    });
  }
};

/**
 * Display errors on the page.
 */
Drupal.progressBar.prototype.displayError = function (string) {
  var error = $('<div class="messages error"></div>').html(string);
  $(this.element).before(error).hide();

  if (this.errorCallback) {
    this.errorCallback(this);
  }
};

})(jQuery);
;
Drupal.locale = { 'pluralFormula': function ($n) { return Number(($n>1)); }, 'strings': {"":{"Priority: @value":"Priorit\u00e9 : @value","Inclusion: @value":"Inclusion : @value","No privacy":"Pas de confidentialit\u00e9","@items enabled":"@items activ\u00e9(s)","A single domain":"Un seul domaine","Excepted: @roles":"Except\u00e9 : @roles","All pages with exceptions":"Toutes les pages avec exceptions","Multiple top-level domains":"Plusieurs domaines de premier niveau","One domain with multiple subdomains":"Un domaine avec plusieurs sous-domaines","@items tracked":"@items choisis","Off by default with opt in":"D\u00e9sactiv\u00e9 par d\u00e9faut avec l'acceptation du suivi","Not tracked":"Non suivi","On by default with opt out":"Activ\u00e9 par d\u00e9faut avec le refus du suivi","Close":"Fermer","Apply (all displays)":"Appliquer (tous les affichages)","Apply (this display)":"Appliquer (cet affichage)","Remove group":"Supprimer le groupe","Insert this token into your form":"Ins\u00e9rer ce jeton (\u003cem\u003etoken\u003c\/em\u003e) dans votre formulaire","First click a text field to insert your tokens into.":"Cliquez d'abord sur un champ de texte pour ins\u00e9rer vos jetons (\u003cem\u003etokens\u003c\/em\u003e) dans celui -ci.","Hide shortcuts":"Cacher les raccourcis","Autocomplete popup":"Popup d'auto-compl\u00e9tion","Searching for matches...":"Recherche de correspondances...","Hide row weights":"Cacher le poids des lignes","Show row weights":"Afficher les poids des lignes","Re-order rows by numerical weight instead of dragging.":"R\u00e9-ordonner les lignes avec des poids num\u00e9riques plut\u00f4t qu'en les d\u00e9placant.","The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.":"Le fichier s\u00e9lectionn\u00e9 %filename ne peut pas \u00eatre transf\u00e9r\u00e9. Seulement les fichiers avec les extensions suivantes sont permis : %extensions.","@title dialog":"dialogue de @title","Don't display post information":"Ne pas afficher les informations de la contribution","Edit summary":"Modifier le r\u00e9sum\u00e9","Hide summary":"Masquer le r\u00e9sum\u00e9","Customize dashboard":"Personnaliser le tableau de bord","Restricted to certain pages":"R\u00e9serv\u00e9 \u00e0 certaines pages","The block cannot be placed in this region.":"Le bloc ne peut pas \u00eatre plac\u00e9 dans cette r\u00e9gion.","Not customizable":"Non personnalisable","ReadyState: !readyState":"ReadyState: !readyState","ResponseText: !responseText":"ReponseTexte: !responseText","StatusText: !statusText":"StatutTexte: !statusText","Path: !uri":"Chemin: !uri","Debugging information follows.":"Informations de d\u00e9bogage ci-dessous.","An AJAX HTTP request terminated abnormally.":"Une requ\u00eate HTTP AJAX s'est termin\u00e9e anormalement.","HTTP Result Code: !status":"Code de statut HTTP : !status","An AJAX HTTP error occurred.":"Une erreur HTTP AJAX s'est produite.","(active tab)":"(onglet actif)","Requires a title":"Titre obligatoire","Not restricted":"Non restreint","No revision":"Aucune r\u00e9vision","@number comments per page":"@number commentaires par page","This permission is inherited from the authenticated user role.":"Ce droit est h\u00e9rit\u00e9e du r\u00f4le de l'utilisateur authentifi\u00e9.","Show shortcuts":"Afficher les raccourcis","The changes to these blocks will not be saved until the \u003cem\u003eSave blocks\u003c\/em\u003e button is clicked.":"N'oubliez pas de cliquer sur \u003cem\u003eEnregistrer les blocs\u003c\/em\u003e pour confirmer les modifications apport\u00e9es ici.","Drag to re-order":"Cliquer-d\u00e9poser pour r\u00e9-organiser","Changes made in this table will not be saved until the form is submitted.":"Les changements effectu\u00e9s dans ce tableau ne seront pris en compte que lorsque la configuration aura \u00e9t\u00e9 enregistr\u00e9e.","New revision":"Nouvelle r\u00e9vision","Alias: @alias":"Alias : @alias","No alias":"Aucun alias","By @name on @date":"Par @name le @date","By @name":"Par @name","Loading":"En cours de chargement","Please wait...":"Veuillez patienter...","Not published":"Non publi\u00e9","Deselect all rows in this table":"D\u00e9s\u00e9lectionner toutes les lignes du tableau","Select all rows in this table":"S\u00e9lectionner toutes les lignes du tableau","Show":"Afficher","Done":"Termin\u00e9","jQuery UI Tabs: Not enough arguments to add tab.":"Onglets d'interface jQuery : pas assez d'arguments pour ajouter l'onglet.","An error occurred at ":"Une erreur s'est produite \u00e0","jQuery UI Tabs: Mismatching fragment identifier.":"Onglets d'interface jQuery : identifiant de fragment ne correspondant pas.","Hide":"Cacher","Next":"Suivant","Configure":"Configurer","Disabled":"D\u00e9sactiv\u00e9","Enabled":"Activ\u00e9","Edit":"\u00c9diter"}} };;

