<commit_before>$(document).ready(function() {

  $('.rule-item').on('mouseenter', function() {
    $(this).addClass('highlighted');
    var controls = $('<span>').addClass('pull-right controls');
    controls.append($.editButton($(this).attr('id')));
    controls.append($.removeButton($(this).attr('id')));
    $(this).find('h2').append(controls);
    $('.edit-button').on('click', function(e) {
      var ruleID = $(e.currentTarget).parents('.rule-item').attr('id');
      window.location.href =
        document.URL + '/' + ruleID + '/input';
    });

  });

  $('.rule-item').on('mouseleave', function() {
    $(this).removeClass('highlighted');
    $(this).find('.controls').remove();
  });

});<commit_msg>Delete feature when clicking its `.remove-button` in Rule Browser.<commit_after>var Rule = Backbone.Model.extend({

  initialize: function() {
    this.urlRoot = '/rules';
  },

});

$(document).ready(function() {

  $('.rule-item').on('mouseenter', function() {
    $(this).addClass('highlighted');
    var controls = $('<span>').addClass('pull-right controls');
    controls.append($.editButton($(this).attr('id')));
    controls.append($.removeButton($(this).attr('id')));
    $(this).find('h2').append(controls);
    $('.edit-button').on('click', function(e) {
      var ruleID = $(e.currentTarget).parents('.rule-item').attr('id');
      window.location.href =
        document.URL + '/' + ruleID + '/input';
    });
    $('.remove-button').on('click', function(e) {
      var ruleID = $(e.currentTarget).parents('.rule-item').attr('id')
        .substring(1);
      var rule = new Rule({ id: ruleID });
      rule.destroy();
    });
  });

  $('.rule-item').on('mouseleave', function() {
    $(this).removeClass('highlighted');
    $(this).find('.controls').remove();
  });

});
{'fraction_non_alphanumeric': 0.25334075723830735, 'fraction_numerical': 0.0016703786191536749, 'mean_word_length': 3.7041884816753927, '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': '2725987', 'n_tokens_mistral': 568, 'n_tokens_neox': 558, 'n_words': 76}