<commit_before>/*
*
*   Original code from  <NAME> -- http://www.telio.be/blog
*   email : <EMAIL>
* 
* $Id$
*/

function refreshProgress() {
    UploadMonitor.getUploadInfo(updateProgress);
}
function updateProgress(uploadInfo) {
    if (uploadInfo.inProgress) {
        document.getElementById("uploadbutton").disabled = true;
        document.getElementById("file").disabled = true;
        var fileIndex = uploadInfo.fileIndex;
        var progressPercent = Math.ceil((uploadInfo.bytesRead / uploadInfo.totalSize) * 100);
        document.getElementById("progressBarText").innerHTML = "Upload in progress: " + progressPercent + "%";
        document.getElementById("progressBarBoxContent").style.width = parseInt(progressPercent * 3.5) + "px";
        window.setTimeout("refreshProgress()", 1000);
    } else {
        document.getElementById("uploadbutton").disabled = false;
        document.getElementById("file").disabled = false;
    }
    return true;
}
function startProgress() {
    document.getElementById("progressBar").style.display = "block";
    document.getElementById("progressBarText").innerHTML = "Upload in progress: 0%";
    document.getElementById("uploadbutton").disabled = true;

    // wait a little while to make sure the upload has started ..
    window.setTimeout("refreshProgress()", 1500);
    return true;
}
<commit_msg>uses new progress model.<commit_after>/*
*
*   Original code from  <NAME> -- http://www.telio.be/blog
*   email : <EMAIL>
* 
* $Id$
*/

function refreshProgress() {
    updateProgress( HttpProgressMonitor.getProgressStatus() );
}

function updateProgress(progressData) {

 
    if (!progressData.isDone) {
        document.getElementById("uploadbutton").disabled = true;
        document.getElementById("file").disabled = true;
        document.getElementById("progressBarText").innerHTML =  progressData.getDescription() + " : " + progressData.getPercent() + "% ";
        document.getElementById("progressBarBoxContent").style.width = parseInt(progressData.getPercent() * 3.5) + "px";
        window.setTimeout("refreshProgress()", 1000);
    } else {
        document.getElementById("uploadbutton").disabled = false;
        document.getElementById("file").disabled = false;
        document.getElementById("progressBarText").innerHTML =  progressData.getDescription() + " : " + progressData.getPercent() + "% ";
        document.getElementById("progressBarBoxContent").style.width = parseInt(progressData.getPercent() * 3.5) + "px";
       
    }
    return true;
}
function startProgress() {
    document.getElementById("progressBar").style.display = "block";
    document.getElementById("progressBarText").innerHTML = "Progress: 0%";
    document.getElementById("uploadbutton").disabled = true;

    // wait a little while to make sure the upload has started ..
    window.setTimeout("refreshProgress()", 1200);
    return true;
}

{'fraction_non_alphanumeric': 0.1411764705882353, 'fraction_numerical': 0.009342560553633217, 'mean_word_length': 3.8917089678510997, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5990456', 'n_tokens_mistral': 780, 'n_tokens_neox': 750, 'n_words': 143}