<commit_before>var settingsToSave = ['tags'];
var checkboxesToSave = ['forceRating', 'ratingAsDefault', 'setSafe', 'setQuest', 'setExplicit', 'forceTags', 'addTags', 'title', 'asFiles', 'asFolder', 'onlyErrors'];
var myTags = ((GetCookie('tags') || '+') + (GetCookie('my_tags') || '+') + (GetCookie('recent_tags') || '+')).replace(/%2520/gi, ' ').replace(/%20|\++/gi, ' ').trim().split(/\s+/);
var bat = [], header = {};
var move = 'move', slash = '\\', extn = 'bat';

if (!~navigator.appVersion.indexOf("Win")) {
	move = 'mv'; slash = '/'; extn = 'sh';
	$$('#bat b')[0].textContent = '.sh';
}

if (myTags.length) {
	var tagsArea = $('my-tags'), tags = '';

	$show('mytags');
	$each(mkUniq(myTags), function (tag) {
		tags += '&nbsp;<a href="#' + tag + '">' + tag + '</a> ';
	});
	tagsArea.innerHTML = tags;

	tagsArea.onclick = function (evt) {
		if (evt.target.nodeName == 'A') {
			toggleTags(evt.target);
		}
		return false;
	};
}

document.title = 'Mass uploader';

// batch sorting of faulty images
$$('#bat > a')[0].onclick = function () {
	var a, blob;

	for (line in header) {
		bat.unshift(header[line]);
	}
	blob = new Blob([bat.join('\r\n')], {type: 'text/plain'});

	if (window.URL && window.URL.createObjectURL) {
		a = window.document.createElement('a');
		a.href = window.URL.createObjectURL(blob);
		a.download = 'parse errors.' + extn;

		document.body.appendChild(a);
		a.click();
		document.body.removeChild(a);
	} else {
		var reader = new window.FileReader();
		reader.readAsDataURL(blob);
		reader.onloadend = function () {
			base64data = reader.result.replace("data:;base64,", "");
			document.location.href = base64data;
		};
	}

};

function toggleTags(tagNode) {<commit_msg>have it actually work this time<commit_after>var settingsToSave = ['tags'];
var checkboxesToSave = ['forceRating', 'ratingAsDefault', 'setSafe', 'setQuest', 'setExplicit', 'forceTags', 'addTags', 'title', 'asFiles', 'asFolder', 'onlyErrors'];
var myTags = ((GetCookie('tags') || '+') + (GetCookie('my_tags') || '+') + (GetCookie('recent_tags') || '+')).replace(/%2520/gi, ' ').replace(/%20|\++/gi, ' ').trim().split(/\s+/);
var bat = [], header = {};
var move = 'move', slash = '\\', extn = 'bat';

if (!~navigator.appVersion.indexOf("Win")) {
	move = 'mv'; slash = '/'; extn = 'sh';
	$$('#bat b')[0].textContent = '.sh';
}

if (myTags.length) {
	var tagsArea = $('my-tags'), tags = '';

	$show('mytags');
	$each(mkUniq(myTags), function (tag) {
		tags += '&nbsp;<a href="#' + tag + '">' + tag + '</a> ';
	});
	tagsArea.innerHTML = tags;

	tagsArea.onclick = function (evt) {
		if (evt.target.nodeName == 'A') {
			toggleTags(evt.target);
		}
		return false;
	};
}

document.title = 'Mass uploader';

// batch sorting of faulty images
$$('#bat > a')[0].onclick = function () {
	var a, blob;

	for (line in header) {
		bat.unshift(header[line]);
	}
	blob = new Blob([bat.join('\r\n')], {type: 'application/octet-stream'});
	a = window.document.createElement('a');
	a.download = 'parse errors.' + extn;

	if (window.URL && window.URL.createObjectURL) {
		a.href = window.URL.createObjectURL(blob);

		document.body.appendChild(a);
		a.click();
		document.body.removeChild(a);
	} else {
		var reader = new window.FileReader();
		reader.readAsDataURL(blob);
		reader.onloadend = function () {
			a.href = reader.result;
			document.body.appendChild(a);
			a.click();
			document.body.removeChild(a);
		};
	}

};

function toggleTags(tagNode) {
{'fraction_non_alphanumeric': 0.23336239465271724, 'fraction_numerical': 0.006393490264458007, 'mean_word_length': 4.254961832061069, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1299043', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1260, 'n_words': 250}