<commit_before>$.widget('boom.assetManager', {
	baseUrl : '/cms/assets/',
	listUrl : '/cms/assets/list',
	postData : {
		page : 1
	},

	selected : [],

	tag : 0,
	sortby : '',

	addFilter : function(type, value) {
		this.postData.page = 1;
		this.postData[type] = value;
	},

	assetsUploaded : function(assetIds) {
		var assetManager = this;

		assetManager.getAssets();
		assetManager.uploader.hide();
	},

	bind : function() {
		var assetManager = this;

		this.bindContentArea();
		this.bindMenuButtons();

		this.uploader
			.assetUploader({
				done : function(e, data) {
					assetManager.assetsUploaded(data.result);
				}
			})
			.on('click', '#b-assets-upload-close', function(e) {
				e.preventDefault();
				assetManager.uploader.hide();
			});
	},

	bindContentArea : function() {
		var assetManager = this;

		this.element
			.on('change', '#b-assets-sortby', function(event) {
				assetManager.sortBy(this.value);
			})
			.on('change', '#b-assets-types', function(event) {
				assetManager.addFilter('type', this.selectedIndex? this.options[this.selectedIndex].innerHTML : '');
				assetManager.getAssets();
			})
			.on('click', '#b-assets-all', function(event) {
				assetManager.removeFilters();
				assetManager.getAssets();
			})
			.on('click', '.thumb a', function(event) {
				event.preventDefault();

				var $this = $(this);

				assetManager.select($this.attr('href').replace('#asset/', ''));
				$this.parent().parent().toggleClass('selected');
			})
			.on('focus', '#b-assets-filter-title, #b-tags-search input', function() {
				var $this = $(this);

				if ($this.val() == $this.attr('placeholder')) {
					$this.val('');
				}
			})
			.on('blur', '#b-assets-filter-title, #b-tags-search input', function() {
				var $this = $(this);

				if ($this.val() == '') {
					$this.val($this.attr('placeholder'));
				}
			});

		this.titleFilter = this.element
			.find('#b-assets-filter-title')
			.assetTitleFilter({
				search : function(event, ui) {
					assetManager.addFilter('title', $(this).val());
					assetManager.getAssets();
				},
				select : function(event, ui) {
					assetManager.addFilter('title', ui.item.value);
					assetManager.getAssets();
				}
			});<commit_msg>Removed duplication of focus / blue events for title and tag filters in asset manager<commit_after>$.widget('boom.assetManager', {
	baseUrl : '/cms/assets/',
	listUrl : '/cms/assets/list',
	postData : {
		page : 1
	},

	selected : [],

	tag : 0,
	sortby : '',

	addFilter : function(type, value) {
		this.postData.page = 1;
		this.postData[type] = value;
	},

	assetsUploaded : function(assetIds) {
		var assetManager = this;

		assetManager.getAssets();
		assetManager.uploader.hide();
	},

	bind : function() {
		var assetManager = this;

		this.bindContentArea();
		this.bindMenuButtons();

		this.uploader
			.assetUploader({
				done : function(e, data) {
					assetManager.assetsUploaded(data.result);
				}
			})
			.on('click', '#b-assets-upload-close', function(e) {
				e.preventDefault();
				assetManager.uploader.hide();
			});
	},

	bindContentArea : function() {
		var assetManager = this;

		this.element
			.on('change', '#b-assets-sortby', function(event) {
				assetManager.sortBy(this.value);
			})
			.on('change', '#b-assets-types', function(event) {
				assetManager.addFilter('type', this.selectedIndex? this.options[this.selectedIndex].innerHTML : '');
				assetManager.getAssets();
			})
			.on('click', '#b-assets-all', function(event) {
				assetManager.removeFilters();
				assetManager.getAssets();
			})
			.on('click', '.thumb a', function(event) {
				event.preventDefault();

				var $this = $(this);

				assetManager.select($this.attr('href').replace('#asset/', ''));
				$this.parent().parent().toggleClass('selected');
			});

		this.titleFilter = this.element
			.find('#b-assets-filter-title')
			.assetTitleFilter({
				search : function(event, ui) {
					assetManager.addFilter('title', $(this).val());
					assetManager.getAssets();
				},
				select : function(event, ui) {
					assetManager.addFilter('title', ui.item.value);
					assetManager.getAssets();
				}
			});
{'fraction_non_alphanumeric': 0.189634294017922, 'fraction_numerical': 0.001453136352627755, 'mean_word_length': 3.4313304721030042, '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': '955726', 'n_tokens_mistral': 1655, 'n_tokens_neox': 1360, 'n_words': 220}