<commit_before>/**
 * @author Tom
 */

function StyledItem(attributes, content) {
	this.attributes = attributes;
	this.content = content;
}


Widget.t = function(id) {
	return id;
};

/**
 * Option template
 * @param {WatchPair, Object} item
 * @return {XElement} option
 */
Widget.option = function(item) {
	var option = Html.option();
	if (item.WatchPair) {
		$B(option, item);
		$B(option.accessor("value"), item.key);
		$B(option.accessor("selected"), item.selected);
		$B(option.accessor("disabled"), item.disabled);
	} else {
		option.setAttribute("value", item);
		option.set(item);
	}
	return option;
};

/**
 * Command template
 * @param {Function} command
 * @param {XElement} target
 * @return {String} caption
 */
Widget.clickable = function(command, target) {
	invoke(target.stopClickable);
	target.stopClickable = target.observeClick(function() {
		command();
		return false;
	});
	if (target.getTag() == "a") {
		target.setAttribute("href", "#");
	}
	return command.caption;
};

/**
 * Return IMG
 * @param {String} url
 * @param {String} text
 * @return {XElement} IMG
 */
Widget.image = function(url, text) {
	return Html.img({
		alt: text,
		src: url
	});	
};

/**
 * Create object
 * @param {MimeType} type
 * @param {Object} params
 * @param {Number, String} width
 * @param {Number, String} height
 * @return {XElement}
 */
Widget.object = function(type, params, width, height) {<commit_msg>[IMP] Presentation: Event to Widget.link's command<commit_after>/**
 * @author Tom
 */

function StyledItem(attributes, content) {
	this.attributes = attributes;
	this.content = content;
}


Widget.t = function(id) {
	return id;
};

/**
 * Option template
 * @param {WatchPair, Object} item
 * @return {XElement} option
 */
Widget.option = function(item) {
	var option = Html.option();
	if (item.WatchPair) {
		$B(option, item);
		$B(option.accessor("value"), item.key);
		$B(option.accessor("selected"), item.selected);
		$B(option.accessor("disabled"), item.disabled);
	} else {
		option.setAttribute("value", item);
		option.set(item);
	}
	return option;
};

/**
 * Command template
 * @param {Function} command
 * @param {XElement} target
 * @return {String} caption
 */
Widget.clickable = function(command, target) {
	invoke(target.stopClickable);
	target.stopClickable = target.observeClick(function(event) {
		command(event);
		return false;
	});
	if (target.getTag() == "a") {
		target.setAttribute("href", "#");
	}
	return command.caption;
};

/**
 * Return IMG
 * @param {String} url
 * @param {String} text
 * @return {XElement} IMG
 */
Widget.image = function(url, text) {
	return Html.img({
		alt: text,
		src: url
	});	
};

/**
 * Create object
 * @param {MimeType} type
 * @param {Object} params
 * @param {Number, String} width
 * @param {Number, String} height
 * @return {XElement}
 */
Widget.object = function(type, params, width, height) {
{'fraction_non_alphanumeric': 0.17659352142110762, 'fraction_numerical': 0.0, 'mean_word_length': 4.193490054249548, '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': '6741884', 'n_tokens_mistral': 1004, 'n_tokens_neox': 978, 'n_words': 231}