<commit_before>(function (window, Q, $, undefined) {
	
/**
 * @module Q
 */
	
/**
 * Render tool to select clip start/end time
 * @class Q clip
 * @constructor
 * @param {Object} [options] Override various options for this tool
 *  @param {String|Integer} [options.start] String in format hh:mm:ss or integeer seconds
 *  @param {String|Integer} [options.end] String in format hh:mm:ss or integeer seconds
 *  @param {Q.Event} onStart event trigger when clip start time defined
 *  @param {Q.Event} onEnd event trigger when clip end time defined
 */
Q.Tool.define("Q/clip", function (options) {
	var tool = this;

	var p = Q.pipe(['stylesheet', 'text'], tool.refresh.bind(tool));
	
	Q.addStylesheet("{{Q}}/css/clip.css", p.fill('stylesheet'), { slotName: 'Q' });
	Q.Text.get('Q/content', function (err, text) {
		tool.text = text.clip;
		p.fill('text')();
	});
},

{ // default options here
	start: null,
	end: null,
	onStart: new Q.Event(),
	onEnd: new Q.Event()
},

{ // methods go here
	/**
	 * Refreshes the appearance of the tool completely
	 * @method refresh
	 */
	refresh: function () {
		var tool = this;
		var $toolElement = $(this.element);
		var state = tool.state;

		Q.Template.render('Q/clip', {
			startTimeString: tool.convertToString(state.start),
			endTimeString: tool.convertToString(state.end),
			startTimeMilliseconds: state.start,
			endTimeMilliseconds: state.end,
			startFixed: state.start !== null ? 'Q_clip_fixed' : '',
			endFixed: state.end !== null ? 'Q_clip_fixed' : '',
			text: tool.text
		}, function (err, html) {
			$toolElement.html(html);

			$("button", $toolElement).on(Q.Pointer.fastclick, function () {
				var $this = $(this);
				var name = $this.prop("name");
				// capitalize first letter
				name = name.charAt(0).toUpperCase() + name.slice(1);

				$this.toggleClass("Q_clip_fixed");

				if ($this.hasClass('Q_clip_fixed')) {
					var time = $(".Q_clip_time_milliseconds", $this).text();
					Q.handle(state["on" + name], tool, [time]);
				}
			});
		});
	},
	/**
	 * Set new time of start/end clip time
	 * @method setTime
	 * @param {int} time Time in milliseconds<commit_msg>Fixed Q/clip<commit_after>(function (window, Q, $, undefined) {
	
/**
 * @module Q
 */
	
/**
 * Render tool to select clip start/end time
 * @class Q clip
 * @constructor
 * @param {Object} [options] Override various options for this tool
 *  @param {String|Integer} [options.start] String in format hh:mm:ss or integeer seconds
 *  @param {String|Integer} [options.end] String in format hh:mm:ss or integeer seconds
 *  @param {Q.Event} onStart event trigger when clip start time defined
 *  @param {Q.Event} onEnd event trigger when clip end time defined
 */
Q.Tool.define("Q/clip", function (options) {
	var tool = this;

	var p = Q.pipe(['stylesheet', 'text'], tool.refresh.bind(tool));
	
	Q.addStylesheet("{{Q}}/css/clip.css", p.fill('stylesheet'), { slotName: 'Q' });
	Q.Text.get('Q/content', function (err, text) {
		tool.text = text.clip;
		p.fill('text')();
	});
},

{ // default options here
	start: null,
	end: null,
	onStart: new Q.Event(),
	onEnd: new Q.Event()
},

{ // methods go here
	/**
	 * Refreshes the appearance of the tool completely
	 * @method refresh
	 */
	refresh: function () {
		var tool = this;
		var $toolElement = $(this.element);
		var state = tool.state;

		Q.Template.render('Q/clip', {
			startTimeString: tool.convertToString(state.start),
			endTimeString: tool.convertToString(state.end),
			startTimeMilliseconds: state.start,
			endTimeMilliseconds: state.end,
			startFixed: state.start !== null ? 'Q_clip_fixed' : '',
			endFixed: state.end !== null ? 'Q_clip_fixed' : '',
			text: tool.text
		}, function (err, html) {
			$toolElement.html(html);

			$("button", $toolElement).on(Q.Pointer.fastclick, function () {
				var $this = $(this);
				var name = $this.prop("name");
				// capitalize first letter
				name = name.charAt(0).toUpperCase() + name.slice(1);

				$this.toggleClass("Q_clip_fixed");

				if ($this.hasClass('Q_clip_fixed')) {
					var time = $(".Q_clip_time_milliseconds", $this).text();
					Q.handle(state["on" + name], tool, [time]);
				} else {
					Q.handle(state["on" + name], tool, [null]);
				}
			});
		});
	},
	/**
	 * Set new time of start/end clip time
	 * @method setTime
	 * @param {int} time Time in milliseconds
{'fraction_non_alphanumeric': 0.17017341040462428, 'fraction_numerical': 0.0009248554913294797, 'mean_word_length': 3.6366559485530545, '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': '2875080', 'n_tokens_mistral': 1594, 'n_tokens_neox': 1442, 'n_words': 381}