<commit_before>
Ui.Element.extend('Ui.Entry', 
/**@lends Ui.Entry#*/
{
//	entryDrawing: undefined,
	fontSize: 14,
	fontFamily: 'Sans-serif',
	fontWeight: 'normal',
	color: 'black',
	value: '',
	passwordMode: false,
	isDown: false,
	mouseStartX: undefined,
	mouseStartY: undefined,
	touchStartX: undefined,
	touchStartY: undefined,
	allowSelect: false,
	timer: undefined,

	/**
	 * @constructs
	 * @class
	 * @extends Ui.Element
	 */
	constructor: function(config) {
		this.addEvents('press', 'down', 'up', 'change', 'validate');
		this.setSelectable(true);
		this.setFocusable(true);

		// handle mouse
		this.connect(this.getDrawing(), 'mousedown', this.onMouseDown);

		// handle touches
//		this.connect(this.getDrawing(), 'fingerdown', this.onFingerDown);

		// handle touches
		this.connect(this.getDrawing(), 'touchstart', this.onTouchStart);
//		this.connect(this.getDrawing(), 'touchmove', this.onTouchMove);
//		this.connect(this.getDrawing(), 'touchend', this.onTouchEnd);

		// handle change
		this.connect(this.getDrawing(), 'change', this.onChange);

		// handle paste
		this.connect(this.getDrawing(), 'paste', this.onPaste);

		// handle keyboard
		this.connect(this.getDrawing(), 'keyup', this.onKeyUp);
		this.connect(this.getDrawing(), 'keydown', this.onKeyDown);
	},

	setPasswordMode: function(passwordMode) {
		if(this.passwordMode != passwordMode) {
			this.passwordMode = passwordMode;
			try {
				if(this.passwordMode)
					this.entryDrawing.setAttribute('type', 'password');
				else
					this.entryDrawing.setAttribute('type', 'text');
			} catch(exception) {
				// IE < 9 dont support to change type after insert in the DOM
				var clone = this.entryDrawing.cloneNode(false);
				if(this.passwordMode)
					clone.setAttribute('type', 'password');
				else
					clone.setAttribute('type', 'text');
				this.entryDrawing.parentNode.replaceChild(clone, this.entryDrawing);
				this.entryDrawing = clone;
				this.drawing = this.entryDrawing;
				this.invalidateArrange();
			}
		}
	},

	setFontSize: function(fontSize) {
		if(this.fontSize != fontSize) {
			this.fontSize = fontSize;
			this.entryDrawing.style.fontSize = this.fontSize+'px';
			this.invalidateMeasure();
		}
	},

	getFontSize: function() {
		return this.fontSize;
	},

	setFontFamily: function(fontFamily) {
		if(this.fontFamily != fontFamily) {
			this.fontFamily = fontFamily;
			this.entryDrawing.style.fontFamily = this.fontFamily;
			this.invalidateMeasure();
		}
	},

	getFontFamily: function() {
		return this.fontFamily;
	},

	setFontWeight: function(fontWeight) {
		if(this.fontWeight != fontWeight) {
			this.fontWeight = fontWeight;
			this.entryDrawing.style.fontWeight = this.fontWeight;
			this.invalidateMeasure();
		}
	},

	getFontWeight: function() {
		return this.fontWeight;
	},

	setColor: function(color) {
		if(this.color != color) {
			this.color = color;
			this.entryDrawing.style.color = this.color;
		}
	},

	getColor: function() {
		return this.color;
	},

	getValue: function() {
		return this.value;
	},

	setValue: function(value) {
		if(value === undefined)
			value = '';
		this.value = value;
		this.entryDrawing.value = this.value;
	},

	getIsDown: function() {
		return this.isDown;
	},

	/**#@+
	 * @private
	 */

	onMouseDown: function(event) {
		console.log('onMouseDown');
		if(this.getHasFocus()) {
			event.stopPropagation();
			return;
		}

		if((event.button != 0) || this.getIsDisabled())
			return;<commit_msg>remove a log<commit_after>
Ui.Element.extend('Ui.Entry', 
/**@lends Ui.Entry#*/
{
//	entryDrawing: undefined,
	fontSize: 14,
	fontFamily: 'Sans-serif',
	fontWeight: 'normal',
	color: 'black',
	value: '',
	passwordMode: false,
	isDown: false,
	mouseStartX: undefined,
	mouseStartY: undefined,
	touchStartX: undefined,
	touchStartY: undefined,
	allowSelect: false,
	timer: undefined,

	/**
	 * @constructs
	 * @class
	 * @extends Ui.Element
	 */
	constructor: function(config) {
		this.addEvents('press', 'down', 'up', 'change', 'validate');
		this.setSelectable(true);
		this.setFocusable(true);

		// handle mouse
		this.connect(this.getDrawing(), 'mousedown', this.onMouseDown);

		// handle touches
//		this.connect(this.getDrawing(), 'fingerdown', this.onFingerDown);

		// handle touches
		this.connect(this.getDrawing(), 'touchstart', this.onTouchStart);
//		this.connect(this.getDrawing(), 'touchmove', this.onTouchMove);
//		this.connect(this.getDrawing(), 'touchend', this.onTouchEnd);

		// handle change
		this.connect(this.getDrawing(), 'change', this.onChange);

		// handle paste
		this.connect(this.getDrawing(), 'paste', this.onPaste);

		// handle keyboard
		this.connect(this.getDrawing(), 'keyup', this.onKeyUp);
		this.connect(this.getDrawing(), 'keydown', this.onKeyDown);
	},

	setPasswordMode: function(passwordMode) {
		if(this.passwordMode != passwordMode) {
			this.passwordMode = passwordMode;
			try {
				if(this.passwordMode)
					this.entryDrawing.setAttribute('type', 'password');
				else
					this.entryDrawing.setAttribute('type', 'text');
			} catch(exception) {
				// IE < 9 dont support to change type after insert in the DOM
				var clone = this.entryDrawing.cloneNode(false);
				if(this.passwordMode)
					clone.setAttribute('type', 'password');
				else
					clone.setAttribute('type', 'text');
				this.entryDrawing.parentNode.replaceChild(clone, this.entryDrawing);
				this.entryDrawing = clone;
				this.drawing = this.entryDrawing;
				this.invalidateArrange();
			}
		}
	},

	setFontSize: function(fontSize) {
		if(this.fontSize != fontSize) {
			this.fontSize = fontSize;
			this.entryDrawing.style.fontSize = this.fontSize+'px';
			this.invalidateMeasure();
		}
	},

	getFontSize: function() {
		return this.fontSize;
	},

	setFontFamily: function(fontFamily) {
		if(this.fontFamily != fontFamily) {
			this.fontFamily = fontFamily;
			this.entryDrawing.style.fontFamily = this.fontFamily;
			this.invalidateMeasure();
		}
	},

	getFontFamily: function() {
		return this.fontFamily;
	},

	setFontWeight: function(fontWeight) {
		if(this.fontWeight != fontWeight) {
			this.fontWeight = fontWeight;
			this.entryDrawing.style.fontWeight = this.fontWeight;
			this.invalidateMeasure();
		}
	},

	getFontWeight: function() {
		return this.fontWeight;
	},

	setColor: function(color) {
		if(this.color != color) {
			this.color = color;
			this.entryDrawing.style.color = this.color;
		}
	},

	getColor: function() {
		return this.color;
	},

	getValue: function() {
		return this.value;
	},

	setValue: function(value) {
		if(value === undefined)
			value = '';
		this.value = value;
		this.entryDrawing.value = this.value;
	},

	getIsDown: function() {
		return this.isDown;
	},

	/**#@+
	 * @private
	 */

	onMouseDown: function(event) {
		if(this.getHasFocus()) {
			event.stopPropagation();
			return;
		}

		if((event.button != 0) || this.getIsDisabled())
			return;
{'fraction_non_alphanumeric': 0.1566914227464686, 'fraction_numerical': 0.001164991990680064, 'mean_word_length': 3.9732078204199857, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1016300', 'n_tokens_mistral': 2590, 'n_tokens_neox': 2289, 'n_words': 408}