<commit_before>define('views/listing',
    ['cache', 'feed_previews', 'format', 'jquery', 'l10n', 'log', 'models', 'notification', 'requests', 'settings', 'templates', 'underscore', 'urls', 'utils', 'z'],
    function(cache, feed_previews, format, $, l10n, log, models, notification, requests, settings, nunjucks, _, urls, utils, z) {
    'use strict';
    var gettext = l10n.gettext;

    z.body.on('click', '.manage-modules-listing .search-results .delete-feed-element', utils._pd(function(e) {
        e.stopPropagation();

        // Delete.
        var $this = $(this);
        var $item = $this.closest('li');

        if (!window.confirm(format.format(gettext('Do you really want to delete {0}?'), $item.data('slug')))) {
            // Confirm.
            return;
        }

        var endpoint = urls.api.url('feed-app', [$item.data('slug')]);
        if ($this.data('type') == 'collection') {
            endpoint = urls.api.url('collection', [$item.data('slug')]);
        } else if ($this.data('type') == 'brand') {
            endpoint = urls.api.url('feed-brand', [$item.data('slug')]);
        } else if ($this.data('type') == 'shelf') {
            endpoint = urls.api.url('feed-shelf', [$item.data('slug')]);
        }

        requests.del(endpoint).done(function(data) {
            notification.notification({message: gettext('Successfully deleted')});
            $item.remove();
            cache.flush();
        }).fail(function() {
            notification.notification({message: gettext('Sorry, we had an error deleting that')});
        });

    }))
    .on('input', '.search-elements', _.debounce(function() {
        var $this = $(this);

        if ($this.val().length > 1) {<commit_msg>fix delete feed elements (bug 1052717)<commit_after>define('views/listing',
    ['cache', 'feed_previews', 'format', 'jquery', 'l10n', 'log', 'models', 'notification', 'requests', 'settings', 'templates', 'underscore', 'urls', 'utils', 'z'],
    function(cache, feed_previews, format, $, l10n, log, models, notification, requests, settings, nunjucks, _, urls, utils, z) {
    'use strict';
    var gettext = l10n.gettext;

    z.body.on('click', '.manage-modules-listing .search-results .delete-feed-element', utils._pd(function(e) {
        e.stopPropagation();

        // Delete.
        var $this = $(this);
        var $item = $this.closest('li');

        if (!window.confirm(format.format(gettext('Do you really want to delete {0}?'), $item.data('slug')))) {
            // Confirm.
            return;
        }

        var endpoint = urls.api.url('feed-app', [$item.data('slug')]);
        if ($item.data('type') == 'collection') {
            endpoint = urls.api.url('collection', [$item.data('slug')]);
        } else if ($item.data('type') == 'brand') {
            endpoint = urls.api.url('feed-brand', [$item.data('slug')]);
        } else if ($item.data('type') == 'shelf') {
            endpoint = urls.api.url('feed-shelf', [$item.data('slug')]);
        }

        requests.del(endpoint).done(function(data) {
            notification.notification({message: gettext('Successfully deleted')});
            $item.remove();
            cache.flush();
        }).fail(function() {
            notification.notification({message: gettext('Sorry, we had an error deleting that')});
        });

    }))
    .on('input', '.search-elements', _.debounce(function() {
        var $this = $(this);

        if ($this.val().length > 1) {
{'fraction_non_alphanumeric': 0.20155934161131966, 'fraction_numerical': 0.006641640196361536, 'mean_word_length': 2.7167381974248928, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7124125', 'n_tokens_mistral': 1087, 'n_tokens_neox': 1054, 'n_words': 217}