<commit_before>function send_ajax(source_url) {
  jQuery(".link-address").autocomplete({
    source : function(request, response){
      jQuery.ajax({
        type: "GET",
        url: source_url,
        data: {query: request.term},
        success: function(result){
          response(result);
        },
        error: function(ajax, stat, errorThrown) {
          console.log('Link not found : ' + errorThrown);
        }
      });
    },

    minLength: 3
  });
}

function new_link_action(){
  send_ajax(jQuery("#page_url").val());

  jQuery(".delete-link-list-row").click(function(){
    jQuery(this).parent().parent().remove();
    return false;
  });

  jQuery(document).scrollTop(jQuery('#dropable-link-list').scrollTop());
}

function add_new_link() {
  var new_link = jQuery(jQuery('#edit-link-list-block #new-template tr').html());
  new_link.show();
  jQuery('#dropable-link-list').append(new_link);
  new_link_action();
}

jQuery(document).ready(function(){
  new_link_action();

  jQuery("#dropable-link-list").sortable({
    revert: true,
    axis: "y"
  });
});

//# sourceURL=edit-link-list.js<commit_msg>Copy also the tr from the table template<commit_after>function send_ajax(source_url) {
  jQuery(".link-address").autocomplete({
    source : function(request, response){
      jQuery.ajax({
        type: "GET",
        url: source_url,
        data: {query: request.term},
        success: function(result){
          response(result);
        },
        error: function(ajax, stat, errorThrown) {
          console.log('Link not found : ' + errorThrown);
        }
      });
    },

    minLength: 3
  });
}

function new_link_action(){
  send_ajax(jQuery("#page_url").val());

  jQuery(".delete-link-list-row").click(function(){
    jQuery(this).parent().parent().remove();
    return false;
  });

  jQuery(document).scrollTop(jQuery('#dropable-link-list').scrollTop());
}

function add_new_link() {
  var new_link = jQuery(jQuery('#edit-link-list-block #new-template tbody').html());
  new_link.show();
  jQuery('#dropable-link-list').append(new_link);
  new_link_action();
}

jQuery(document).ready(function(){
  new_link_action();

  jQuery("#dropable-link-list").sortable({
    revert: true,
    axis: "y"
  });
});

//# sourceURL=edit-link-list.js
{'fraction_non_alphanumeric': 0.18070175438596492, 'fraction_numerical': 0.0008771929824561404, 'mean_word_length': 3.3365019011406845, 'pattern_counts': {'":': 0, '<': 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': '6870945', 'n_tokens_mistral': 735, 'n_tokens_neox': 722, 'n_words': 112}