<commit_before>'use strict';
/**
 * @file rate-control.js
 *
 * Rate control
 */

import $ from 'jquery';
import Control from './control';
import ControlText from './control-text';
import Cookie from '../utils/cookie';

/**
 * @param {Player} player Main player
 * @class RateControl
 */
class RateControl extends Control {
	constructor (player, options={}) {
		options = $.extend({}, {
			className : 'control-container'
		}, options);
		super(player, options);
		let video = this.player.video;
		this.downControl.element.on('click', e => {
			video.rate -= this.player.options.rate.step;
		})

		this.upControl.element.on('click', e => {
			video.rate += this.player.options.rate.step;
		});
	}

	createElement() {
		super.createElement();
		this.downControl = new Control(this.player, {
			className : 'rate-down',
			iconName : 'backward',
			title : 'Уменьшить скорость проигрывания'
		});
		this.upControl = new Control(this.player, {
			className : 'rate-up',
			iconName : 'forward',
			title : 'Увеличить скоросить проигрывания'
		});
		this.currentRate = new ControlText({ className : 'rate-current'});

		this.element
			.append(this.downControl.element)
			.append(this.currentRate.element)
			.append(this.upControl.element);
	}

	buildCSSClass() {
		return this.options.className;
	}

	set value (value) {
		let video = this.player.video;
		let options = this.player.options;
		if (this.disabled) {
			return false;
		}
		this.upControl.element.removeClass('disabled');
		this.downControl.element.removeClass('disabled');
		if (video.rate <= options.rate.min)
			this.downControl.element.addClass('disabled');
		else if (video.rate >= options.rate.max)<commit_msg>[#91]: Fix mistake in title of rate control<commit_after>'use strict';
/**
 * @file rate-control.js
 *
 * Rate control
 */

import $ from 'jquery';
import Control from './control';
import ControlText from './control-text';
import Cookie from '../utils/cookie';

/**
 * @param {Player} player Main player
 * @class RateControl
 */
class RateControl extends Control {
	constructor (player, options={}) {
		options = $.extend({}, {
			className : 'control-container'
		}, options);
		super(player, options);
		let video = this.player.video;
		this.downControl.element.on('click', e => {
			video.rate -= this.player.options.rate.step;
		})

		this.upControl.element.on('click', e => {
			video.rate += this.player.options.rate.step;
		});
	}

	createElement() {
		super.createElement();
		this.downControl = new Control(this.player, {
			className : 'rate-down',
			iconName : 'backward',
			title : 'Уменьшить скорость проигрывания'
		});
		this.upControl = new Control(this.player, {
			className : 'rate-up',
			iconName : 'forward',
			title : 'Увеличить скорость проигрывания'
		});
		this.currentRate = new ControlText({ className : 'rate-current'});

		this.element
			.append(this.downControl.element)
			.append(this.currentRate.element)
			.append(this.upControl.element);
	}

	buildCSSClass() {
		return this.options.className;
	}

	set value (value) {
		let video = this.player.video;
		let options = this.player.options;
		if (this.disabled) {
			return false;
		}
		this.upControl.element.removeClass('disabled');
		this.downControl.element.removeClass('disabled');
		if (video.rate <= options.rate.min)
			this.downControl.element.addClass('disabled');
		else if (video.rate >= options.rate.max)
{'fraction_non_alphanumeric': 0.15716395864106353, 'fraction_numerical': 0.0005908419497784342, 'mean_word_length': 3.7824858757062145, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6184705', 'n_tokens_mistral': 1195, 'n_tokens_neox': 1088, 'n_words': 230}