<commit_before>//= require jquery
//= require jquery_ujs
//= require jquery.validate
//= require jquery.cookie
//= require jquery-ui
//= require bootstrap
//= require jquery.event.drag-2.2
//= require jquery.autogrowtextarea
//= require jquery.timeago
//= require jquery.form
//= require store
//= require jquery.masonry
//= require jquery.flot
//= require jquery.tinymce
//= require jquery.fn.gantt
//= require slickgrid/slick.core
//= require slickgrid/slick.grid
//= require slickgrid/slick.formatters
//= require slickgrid/slick.groupitemmetadataprovider
//= require slickgrid/slick.dataview
//= require slickgrid/plugins/slick.rowselectionmodel
//= require fullcalendar
//= require json2
//= require slimbox2
//= require select2

//= require ajax_spinner
//= require grid
//= require grids/columnpicker
//= require task
//= require unified_search
//= require score_rules
//= require trigger
//= require filter
//= require widget
//= require calendar
//= require services
//= require timeline
//= require persistent_timer
//= require mce_init
//= require gantt
//= require task_property_edit
//= require custom_attribute_edit
//= require_tree ./tasks
//= require user_permissions
//= require project_permissions
//= require email_addresses
//


jQuery.noConflict();

// Borrowed from jQuery 1.8.3's source code
jQuery.fn.extend({
  live: function( types, data, fn ) {
          jQuery( this.context ).on( types, this.selector, data, fn );
          return this;
        }
});

jQuery.widget("custom.catcomplete", jQuery.ui.autocomplete, {
  _renderMenu: function( ul, items ) {
    var self = this,
    currentCategory = "";
    jQuery.each( items, function( index, item ) {
      if ( item.category != currentCategory ) {
        ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" );
        currentCategory = item.category;
      }
      self._renderItemData( ul, item );
    });
  }
});

/*
  Requests the available attributes for the given resource type
  and updates the page with the returned values.
*/
function updateResourceAttributes(select) {
    select = jQuery(select);
    var typeId = select.val();
    var target = jQuery("#attributes");

    if (typeId == "") {
        target.html("");
    }
    else {
        var url = "/resources/attributes/?type_id=" + typeId;
        jQuery.get(url, function(data) {
            target.html(data);
        }, 'html');
    }
}

/*
  Removes the resource attribute to the link
*/<commit_msg>Remove hardcoded links #1 - /resources/attributes<commit_after>//= require jquery
//= require jquery_ujs
//= require jquery.validate
//= require jquery.cookie
//= require jquery-ui
//= require bootstrap
//= require jquery.event.drag-2.2
//= require jquery.autogrowtextarea
//= require jquery.timeago
//= require jquery.form
//= require store
//= require jquery.masonry
//= require jquery.flot
//= require jquery.tinymce
//= require jquery.fn.gantt
//= require slickgrid/slick.core
//= require slickgrid/slick.grid
//= require slickgrid/slick.formatters
//= require slickgrid/slick.groupitemmetadataprovider
//= require slickgrid/slick.dataview
//= require slickgrid/plugins/slick.rowselectionmodel
//= require fullcalendar
//= require json2
//= require slimbox2
//= require select2

//= require ajax_spinner
//= require grid
//= require grids/columnpicker
//= require task
//= require unified_search
//= require score_rules
//= require trigger
//= require filter
//= require widget
//= require calendar
//= require services
//= require timeline
//= require persistent_timer
//= require mce_init
//= require gantt
//= require task_property_edit
//= require custom_attribute_edit
//= require_tree ./tasks
//= require user_permissions
//= require project_permissions
//= require email_addresses

<% url = Rails.application.routes.url_helpers %>
jQuery.noConflict();

// Borrowed from jQuery 1.8.3's source code
jQuery.fn.extend({
  live: function( types, data, fn ) {
          jQuery( this.context ).on( types, this.selector, data, fn );
          return this;
        }
});

jQuery.widget("custom.catcomplete", jQuery.ui.autocomplete, {
  _renderMenu: function( ul, items ) {
    var self = this,
    currentCategory = "";
    jQuery.each( items, function( index, item ) {
      if ( item.category != currentCategory ) {
        ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" );
        currentCategory = item.category;
      }
      self._renderItemData( ul, item );
    });
  }
});

/*
  Requests the available attributes for the given resource type
  and updates the page with the returned values.
*/
function updateResourceAttributes(select) {
    select = jQuery(select);
    var typeId = select.val();
    var target = jQuery("#attributes");
    var resource_attributes_url = "<%= CGI.unescape url.attributes_resources_path(type_id: '{type_id}') %>";

    if (typeId == "") {
      target.html("");
    } else {
      var url = resolve_url(resource_attributes_url, {type_id: typeId});
      jQuery.get(url, function(data) { target.html(data); }, 'html');
    }
}

/*
  Removes the resource attribute to the link
*/
{'fraction_non_alphanumeric': 0.14204878048780487, 'fraction_numerical': 0.0033170731707317072, 'mean_word_length': 3.2224052718286655, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3300367', 'n_tokens_mistral': 1591, 'n_tokens_neox': 1524, 'n_words': 390}