<commit_before>/**
 * Tile loading progress bar
 */
L.Control.Progress = L.Control.extend({
    options: {
        position: 'topleft',
        text: 'Loading',
        // id of element to add this control to, instead of corner (optional)
        div: null
    },

    initialize: function (tileLayer, options) {
        L.setOptions(this, options);
        
        this._layer = tileLayer;
    },

    addTo: function (map) {
        L.Control.prototype.addTo.apply(this, arguments);

        if (this.options.div) {
            this._container.parentNode.removeChild(this._container);
            L.DomUtil.get(this.options.div).appendChild(this._container);
        }

        return this;
    },
    
    onAdd: function (map) {
        var container, text;

        this._map = map;

        container = L.DomUtil.create('div', 'progress leaflet-bar hidden');

        text = L.DomUtil.create('span', 'progress-text');
        text.innerHTML = this.options.text;
        container.appendChild(text);

        this._bar = L.DomUtil.create('progress', 'progress-bar');
        container.appendChild(this._bar);
        
        this._layer.on('loading', this._onLoading, this);
        this._layer.on('load', this._onLoad, this);
        this._layer.on('tileload', this._onTileLoad, this);
        // L.TileLayer.Vector events
        this._layer.on('tileloading', this._onTileLoading, this);
        this._layer.on('tileerror', this._onTileLoad, this);
        this._layer.on('tileabort', this._onTileLoad, this);

        return container;
    },

    onRemove: function (map) {
        this._layer.off('loading', this._onLoading, this);
        this._layer.off('load', this._onLoad, this);
        this._layer.off('tileload', this._onTileLoad, this);
        this._layer.off('tileloading', this._onTileLoading, this);
        this._layer.off('tileerror', this._onTileLoad, this);
        this._layer.off('tileabort', this._onTileLoad, this);
    },

    _onLoading: function () {
        this._bar.max = 0.1; // must be greater than zero, so adjust later
        this._bar.value = 0;
        L.DomUtil.removeClass(this._container, 'hidden');
    },
    
    _onLoad: function () {
        window.setTimeout(L.bind(function() {<commit_msg>update progress control (tileloading > tileloadstart event)<commit_after>/**
 * Tile loading progress bar
 */
L.Control.Progress = L.Control.extend({
    options: {
        position: 'topleft',
        text: 'Loading',
        // id of element to add this control to, instead of corner (optional)
        div: null
    },

    initialize: function (tileLayer, options) {
        L.setOptions(this, options);
        
        this._layer = tileLayer;
    },

    addTo: function (map) {
        L.Control.prototype.addTo.apply(this, arguments);

        if (this.options.div) {
            this._container.parentNode.removeChild(this._container);
            L.DomUtil.get(this.options.div).appendChild(this._container);
        }

        return this;
    },
    
    onAdd: function (map) {
        var container, text;

        this._map = map;

        container = L.DomUtil.create('div', 'progress leaflet-bar hidden');

        text = L.DomUtil.create('span', 'progress-text');
        text.innerHTML = this.options.text;
        container.appendChild(text);

        this._bar = L.DomUtil.create('progress', 'progress-bar');
        container.appendChild(this._bar);
        
        this._layer.on('loading', this._onLoading, this);
        this._layer.on('load', this._onLoad, this);
        this._layer.on('tileload', this._onTileLoad, this);
        this._layer.on('tileloadstart', this._onTileLoading, this);
        this._layer.on('tileerror', this._onTileLoad, this);
        this._layer.on('tileabort', this._onTileLoad, this);

        return container;
    },

    onRemove: function (map) {
        this._layer.off('loading', this._onLoading, this);
        this._layer.off('load', this._onLoad, this);
        this._layer.off('tileload', this._onTileLoad, this);
        this._layer.off('tileloadstart', this._onTileLoading, this);
        this._layer.off('tileerror', this._onTileLoad, this);
        this._layer.off('tileabort', this._onTileLoad, this);
    },

    _onLoading: function () {
        this._bar.max = 0.1; // must be greater than zero, so adjust later
        this._bar.value = 0;
        L.DomUtil.removeClass(this._container, 'hidden');
    },
    
    _onLoad: function () {
        window.setTimeout(L.bind(function() {
{'fraction_non_alphanumeric': 0.14146124805685098, 'fraction_numerical': 0.0013324450366422385, 'mean_word_length': 2.4277016742770168, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5411286', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1318, 'n_words': 263}