<commit_before>/**
 * Image pasting madness
 * @constructor
 */
hui.ui.ImagePaster = function(options) {
	hui.log('New paster')
	this.options = options || {};
	this.element = hui.get(options.element);
	this.name = options.name;
	this.data = null;
	hui.ui.extend(this);
}

hui.ui.ImagePaster.create = function(options) {
	options = options || {};
	var e = options.element = hui.build('div',{className:'hui_imagepaster'});
	return new hui.ui.ImagePaster(options);
}

hui.ui.ImagePaster.supported = function() {
	var result = { 
		javaEnabled: false,
		version: ''
	};
	if (typeof navigator != 'undefined' && typeof navigator.javaEnabled != 'undefined') {
		result.javaEnabled = navigator.javaEnabled();
	} else {
		result.javaEnabled = 'unknown';
		if (navigator.javaEnabled() && typeof java != 'undefined') {
			result.version = java.lang.System.getProperty("java.version");
		}
	}
	return result;
}

hui.ui.ImagePaster.prototype = {
	_initialize : function() {
		hui.log('Initializing...');
		if (hui.browser.msie) {
			this.element.innerHTML = '<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="0" height="0" style="border-width:0;"  id="rup" name="rup" codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"><param name="archive" value="'+hui.ui.context+'/hui/lib/supa/Supa.jar"><param name="code" value="de.christophlinder.supa.SupaApplet"><param name="mayscript" value="yes"><param name="scriptable" value="true"><param name="name" value="jsapplet"><param name="encoding" value="base64"><param name="previewscaler" value="original size"></object>';
			this.applet = hui.firstByTag(this.element,'object');
		} else {
			this.applet = hui.build('applet',{
				archive : hui.ui.context+"/hui/lib/supa/Supa.jar",
				code : 'de.christophlinder.supa.SupaApplet',
				width : 0,
				height : 0,
				html : '<param name="imagecodec" value="png"><param name="encoding" value="base64"><param name="previewscaler" value="original size">',
				parent : this.element
			});
		}
		if (this.options.invisible) {<commit_msg>Added ability to check if pasting is supported<commit_after>/**
 * Image pasting madness
 * @constructor
 */
hui.ui.ImagePaster = function(options) {
	hui.log('New paster')
	this.options = options || {};
	this.element = hui.get(options.element);
	this.name = options.name;
	this.data = null;
	hui.ui.extend(this);
}

hui.ui.ImagePaster.create = function(options) {
	options = options || {};
	var e = options.element = hui.build('div',{className:'hui_imagepaster'});
	return new hui.ui.ImagePaster(options);
}

hui.ui.ImagePaster.supported = function() {
	if (!navigator) {
		return false;
	}
	return navigator.platform=='MacIntel';
	/*
	var result = { 
		javaEnabled: false,
		version: ''
	};
	if (typeof navigator != 'undefined' && typeof navigator.javaEnabled != 'undefined') {
		result.javaEnabled = navigator.javaEnabled();
	} else {
		result.javaEnabled = 'unknown';
		if (navigator.javaEnabled() && typeof java != 'undefined') {
			result.version = java.lang.System.getProperty("java.version");
		}
	}
	return result;*/
}

hui.ui.ImagePaster.prototype = {
	_initialize : function() {
		hui.log('Initializing...');
		if (hui.browser.msie) {
			this.element.innerHTML = '<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="0" height="0" style="border-width:0;"  id="rup" name="rup" codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"><param name="archive" value="'+hui.ui.context+'/hui/lib/supa/Supa.jar"><param name="code" value="de.christophlinder.supa.SupaApplet"><param name="mayscript" value="yes"><param name="scriptable" value="true"><param name="name" value="jsapplet"><param name="encoding" value="base64"><param name="previewscaler" value="original size"></object>';
			this.applet = hui.firstByTag(this.element,'object');
		} else {
			this.applet = hui.build('applet',{
				archive : hui.ui.context+"/hui/lib/supa/Supa.jar",
				code : 'de.christophlinder.supa.SupaApplet',
				width : 0,
				height : 0,
				html : '<param name="imagecodec" value="png"><param name="encoding" value="base64"><param name="previewscaler" value="original size">',
				parent : this.element
			});
		}
		if (this.options.invisible) {
{'fraction_non_alphanumeric': 0.1844137608237772, 'fraction_numerical': 0.019658319681722443, 'mean_word_length': 4.919667590027701, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '4187793', 'n_tokens_mistral': 1607, 'n_tokens_neox': 1486, 'n_words': 239}