<commit_before>// folder-view.js

(function($){
	try {
		if (window.sessionStorage) {
			sessionStorage.setItem("LastFolder", location.href);
			localStorage.setItem("LastFolder", location.href);
		}
	} catch (e) {
		// ignore
	}
	function createTextCell(text, url, type, src) {
		if (!src) {
			src = '/callimachus/images/rdf-icon.png';
		}
		var td = $('<td/>');
		td.addClass('ui-widget-content');
		td.addClass('filecell');
		var a = $('<a/>');
		if (url) {
			a.attr('href', url);
			a.addClass('view');
			if (type) {
				a.attr('type', type);
			}
		}
		a.text(text);
		var img = $('<img/>');
		img.addClass('icon');
		img.attr('src', src);
		a.prepend(img);
		td.append(a);
		return td;
	}
	function createTimeCell(text) {
		var td = $('<td/>');
		td.addClass('ui-widget-content');
		td.addClass('timecell');
		if (text) {
			var time = $('<time/>');
			time.addClass("abbreviated");
			time.text(text);
			td.append(time);
		}
		return td;
	}
	function createPermissionCell(entry, tagName) {
		var td = $('<td/>');
		td.addClass('ui-widget-content');
		td.addClass('permission');
		var tags = entry.children().filter(function(){return this.tagName==tagName});
		tags.each(function() {
			var uri = $(this).children('uri').text();
			var name = $(this).children('name').text();
			var a = $('<a/>');
			if (uri) {
				a.attr('href', uri);
			}
			if (name) {
				a.text(name);
			} else {
				a.text(uri);
			}
			td.append(' ');
			td.append(a);
		});
		return td;
	}
	function reload() {
		var url = $('link[type="application/atom+xml"]').attr('href');
		jQuery.get(url, function(doc) {
			jQuery(function() {
				var feed = $(doc).children('feed');
				var totalResults = feed.children().filter(function(){return this.tagName=='openSearch:totalResults'}).text();
				$('#totalResults').text(totalResults);
				var tbody = $('<tbody/>');
				tbody.attr('id', 'tfiles');
				var totalEntries = 0;
				feed.children('entry').each(function() {
					var entry = $(this);
					totalEntries++;
					if (!entry.children('link[type="application/atom+xml"]').length) {
						var tr = $('<tr/>');
						var icon = entry.children('icon').text();
						var title = entry.children('title').text();
						var content = entry.children('content');
						var src = content.attr('src');
						var type = content.attr('type');
						tr.append(createTextCell(title, src, type, icon));
						tr.append(createTimeCell(entry.children('updated').text()));
						tr.append(createPermissionCell(entry, 'calli:reader'));
						tr.append(createPermissionCell(entry, 'contributor'));
						tr.append(createPermissionCell(entry, 'calli:editor'));
						tr.append(createPermissionCell(entry, 'calli:administrator'));
						tbody.append(tr);
					}
				});
				var box = $('#box')[0];
				var bottom = box.scrollTop > 0 && box.scrollTop >= box.scrollHeight - box.clientHeight;
				$('#tfiles').replaceWith(tbody);
				$('#totalEntries').text(totalEntries);
				if (bottom) {
					box.scrollTop = box.scrollHeight - box.clientHeight;
				}
			});
		});
	}
	reload();
	var queueStarted = null;
	var queueTotalSize = 0;
	var queueCompleteSize = 0;
	var upload_queue = [];
	function queue(file) {
		if (!queueStarted) {
			queueStarted = new Date();
		}
		queueTotalSize += file.size;
		upload_queue.push(function() {
			upload(file, function(){
				upload_queue.shift();
				queueCompleteSize += file.size;
				uploadProgress(0);
				if (upload_queue.length > 0) {
					upload_queue[0]();
				} else {
					queueStarted = null;
					queueTotalSize = 0;
					queueCompleteSize = 0;
					notifyProgressComplete();
				}
			});
		});<commit_msg>Reparse atom+xml result for IE8<commit_after>// folder-view.js

(function($){
	try {
		if (window.sessionStorage) {
			sessionStorage.setItem("LastFolder", location.href);
			localStorage.setItem("LastFolder", location.href);
		}
	} catch (e) {
		// ignore
	}
	function createTextCell(text, url, type, src) {
		if (!src) {
			src = '/callimachus/images/rdf-icon.png';
		}
		var td = $('<td/>');
		td.addClass('ui-widget-content');
		td.addClass('filecell');
		var a = $('<a/>');
		if (url) {
			a.attr('href', url);
			a.addClass('view');
			if (type) {
				a.attr('type', type);
			}
		}
		a.text(text);
		var img = $('<img/>');
		img.addClass('icon');
		img.attr('src', src);
		a.prepend(img);
		td.append(a);
		return td;
	}
	function createTimeCell(text) {
		var td = $('<td/>');
		td.addClass('ui-widget-content');
		td.addClass('timecell');
		if (text) {
			var time = $('<time/>');
			time.addClass("abbreviated");
			time.text(text);
			td.append(time);
		}
		return td;
	}
	function createPermissionCell(entry, tagName) {
		var td = $('<td/>');
		td.addClass('ui-widget-content');
		td.addClass('permission');
		var tags = entry.children().filter(function(){return this.tagName==tagName});
		tags.each(function() {
			var uri = $(this).children('uri').text();
			var name = $(this).children('name').text();
			var a = $('<a/>');
			if (uri) {
				a.attr('href', uri);
			}
			if (name) {
				a.text(name);
			} else {
				a.text(uri);
			}
			td.append(' ');
			td.append(a);
		});
		return td;
	}
	function reload() {
		var url = $('link[type="application/atom+xml"]').attr('href');
		jQuery.ajax({
			url: url,
			processData: false,
			complete: function(xhr) {
				var doc = xhr.responseXML;
				if (doc && !doc.childNodes.length && window.ActiveXObject) {
					var doc = new ActiveXObject("Microsoft.XMLDOM");
					doc.async = false;
					doc.loadXML(xhr.responseText);
				}
				if (doc) jQuery(function() {
					var feed = $(doc).children('feed');
					var totalResults = feed.children().filter(function(){return this.tagName=='openSearch:totalResults'}).text();
					$('#totalResults').text(totalResults);
					var tbody = $('<tbody/>');
					tbody.attr('id', 'tfiles');
					var totalEntries = 0;
					feed.children('entry').each(function() {
						var entry = $(this);
						totalEntries++;
						if (!entry.children('link[type="application/atom+xml"]').length) {
							var tr = $('<tr/>');
							var icon = entry.children('icon').text();
							var title = entry.children('title').text();
							var content = entry.children('content');
							var src = content.attr('src');
							var type = content.attr('type');
							tr.append(createTextCell(title, src, type, icon));
							tr.append(createTimeCell(entry.children('updated').text()));
							tr.append(createPermissionCell(entry, 'calli:reader'));
							tr.append(createPermissionCell(entry, 'contributor'));
							tr.append(createPermissionCell(entry, 'calli:editor'));
							tr.append(createPermissionCell(entry, 'calli:administrator'));
							tbody.append(tr);
						}
					});
					var box = $('#box')[0];
					var bottom = box.scrollTop > 0 && box.scrollTop >= box.scrollHeight - box.clientHeight;
					$('#tfiles').replaceWith(tbody);
					$('#totalEntries').text(totalEntries);
					if (bottom) {
						box.scrollTop = box.scrollHeight - box.clientHeight;
					}
				});
			}
		});
	}
	reload();
	var queueStarted = null;
	var queueTotalSize = 0;
	var queueCompleteSize = 0;
	var upload_queue = [];
	function queue(file) {
		if (!queueStarted) {
			queueStarted = new Date();
		}
		queueTotalSize += file.size;
		upload_queue.push(function() {
			upload(file, function(){
				upload_queue.shift();
				queueCompleteSize += file.size;
				uploadProgress(0);
				if (upload_queue.length > 0) {
					upload_queue[0]();
				} else {
					queueStarted = null;
					queueTotalSize = 0;
					queueCompleteSize = 0;
					notifyProgressComplete();
				}
			});
		});
{'fraction_non_alphanumeric': 0.197672881131826, 'fraction_numerical': 0.002776675922253074, 'mean_word_length': 3.3001705514496873, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 5}, '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': '1358107', 'n_tokens_mistral': 3154, 'n_tokens_neox': 2534, 'n_words': 469}