<commit_before>////////////////////////////////////////////////////////////////////////////////
// Tag Control
//
// Displays and edits one tag.
////////////////////////////////////////////////////////////////////////////////
/*global jQuery, jOrder, confirm */
var app = app || {};

app.controls = function (controls, $, jOrder, services, data) {
	// - row: media data record
	// - tag: tag string "name:kind"
	controls.tagedit = function (row, tag) {
		var	self = controls.control.create(controls.tag(row)),
				tmp = tag.split(':'),
				name = tmp[0] || '',
				kind = tmp[1] || '';

		self.data.row = row;
		self.data.tag = tag;
		self.hints = controls.tagedit.hints;
				
		//////////////////////////////
		// Overrides
		
		self.display = function () {
			var hit = controls.search.filter.length && data.tag(controls.search.filter).match(name) ? 'hit' : null;
			
			return [
				'<span id="', self.id, '" class="', ['tag background tagedit editable display', data.kinds.getNumber(kind), hit].join(' '), '" title="', kind, '">',
				'<span>', name.replace(' ', '&nbsp'), '</span>',
				'</span>'
			].join('');
		};

		self.edit = function () {
			return [
				'<span id="', self.id, '" class="tag tagedit edit ' + data.kinds.getNumber(kind) + '">',
				'<div class="background"></div>',
				'<input type="text" class="focus" value="', tag, '"/>',
				'<a href="#" class="button remove" title="Remove tag"></a>',
				tag.indexOf(' ') === -1 ? '' : '<a href="#" class="button explode" title="Explode tag"></a>',
				'</span>'
			].join('');
		};
		
		return self;
	};
	
	//////////////////////////////
	// Static properties

	// hints associated with this control
	controls.tagedit.hints = [
		"SHIFT + ENTER to change tag on checked videos.",
		"SHIFT + CLICK on delete to remove all occurrences.",
		"CTRL + ENTER to change tag on search results.",
		"CTRL + CLICK on delete to remove from search results."	
	].concat(controls.tag.hints);
	
	//////////////////////////////<commit_msg>fixed typo in tagedit (&nbsp;)<commit_after>////////////////////////////////////////////////////////////////////////////////
// Tag Control
//
// Displays and edits one tag.
////////////////////////////////////////////////////////////////////////////////
/*global jQuery, jOrder, confirm */
var app = app || {};

app.controls = function (controls, $, jOrder, services, data) {
	// - row: media data record
	// - tag: tag string "name:kind"
	controls.tagedit = function (row, tag) {
		var	self = controls.control.create(controls.tag(row)),
				tmp = tag.split(':'),
				name = tmp[0] || '',
				kind = tmp[1] || '';

		self.data.row = row;
		self.data.tag = tag;
		self.hints = controls.tagedit.hints;
				
		//////////////////////////////
		// Overrides
		
		self.display = function () {
			var hit = controls.search.filter.length && data.tag(controls.search.filter).match(name) ? 'hit' : null;
			
			return [
				'<span id="', self.id, '" class="', ['tag background tagedit editable display', data.kinds.getNumber(kind), hit].join(' '), '" title="', kind, '">',
				'<span>', name.replace(' ', '&nbsp;'), '</span>',
				'</span>'
			].join('');
		};

		self.edit = function () {
			return [
				'<span id="', self.id, '" class="tag tagedit edit ' + data.kinds.getNumber(kind) + '">',
				'<div class="background"></div>',
				'<input type="text" class="focus" value="', tag, '"/>',
				'<a href="#" class="button remove" title="Remove tag"></a>',
				tag.indexOf(' ') === -1 ? '' : '<a href="#" class="button explode" title="Explode tag"></a>',
				'</span>'
			].join('');
		};
		
		return self;
	};
	
	//////////////////////////////
	// Static properties

	// hints associated with this control
	controls.tagedit.hints = [
		"SHIFT + ENTER to change tag on checked videos.",
		"SHIFT + CLICK on delete to remove all occurrences.",
		"CTRL + ENTER to change tag on search results.",
		"CTRL + CLICK on delete to remove from search results."	
	].concat(controls.tag.hints);
	
	//////////////////////////////
{'fraction_non_alphanumeric': 0.30575, 'fraction_numerical': 0.0015, 'mean_word_length': 1.9659006671608599, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '4639476', 'n_tokens_mistral': 1346, 'n_tokens_neox': 1182, 'n_words': 312}