<commit_before>class FormValidator {
	private kurahenPremium: KurahenPremium;

	constructor(KurachenPremium: KurahenPremium) {
		this.kurahenPremium = KurachenPremium;
		this.setSubmitAction();
	}

	setSubmitAction() {
		document.getElementById('submit').addEventListener("click", (ev) => {

			if (this.isPostTextFilled()) {
				ev.preventDefault();
				alert('Ale post to napisz');
				return;
			}

			if (this.isCaptchaFilled()) {
				ev.preventDefault();
				alert('Ale kapcze to wypełnij');
				return;
			}

			if (!this.kurahenPremium.isCurrentWebpageThread()) {
				if (this.isFileInputFilled() && !this.isNoFileChecked()) {
					if (confirm('Wysłać bez pliku?')) {
						this.setNoFile();
					}
					else {
						ev.preventDefault();
					}
				}
			}
		});
	}

	isPostTextFilled(): boolean {
		return (<HTMLTextAreaElement> document.getElementsByName("com")[0]).value === '';
	}

	isCaptchaFilled(): boolean {
		return (<HTMLInputElement> document.getElementById('captchaField')).value === '';
	}

	isFileInputFilled(): boolean {
		return (<HTMLInputElement> document.getElementById('postFile')).value === '';
	}

	isNoFileChecked():boolean {
		return (<HTMLInputElement>document.getElementById("nofile")).checked;
	}

	setNoFile() {
		(<HTMLInputElement>document.getElementById("nofile")).checked = true;
	}
}<commit_msg>Checking post length #59<commit_after>class FormValidator {
	private kurahenPremium: KurahenPremium;

	constructor(KurachenPremium: KurahenPremium) {
		this.kurahenPremium = KurachenPremium;
		this.setSubmitAction();
	}

	setSubmitAction() {
		document.getElementById('submit').addEventListener("click", (ev) => {

			if (this.isPostTextFilled()) {
				ev.preventDefault();
				alert('Ale post to napisz');
				return;
			}

			if (this.getPostTextLength() > 6000) {
				ev.preventDefault();
				alert('Zbyt długi post');
				return;
			}

			if (this.isCaptchaFilled()) {
				ev.preventDefault();
				alert('Ale kapcze to wypełnij');
				return;
			}

			if (!this.kurahenPremium.isCurrentWebpageThread()) {
				if (this.isFileInputFilled() && !this.isNoFileChecked()) {
					if (confirm('Wysłać bez pliku?')) {
						this.setNoFile();
					}
					else {
						ev.preventDefault();
					}
				}
			}
		});
	}

	isPostTextFilled(): boolean {
		return (<HTMLTextAreaElement> document.getElementsByName("com")[0]).value === '';
	}

	getPostTextLength(): number {
		return (<HTMLTextAreaElement> document.getElementsByName("com")[0]).value.length;
	}

	isCaptchaFilled(): boolean {
		return (<HTMLInputElement> document.getElementById('captchaField')).value === '';
	}

	isFileInputFilled(): boolean {
		return (<HTMLInputElement> document.getElementById('postFile')).value === '';
	}

	isNoFileChecked(): boolean {
		return (<HTMLInputElement>document.getElementById("nofile")).checked;
	}

	setNoFile() {
		(<HTMLInputElement>document.getElementById("nofile")).checked = true;
	}
}
{'fraction_non_alphanumeric': 0.15923129718599863, 'fraction_numerical': 0.0030885380919698007, 'mean_word_length': 4.280797101449275, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 17, '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': '3194055', 'n_tokens_mistral': 1148, 'n_tokens_neox': 954, 'n_words': 141}