<commit_before>/**
 * Created by Seky on 7. 10. 2014.
 */
function Preloader() {
    this.loader = $('#loader');
    this.loaderText = $('#loader-text');
    this.tasks = 0;
    this.finishedTasks = 0;

    this.loader.hide();
    this.loaderText.hide();

    this.updateStatus = function () {
        var text = "Pending requests</br>" + this.finishedTasks + "/" + this.tasks;
        this.loaderText.html(text);
    };

    this.start = function () {
        if (this.pendingTasks() == 0) {
            return;
        }
        this.updateStatus();
        this.loader.show();
        this.loaderText.show();
        this.task();
    };

    this.task = function () {
        var instance = this;
        setTimeout(function () {
            var tasks = instance.pendingTasks();
            if (tasks > 0) {
                instance.updateStatus();
                instance.task();<commit_msg>Preloader auto registration.<commit_after>/**
 * Created by Seky on 7. 10. 2014.
 */
function Preloader() {
    this.loader = $('#loader');
    this.loaderText = $('#loader-text');
    this.tasks = 0;
    this.finishedTasks = 0;
    this.init();


    this.init = function () {
        this.loader.hide();
        this.loaderText.hide();

        var instance = this;
        $(document).ajaxStart(function () {
            instance.tasks += count;
            instance.start();
        });

        $(document).ajaxStop(function () {
            instance.finishedTasks++;
        });

    };

    this.updateStatus = function () {
        var text = "Pending requests</br>" + this.finishedTasks + "/" + this.tasks;
        this.loaderText.html(text);
    };

    this.start = function () {
        if (this.pendingTasks() == 0) {
            return;
        }
        this.updateStatus();
        this.loader.show();
        this.loaderText.show();
        this.task();
    };

    this.task = function () {
        var instance = this;
        setTimeout(function () {
            var tasks = instance.pendingTasks();
            if (tasks > 0) {
                instance.updateStatus();
                instance.task();
{'fraction_non_alphanumeric': 0.15486307837582625, 'fraction_numerical': 0.010387157695939566, 'mean_word_length': 1.7699346405228757, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5069252', 'n_tokens_mistral': 618, 'n_tokens_neox': 584, 'n_words': 119}