<commit_before>var lizLayerFilterTool = function() {

    lizMap.events.on({
        'uicreated':function(){

            if (typeof variable != "undefined")
                return true;

            // Launch LayerFilter feature
            if (typeof filterConfig != "undefined" && '0' in filterConfig) {
                addLayerFilterToolInterface();
                launchLayerFilterTool(filterConfigData.layerId);

                // Listen to the layer selector changes
                $('#liz-filter-layer-selector').change(function(){
                    deactivateFilter();
                    filterConfigData.layerId = $(this).val();
                    launchLayerFilterTool($(this).val());
                });
            }

        } // uicreated

    });

    // Compute the HTML container for the form
    function getLayerFilterDockRoot(){
        var html = '';

        html+= '<div class="menu-content">';
        // Add combo box to select the layer
        html+= '<select id="liz-filter-layer-selector">';
        var flayers = {};
        for (var o in filterConfig) {
            var conf = filterConfig[o];
            if( !(conf.layerId in flayers) ){
                // Get layer
                var layerId = conf.layerId;
                var lconfig_get = lizMap.getLayerConfigById(layerId);
                if( !lconfig_get)
                    continue;
                var lname = lconfig_get[0];
                var lconf = lconfig_get[1];
                var displayName = lname;
                if( 'title' in lconf && lconf.title != '' ){
                    displayName = lconf.title;
                }
                html+= '<option value="'+layerId+'">'+displayName+'</option>';
                flayers[layerId] = true;
            }
        }
        html+= '</select></br>';

        // Add total feature counter
        var total = 0
        html+= '<b><span id="liz-filter-item-layer-total-count">' + total + '</span> '+lizDict['filter.label.features']+'</b>';

        // Add zoom link
        html+= '<br/><button id="liz-filter-zoom" class="btn btn-mini btn-primary" title="'+lizDict['filter.btn.zoom.title']+'">'+lizDict['filter.btn.zoom.label']+'</button>';

        // Add export button
        html+= '&nbsp;&nbsp;<button id="liz-filter-export" class="btn btn-mini btn-primary" title="'+lizDict['filter.btn.export.title']+'">'+lizDict['filter.btn.export.label']+'</button>';

        // Add unfilter link
        html+= '&nbsp;&nbsp;<button id="liz-filter-unfilter" class="btn btn-mini btn-primary" title="'+lizDict['filter.btn.reset.title']+'">'+lizDict['filter.btn.reset.label']+'</button>';

        html+= '</div>';

        // Add tree
        html+= '<div style="padding:10px 10px;" class="tree menu-content"></div>';

        return html;
    }

    function addLayerFilterToolInterface(){

        // Build interface html code
        // Add dock
        var html = getLayerFilterDockRoot();
        $('#filter-content').html(html);

        // Get 1st layer found as default layer
        var layerId = filterConfig[0]['layerId'];
        filterConfigData.layerId = layerId;

        // Activate the unfilter link
        $('#liz-filter-unfilter').click(function(){
            // Remove filter
            deactivateFilter();
            return false;
        });
<commit_msg>[Filter] Add lizmap-digitizing component<commit_after>var lizLayerFilterTool = function() {

    lizMap.events.on({
        'uicreated':function(){

            if (typeof variable != "undefined")
                return true;

            // Launch LayerFilter feature
            if (typeof filterConfig != "undefined" && '0' in filterConfig) {
                addLayerFilterToolInterface();
                launchLayerFilterTool(filterConfigData.layerId);

                // Listen to the layer selector changes
                $('#liz-filter-layer-selector').change(function(){
                    deactivateFilter();
                    filterConfigData.layerId = $(this).val();
                    launchLayerFilterTool($(this).val());
                });
            }

        } // uicreated

    });

    // Compute the HTML container for the form
    function getLayerFilterDockRoot(){
        var html = '';

        html+= '<div class="menu-content">';
        // Add combo box to select the layer
        html+= '<select id="liz-filter-layer-selector">';
        var flayers = {};
        for (var o in filterConfig) {
            var conf = filterConfig[o];
            if( !(conf.layerId in flayers) ){
                // Get layer
                var layerId = conf.layerId;
                var lconfig_get = lizMap.getLayerConfigById(layerId);
                if( !lconfig_get)
                    continue;
                var lname = lconfig_get[0];
                var lconf = lconfig_get[1];
                var displayName = lname;
                if( 'title' in lconf && lconf.title != '' ){
                    displayName = lconf.title;
                }
                html+= '<option value="'+layerId+'">'+displayName+'</option>';
                flayers[layerId] = true;
            }
        }
        html+= '</select></br>';

        // Add total feature counter
        var total = 0
        html+= '<b><span id="liz-filter-item-layer-total-count">' + total + '</span> '+lizDict['filter.label.features']+'</b>';

        // Add zoom link
        html+= '<br/><button id="liz-filter-zoom" class="btn btn-mini btn-primary" title="'+lizDict['filter.btn.zoom.title']+'">'+lizDict['filter.btn.zoom.label']+'</button>';

        // Add export button
        html+= '&nbsp;&nbsp;<button id="liz-filter-export" class="btn btn-mini btn-primary" title="'+lizDict['filter.btn.export.title']+'">'+lizDict['filter.btn.export.label']+'</button>';

        // Add unfilter link
        html+= '&nbsp;&nbsp;<button id="liz-filter-unfilter" class="btn btn-mini btn-primary" title="'+lizDict['filter.btn.reset.title']+'">'+lizDict['filter.btn.reset.label']+'</button>';

        html+= '</div>';

        // Add tree
        html+= '<div style="padding:10px 10px;" class="tree menu-content"></div>';

        // Add digitizing tool
        html += '<lizmap-digitizing></lizmap-digitizing>';

        return html;
    }

    function addLayerFilterToolInterface(){

        // Build interface html code
        // Add dock
        var html = getLayerFilterDockRoot();
        $('#filter-content').html(html);

        // Get 1st layer found as default layer
        var layerId = filterConfig[0]['layerId'];
        filterConfigData.layerId = layerId;

        // Activate the unfilter link
        $('#liz-filter-unfilter').click(function(){
            // Remove filter
            deactivateFilter();
            return false;
        });

{'fraction_non_alphanumeric': 0.15086841330585812, 'fraction_numerical': 0.0029437739181630853, 'mean_word_length': 1.8939522998296423, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, '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': '5977268', 'n_tokens_mistral': 1923, 'n_tokens_neox': 1817, 'n_words': 400}