<commit_before>
(function($) {

	/**
	 * This plugin add an interface for subsection management.
	 *
	 * @author: <NAME>, <EMAIL>
	 * @source: http://github.com/nilshoerrmann/subsectionmanager
	 */
	$(document).ready(function() {

		// Language strings
		Symphony.Language.add({
			'There are no selected items': false,
			'Are you sure you want to delete {$item}? It will be removed from all entries. This step cannot be undone.': false,
			'There are currently no items available. Perhaps you want create one first?': false,
			'New item': false,
			'Search existing items': false,
			'no matches': false,
			'1 match': false,
			'{$count} matches': false,
			'Remove item': false	
		});
		
		// Subsection Manager
		$('div.field-subsectionmanager').each(function subsectionmanager() {
			var manager = $(this),
				duplicator = manager.find('div.frame'),
				selection = manager.find('ol'),
				manager_id = manager.attr('data-field-id'),
				manager_name = manager.attr('data-field-name'),
				subsection_id = manager.attr('data-subsection-id'),
				subsection_link = manager.attr('data-subsection-new'),
				controls, browser, searchfield, counter, existing, controlsWidth;
				
		/*-------------------------------------------------------------------------
			Events
		-------------------------------------------------------------------------*/
		
			// Set item names
			duplicator.on('constructstop.duplicator update.subsectionmanager', 'li', function setName(event) {		
				$(this).find('input:hidden').attr('name', manager_name + '[]');
			});
		
			// Create new item
			duplicator.on('constructshow.duplicator', 'li', function createItem(event) {
				var item = $(this),
					iframe = item.find('iframe');

				// Load subsection
				iframe.addClass('initialise loading new').attr('src', subsection_link + '/new/').load(function() {
					load(item);
				});
			});
			
			// Add existing item
			manager.on('click.subsectionmanager', '.browser li:not(.selected)', function addItem(event) {
				var item = $(this).clone(),
					height, header, top;
					
				// Hide browser
				browser.removeClass('opened');
				
				// Prepare item
				addDestructor(item);
					
				// Add item
				item.trigger('constructstart.duplicator');
				duplicator.removeClass('empty');
				item.find('.content').hide();
				item.hide().addClass('collapsed').appendTo(selection);
				
				// Prepare animation
				height = item.height();
				header = item.find('header');
				top = header.css('padding-top');				
			
				// Reveal item
				header.css('padding-top', 0).animate({
					paddingTop: top
				}, 'fast');
				item.css('height', 0).show().animate({<commit_msg>Blur search field after selecting item from the browser<commit_after>
(function($) {

	/**
	 * This plugin add an interface for subsection management.
	 *
	 * @author: <NAME>, <EMAIL>
	 * @source: http://github.com/nilshoerrmann/subsectionmanager
	 */
	$(document).ready(function() {

		// Language strings
		Symphony.Language.add({
			'There are no selected items': false,
			'Are you sure you want to delete {$item}? It will be removed from all entries. This step cannot be undone.': false,
			'There are currently no items available. Perhaps you want create one first?': false,
			'New item': false,
			'Search existing items': false,
			'no matches': false,
			'1 match': false,
			'{$count} matches': false,
			'Remove item': false	
		});
		
		// Subsection Manager
		$('div.field-subsectionmanager').each(function subsectionmanager() {
			var manager = $(this),
				duplicator = manager.find('div.frame'),
				selection = manager.find('ol'),
				manager_id = manager.attr('data-field-id'),
				manager_name = manager.attr('data-field-name'),
				subsection_id = manager.attr('data-subsection-id'),
				subsection_link = manager.attr('data-subsection-new'),
				controls, browser, searchfield, counter, existing, controlsWidth;
				
		/*-------------------------------------------------------------------------
			Events
		-------------------------------------------------------------------------*/
		
			// Set item names
			duplicator.on('constructstop.duplicator update.subsectionmanager', 'li', function setName(event) {		
				$(this).find('input:hidden').attr('name', manager_name + '[]');
			});
		
			// Create new item
			duplicator.on('constructshow.duplicator', 'li', function createItem(event) {
				var item = $(this),
					iframe = item.find('iframe');

				// Load subsection
				iframe.addClass('initialise loading new').attr('src', subsection_link + '/new/').load(function() {
					load(item);
				});
			});
			
			// Add existing item
			manager.on('click.subsectionmanager', '.browser li:not(.selected)', function addItem(event) {
				var item = $(this).clone(),
					height, header, top;
					
				// Hide browser
				browser.removeClass('opened');
				searchfield.trigger('blur.subsectionmanager');
				
				// Prepare item
				addDestructor(item);
					
				// Add item
				item.trigger('constructstart.duplicator');
				duplicator.removeClass('empty');
				item.find('.content').hide();
				item.hide().addClass('collapsed').appendTo(selection);
				
				// Prepare animation
				height = item.height();
				header = item.find('header');
				top = header.css('padding-top');				
			
				// Reveal item
				header.css('padding-top', 0).animate({
					paddingTop: top
				}, 'fast');
				item.css('height', 0).show().animate({
{'fraction_non_alphanumeric': 0.20532249122158566, 'fraction_numerical': 0.0011088523378303455, 'mean_word_length': 2.6176470588235294, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '109882', 'n_tokens_mistral': 1912, 'n_tokens_neox': 1500, 'n_words': 364}