<commit_before>(function(){
window.FactView = Backbone.View.extend({
  tagName: "div",

  className: "fact-block",

  _currentVisibleDropdown: undefined,

  events: {
    "click a.remove": "removeFactFromChannel",
    "click li.destroy": "destroyFact",
	  "click .controls .supporting, .controls .weakening": "toggleEvidence",
    "click .controls .supporting a.add-button,    .controls .weakening a.add-button, .no-evidence-message .do-add": "showAddRelation",
    "click .controls .supporting a.cancel-button, .controls .weakening a.cancel-button": "hideAddRelation"
  },

  initialize: function(opts) {
    this.useTemplate('facts','_fact'); // use after setting this.tmpl
    this.model.bind('destroy', this.remove, this);

    $(this.el).attr('data-fact-id', this.model.id).factlink();

    this.initAddToChannel();
    this.initFactRelationsViews();
    this.initUserPassportViews();
  },

  partials: {},

  render: function() {
    $( this.el )
      .html( Mustache.to_html(this.tmpl, this.model.toJSON(), this.partials)).factlink();

    this.initAddToChannel();
    this.initFactRelationsViews();
    this.initUserPassportViews();

    return this;
  },

  remove: function() {
    $(this.el).fadeOut('fast', function() {
      $(this.el).remove();
    });

    // Hides the popup (if necessary)
    if ( parent.remote ) {
      parent.remote.hide();
      parent.remote.stopHighlightingFactlink(this.model.id);
    }
  },

  removeFactFromChannel: function() {
    if(!confirm("Do you want to remove this Factlink from your channel? It will still be available in your `Created` channel.")) return false;
    this.model.destroy({
      error: function() {
        alert("Error while removing Factlink from Channel" );
      },
      forChannel: true
    });<commit_msg>No confirm on closing the modal dialog<commit_after>(function(){
window.FactView = Backbone.View.extend({
  tagName: "div",

  className: "fact-block",

  _currentVisibleDropdown: undefined,

  events: {
    "click a.remove": "removeFactFromChannel",
    "click li.destroy": "destroyFact",
	  "click .controls .supporting, .controls .weakening": "toggleEvidence",
    "click .controls .supporting a.add-button,    .controls .weakening a.add-button, .no-evidence-message .do-add": "showAddRelation",
    "click .controls .supporting a.cancel-button, .controls .weakening a.cancel-button": "hideAddRelation"
  },

  initialize: function(opts) {
    this.useTemplate('facts','_fact'); // use after setting this.tmpl
    this.model.bind('destroy', this.remove, this);

    $(this.el).attr('data-fact-id', this.model.id).factlink();

    this.initAddToChannel();
    this.initFactRelationsViews();
    this.initUserPassportViews();
  },

  partials: {},

  render: function() {
    $( this.el )
      .html( Mustache.to_html(this.tmpl, this.model.toJSON(), this.partials)).factlink();

    this.initAddToChannel();
    this.initFactRelationsViews();
    this.initUserPassportViews();

    return this;
  },

  remove: function() {
    $(this.el).fadeOut('fast', function() {
      $(this.el).remove();
    });

    // Hides the popup (if necessary)
    if ( parent.remote ) {
      parent.remote.hide();
      parent.remote.stopHighlightingFactlink(this.model.id);
    }
  },

  removeFactFromChannel: function() {
    this.model.destroy({
      error: function() {
        alert("Error while removing Factlink from Channel" );
      },
      forChannel: true
    });
{'fraction_non_alphanumeric': 0.1568855316676351, 'fraction_numerical': 0.0, 'mean_word_length': 3.385987261146497, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 3, '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': '133006', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1054, 'n_words': 217}