<commit_before>////////////////////////////////////////////////////////////////////////////////
// Media Entry
//
// Single video entry.
// Available views:
// - compact: checkbox, filename, rater, and tagger controls as a row
// - thumb: checker, thumbnail, filename, and rater overlayed
// - full: all controls (checkbox, thumbnail, filename, rater, keywords, tagger)
////////////////////////////////////////////////////////////////////////////////
/*global jQuery, window */
var app = app || {};

app.controls = function (controls, $, services, data) {
	var
	
	VIEWS = {
		'thumb': 'thumb',
		'compact': 'compact',
		'full': 'full'
	},
	
	// static properties
	lastWidth,			// last measured available width for compact view media entry
	lastOpen,				// control reference to the last opened medium (thumb or compact to full)
	
	// static event handlers
	onClick,
	onChecked,
	onResize;
	
	controls.media = function (row, view) {
		var self = controls.control.create(),
		
		// sub-controls
		rater,
		tagger,
		keywords,
		
		// flags
		full = null;
		
		self.data.row = row;

		//////////////////////////////
		// Getters / setters

		self.view = function () {
			return view;
		};
		
		// true or false
		self.full = function (value) {
			if (typeof value !== 'undefined') {
				full = value ? 'full' : null;
				return self;
			} else {
				return full ? true : false;
			}
		};
		
		//////////////////////////////
		// Business functions

		// calls playback service			
		self.play = function (elem) {
			elem
				.siblings().removeClass('playing').end()
				.addClass('playing');
			//services.play(row.mediaid);
			data.pagestate.lastPlayed = row.mediaid;
			return self;
		};

		// tells whether this media entry is selected
		self.selected = function () {
			return $('#' + self.id).find(':checked').length > 0;
		};
		
		//////////////////////////////
		// Overrides

		// builds control structure
		// TODO: controls need be added once, or, when views change
		function build() {
			self.clear();
			
			// adding rater control
			rater = controls.rater(row).appendTo(self);
			
			// adding tagger control to non-thumb views
			if (full || view === 'compact') {
				tagger = controls.tagger(row).appendTo(self);
			}
			
			// adding keywords control to full view only
			if (full) {
				keywords = controls.keywords(row.keywords).appendTo(self);
			}
		}
		<commit_msg>playback turned back on<commit_after>////////////////////////////////////////////////////////////////////////////////
// Media Entry
//
// Single video entry.
// Available views:
// - compact: checkbox, filename, rater, and tagger controls as a row
// - thumb: checker, thumbnail, filename, and rater overlayed
// - full: all controls (checkbox, thumbnail, filename, rater, keywords, tagger)
////////////////////////////////////////////////////////////////////////////////
/*global jQuery, window */
var app = app || {};

app.controls = function (controls, $, services, data) {
	var
	
	VIEWS = {
		'thumb': 'thumb',
		'compact': 'compact',
		'full': 'full'
	},
	
	// static properties
	lastWidth,			// last measured available width for compact view media entry
	lastOpen,				// control reference to the last opened medium (thumb or compact to full)
	
	// static event handlers
	onClick,
	onChecked,
	onResize;
	
	controls.media = function (row, view) {
		var self = controls.control.create(),
		
		// sub-controls
		rater,
		tagger,
		keywords,
		
		// flags
		full = null;
		
		self.data.row = row;

		//////////////////////////////
		// Getters / setters

		self.view = function () {
			return view;
		};
		
		// true or false
		self.full = function (value) {
			if (typeof value !== 'undefined') {
				full = value ? 'full' : null;
				return self;
			} else {
				return full ? true : false;
			}
		};
		
		//////////////////////////////
		// Business functions

		// calls playback service			
		self.play = function (elem) {
			elem
				.siblings().removeClass('playing').end()
				.addClass('playing');
			services.play(row.mediaid);
			data.pagestate.lastPlayed = row.mediaid;
			return self;
		};

		// tells whether this media entry is selected
		self.selected = function () {
			return $('#' + self.id).find(':checked').length > 0;
		};
		
		//////////////////////////////
		// Overrides

		// builds control structure
		// TODO: controls need be added once, or, when views change
		function build() {
			self.clear();
			
			// adding rater control
			rater = controls.rater(row).appendTo(self);
			
			// adding tagger control to non-thumb views
			if (full || view === 'compact') {
				tagger = controls.tagger(row).appendTo(self);
			}
			
			// adding keywords control to full view only
			if (full) {
				keywords = controls.keywords(row.keywords).appendTo(self);
			}
		}
		
{'fraction_non_alphanumeric': 0.22664432341851698, 'fraction_numerical': 0.00041893590280687055, 'mean_word_length': 1.8524492234169654, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7130198', 'n_tokens_mistral': 1618, 'n_tokens_neox': 1326, 'n_words': 403}