<commit_before>(function() {
var AttachmentWidget = O5.widgets.BaseWidget.extend({

	className: "file-upload-widget",

	events: {},

	render: function() {
		var self = this;

		// Detect file-drag API
		if ('draggable' in document.createElement('div')) {
			this.$el.addClass('dragndrop');
		}
		else {
			this.$el.addClass('no-dragndrop');
		}

		// Init events
		this.$el.on('click', '.delete', function(e) {
			var url = $(e.target).closest('li').find('a.attachment').attr('href');
			self.remove(url);
			self.renderList();
		});
		this.$el.on('click', '.edit', function(e) {
			var url = $(e.target).closest('li').find('a.attachment').attr('href');
			var title = prompt(O5._t("Enter a new title"));
			if (title && title.length) {
				_.find(self.data, function(a) { return a.url === url; }).title = title;
			}
			self.renderList();
		});

		this.$el.html(JST.attachment_widget());
		this.$el.fileupload({
			dropZone: this.$el,
			done: function(e, data) {
				data.context.progress.remove();
				self.data.push(data.context.fileInfo);
				self.renderList();
				// If all files are uploaded, clear any validation errors
				if (self.validate() === true) self.trigger('change');
			},
			add: function(e, fileAddData) {
				var fname = fileAddData.files[0].name;
<commit_msg>Use correct name for validation func; fixes #94<commit_after>(function() {
var AttachmentWidget = O5.widgets.BaseWidget.extend({

	className: "file-upload-widget",

	events: {},

	render: function() {
		var self = this;

		// Detect file-drag API
		if ('draggable' in document.createElement('div')) {
			this.$el.addClass('dragndrop');
		}
		else {
			this.$el.addClass('no-dragndrop');
		}

		// Init events
		this.$el.on('click', '.delete', function(e) {
			var url = $(e.target).closest('li').find('a.attachment').attr('href');
			self.remove(url);
			self.renderList();
		});
		this.$el.on('click', '.edit', function(e) {
			var url = $(e.target).closest('li').find('a.attachment').attr('href');
			var title = prompt(O5._t("Enter a new title"));
			if (title && title.length) {
				_.find(self.data, function(a) { return a.url === url; }).title = title;
			}
			self.renderList();
		});

		this.$el.html(JST.attachment_widget());
		this.$el.fileupload({
			dropZone: this.$el,
			done: function(e, data) {
				data.context.progress.remove();
				self.data.push(data.context.fileInfo);
				self.renderList();
				// If all files are uploaded, clear any validation errors
				if (self.checkValidation() === true) self.trigger('change');
			},
			add: function(e, fileAddData) {
				var fname = fileAddData.files[0].name;

{'fraction_non_alphanumeric': 0.19792865362485615, 'fraction_numerical': 0.0030686612965093976, 'mean_word_length': 3.591549295774648, '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': '4106293', 'n_tokens_mistral': 1017, 'n_tokens_neox': 874, 'n_words': 175}