<commit_before>(function () {
    "use strict";

    Mapbender.Digitizer = Mapbender.Digitizer || {};
    Mapbender.Digitizer.TableRenderer = function() {
        Mapbender.DataManager.TableRenderer.apply(this, arguments);
    };
    Mapbender.Digitizer.TableRenderer.prototype = Object.create(Mapbender.DataManager.TableRenderer.prototype);
    Object.assign(Mapbender.Digitizer.TableRenderer.prototype, {
        constructor: Mapbender.Digitizer.TableRenderer
    });


    Mapbender.Digitizer.Menu = function (owner) {
        this.owner = owner;
    };

    Mapbender.Digitizer.Menu.prototype.registerResultTableEvents = function (resultTable, frame) {
        var menu = this;
        var schema = menu.schema;
        var widget = schema.widget;
        var map = widget.map;
        menu.resultTable = resultTable;

        map.on(ol.MapEventType.MOVEEND, function (event) {

            var resolution = map.getView().getResolution();

            if (resolution > schema.layer.getMaxResolution() || resolution < schema.layer.getMinResolution()) {

                resultTable.clear();

            } else {
                // @todo: pull value from checkbox, not from (missing) property

                if (resultTable.currentExtentSearch) {
                    var features = schema.layer.getSource().getFeatures().filter(function (feature) {
                        return widget.isInExtent(feature);
                    });
                    resultTable.redraw(features);     // @todo: resolve custom vis-ui dependency
                } else {
                    resultTable.redraw(schema.layer.getSource().getFeatures());   // @todo: resolve custom vis-ui dependency
                }

            }

        });

        schema.layer.getSource().on(ol.source.VectorEventType.ADDFEATURE, function (event) {
            var feature = event.feature;
            feature.on(ol.ObjectEventType.PROPERTYCHANGE, function (event) {
                if (event.key === 'dirty' || event.key === 'modificationState') {
                    var length = schema.layer.getSource().getFeatures().filter(function (feature) {
                        return ["isNew", "isChanged", "isCopy"].includes(feature.get("modificationState"));
                    }).length;

                    if (length === 0) {
                        frame.find(".resultTableControlButtons .save").attr("disabled", "disabled");
                    }
                }
            });

        });

        schema.layer.getSource().on(ol.source.VectorEventType.REMOVEFEATURE, function (event) {
            resultTable.deleteRow(event.feature);
        });
    };

    Mapbender.Digitizer.TableRenderer.prototype.getButtonsOption = function(schema) {
        var buttons = [];

        buttons.push({
            title: Mapbender.trans('mb.digitizer.feature.zoomTo'),
            cssClass: 'fa fas fa-crosshairs -fn-zoom-to-feature'
        });

        if (schema.allowEditData && schema.allowSaveInResultTable) {
            buttons.push({
                title: Mapbender.trans('mb.digitizer.feature.save.title'),
                cssClass: '-fn-save fa fas fa-save'
            });
        }

        if (schema.copy && schema.copy.enable) {
            buttons.push({
                title: Mapbender.trans('mb.digitizer.feature.clone.title'),
                cssClass: 'fa fas fa-copy -fn-copy'
            });
        }
        if (schema.allowCustomStyle) {
            buttons.push({
                title: Mapbender.trans('mb.digitizer.feature.style.change'),
                cssClass: '-fn-edit-style fa fas fa-eyedropper fa-eye-dropper'  // NOTE: fas and fa-eye-dropper for FA5+; fa-eyedropper for FA4
            });
        }
<commit_msg>Drop redundant table row removal on feature removal event listener (already works)<commit_after>(function () {
    "use strict";

    Mapbender.Digitizer = Mapbender.Digitizer || {};
    Mapbender.Digitizer.TableRenderer = function() {
        Mapbender.DataManager.TableRenderer.apply(this, arguments);
    };
    Mapbender.Digitizer.TableRenderer.prototype = Object.create(Mapbender.DataManager.TableRenderer.prototype);
    Object.assign(Mapbender.Digitizer.TableRenderer.prototype, {
        constructor: Mapbender.Digitizer.TableRenderer
    });


    Mapbender.Digitizer.Menu = function (owner) {
        this.owner = owner;
    };

    Mapbender.Digitizer.Menu.prototype.registerResultTableEvents = function (resultTable, frame) {
        var menu = this;
        var schema = menu.schema;
        var widget = schema.widget;
        var map = widget.map;
        menu.resultTable = resultTable;

        map.on(ol.MapEventType.MOVEEND, function (event) {

            var resolution = map.getView().getResolution();

            if (resolution > schema.layer.getMaxResolution() || resolution < schema.layer.getMinResolution()) {

                resultTable.clear();

            } else {
                // @todo: pull value from checkbox, not from (missing) property

                if (resultTable.currentExtentSearch) {
                    var features = schema.layer.getSource().getFeatures().filter(function (feature) {
                        return widget.isInExtent(feature);
                    });
                    resultTable.redraw(features);     // @todo: resolve custom vis-ui dependency
                } else {
                    resultTable.redraw(schema.layer.getSource().getFeatures());   // @todo: resolve custom vis-ui dependency
                }

            }

        });

        schema.layer.getSource().on(ol.source.VectorEventType.ADDFEATURE, function (event) {
            var feature = event.feature;
            feature.on(ol.ObjectEventType.PROPERTYCHANGE, function (event) {
                if (event.key === 'dirty' || event.key === 'modificationState') {
                    var length = schema.layer.getSource().getFeatures().filter(function (feature) {
                        return ["isNew", "isChanged", "isCopy"].includes(feature.get("modificationState"));
                    }).length;

                    if (length === 0) {
                        frame.find(".resultTableControlButtons .save").attr("disabled", "disabled");
                    }
                }
            });

        });
    };

    Mapbender.Digitizer.TableRenderer.prototype.getButtonsOption = function(schema) {
        var buttons = [];

        buttons.push({
            title: Mapbender.trans('mb.digitizer.feature.zoomTo'),
            cssClass: 'fa fas fa-crosshairs -fn-zoom-to-feature'
        });

        if (schema.allowEditData && schema.allowSaveInResultTable) {
            buttons.push({
                title: Mapbender.trans('mb.digitizer.feature.save.title'),
                cssClass: '-fn-save fa fas fa-save'
            });
        }

        if (schema.copy && schema.copy.enable) {
            buttons.push({
                title: Mapbender.trans('mb.digitizer.feature.clone.title'),
                cssClass: 'fa fas fa-copy -fn-copy'
            });
        }
        if (schema.allowCustomStyle) {
            buttons.push({
                title: Mapbender.trans('mb.digitizer.feature.style.change'),
                cssClass: '-fn-edit-style fa fas fa-eyedropper fa-eye-dropper'  // NOTE: fas and fa-eye-dropper for FA5+; fa-eyedropper for FA4
            });
        }

{'fraction_non_alphanumeric': 0.12208039109179794, 'fraction_numerical': 0.0008147745790331341, 'mean_word_length': 1.9099170288423548, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4405514', 'n_tokens_mistral': 2035, 'n_tokens_neox': 1936, 'n_words': 341}