<commit_before>/**
 * Handle app installation Asynchronously
 * @param int id - The App ID to install
 * @param obj area - The jQuery object where install progress is shown
 */
lobby.installApp = function(id, area){
  var retryIntervalStarted = 0;
  var startRetryCountdown = function(){
    if(retryIntervalStarted == 0){
      setInterval(function(){
        if($("#retryInstallCountdown:last").text() == "0"){
          area.html('');
          check();
        }else{
          $("#retryInstallCountdown").text(parseInt($("#retryInstallCountdown").text()) - 1);
        }
      }, 1000);
      retryIntervalStarted = 1;
    }
  };
  
  var check = function(){
    lobby.ajax("/admin/ajax/install-app.php", {"id": id}, function(r){
      r = JSON.parse(r);
      
      if(r.statusID == "error"){
        html = "<li class='collection-item' style='color: red;' data-status-id='error'>"+ r.status +"<br/>Will try again in <span id='retryInstallCountdown'>20</span> seconds.<cl/><a id='#retryInstallNow' class='btn green'>Try Again Now</a><a href='"+ lobby.url +"/admin/lobby-store.php?id="+ id +"' class='btn red'>Cancel</a></li>";
        startRetryCountdown();
      }else{
        html = "<li class='collection-item' data-status-id='"+ r.statusID +"'>"+ r.status +"</li>";
        if(r.statusID !== "install_finished"){
          setTimeout(check, 1000);
        }
      }
      if(area.find("li:last").attr("data-status-id") == r.statusID){
        area.find("li:last").replaceWith(html);
      }else{
        area.append(html);
      }
    });
  };
  check();
  
  $("#retryInstallNow").live("click", function(){
    check();
  });
};<commit_msg>Request param `id` is now `app`<commit_after>/**
 * Handle app installation Asynchronously
 * @param int id - The App ID to install
 * @param obj area - The jQuery object where install progress is shown
 */
lobby.installApp = function(id, area){
  var retryIntervalStarted = 0;
  var startRetryCountdown = function(){
    if(retryIntervalStarted == 0){
      setInterval(function(){
        if($("#retryInstallCountdown:last").text() == "0"){
          area.html('');
          check();
        }else{
          $("#retryInstallCountdown").text(parseInt($("#retryInstallCountdown").text()) - 1);
        }
      }, 1000);
      retryIntervalStarted = 1;
    }
  };
  
  var check = function(){
    lobby.ajax("/admin/ajax/install-app.php", {"id": id}, function(r){
      r = JSON.parse(r);
      
      if(r.statusID == "error"){
        html = "<li class='collection-item' style='color: red;' data-status-id='error'>"+ r.status +"<br/>Will try again in <span id='retryInstallCountdown'>20</span> seconds.<cl/><a id='#retryInstallNow' class='btn green'>Try Again Now</a><a href='"+ lobby.url +"/admin/lobby-store.php?app="+ id +"' class='btn red'>Cancel</a></li>";
        startRetryCountdown();
      }else{
        html = "<li class='collection-item' data-status-id='"+ r.statusID +"'>"+ r.status +"</li>";
        if(r.statusID !== "install_finished"){
          setTimeout(check, 1000);
        }
      }
      if(area.find("li:last").attr("data-status-id") == r.statusID){
        area.find("li:last").replaceWith(html);
      }else{
        area.append(html);
      }
    });
  };
  check();
  
  $("#retryInstallNow").live("click", function(){
    check();
  });
};
{'fraction_non_alphanumeric': 0.19789473684210526, 'fraction_numerical': 0.009022556390977444, 'mean_word_length': 2.940758293838863, 'pattern_counts': {'":': 2, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1270816', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1063, 'n_words': 213}