<commit_before>popup = function(title1, title) {
	window.open (title1, title, config='height=700, width=600, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no')
}
// override at will

notify = function(message, type) {
	alert(type + ": " + message)
}
// You can override notify later, with your own notification system

var Upload = {
	files_queued: 0,
	file_dialog_complete: function(num_selected, num_queued)
	{
		// SwfUpload doesn't order uploads by name out of the box...
		this.sorted_queue = [];
		this.index = 0;
		if (num_queued > 0)	{
			file_queue = [];
			global_index = 0;
			index = 0;
			do {
				file = this.callFlash("GetFileByIndex", [global_index]);
				if(file != null && file.filestatus == -1) {
					file_queue[index] = file;
					index++;
				}
				global_index++;
			} while (file != null);
			this.sorted_queue = file_queue.sort(function(a,b){
				if(b.name < a.name){return (1)}
			})
			self = this;
			jQuery(this.sorted_queue).each( function(index, file) {
				li = jQuery('<li></li>').attr({ 'id': file.id, 'class': 'swfupload' });
				li.append(jQuery('<span></span>').attr('class', 'name').html(file.name.substring(0, 10) + '...'));
				li.append(jQuery('<span></span>').attr('class', 'status').html(SWFUPLOAD_PENDING));
				li.append(jQuery('<span></span>').attr('class', 'progress').append('<span></span>'));

				if(self.settings.file_queue_limit == 1) {
					jQuery("#" + self.settings.upload_id).html(li);
				} else {
					jQuery("#" + self.settings.upload_id).append(li);
				}
			})
			this.startUpload(this.sorted_queue[this.index++].id);
		}
	},
	
	upload_start: function(file)
	{
		jQuery('#' + file.id + ' .status').html(SWFUPLOAD_LOADING);
	},
	upload_progress: function(file, bytes, total)
	{
		percent = Math.ceil((bytes / total) * 100);
		jQuery('#' + file.id + ' .progress span').width(percent + '%');
	},
	upload_error: function(file, code, message)
	{
		notify(SWFUPLOAD_ERROR + " " + file.name + " (" + message + " [" + code + "])", "error");
		jQuery('#' + file.id).remove();
	},
	upload_success: function(file, data)
	{
		if(jQuery(data).length == 0) {
			notify(data, "warning");
			jQuery('#' + file.id).remove();
		} else {
			jQuery('#' + file.id).replaceWith(jQuery(data));
		}
	},
	upload_complete: function(file)
	{
		Upload.files_queued -= 1;
		if(this.sorted_queue[this.index]) { 
			this.startUpload(this.sorted_queue[this.index++].id)
		}
	},
	file_queue_error: function(file, error_code, message) {
		upload_error(file, error_code, message)
	}
}<commit_msg>how to use jGrowl, Shadowbox or Facebox with papermill<commit_after>popup = function(title1, title) {
	window.open (title1, title, config='height=700, width=600, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no')
}


/*
If you have a popup library, override popup

* e.g. facebox : 

popup = function(url) {
	jQuery.facebox(function() {
	  jQuery.get(url, function(data) {
	    jQuery.facebox(data)
	  })
	})
	return false;
}

* e.g. Shadowbox : 

popup = function(url) {
	if(url) {
		Shadowbox.open({ 
	  	content:    url,
	    player:     "iframe",
			width: 			1280,
			height: 		768
	  });
	}
	return false;
}
*/

notify = function(message, type) {
	alert(type + ": " + message)
}
/*
If you have a notification library, override notify

* e.g. jGrowl : 

notify = function(message, type) {
	if(type == "notice") { jQuery.noticeAdd({ text: message, stayTime: 4000, stay: false, type: type }) }
	if(type == "warning") {	jQuery.noticeAdd({ text: message, stayTime: 9000, stay: false, type: type }) }
	if(type == "error") {	jQuery.noticeAdd({ text: message, stayTime: 20000, stay: false, type: type }) }
}

*/

var Upload = {
	files_queued: 0,
	file_dialog_complete: function(num_selected, num_queued)
	{
		// SwfUpload doesn't order uploads by name out of the box...
		this.sorted_queue = [];
		this.index = 0;
		if (num_queued > 0)	{
			file_queue = [];
			global_index = 0;
			index = 0;
			do {
				file = this.callFlash("GetFileByIndex", [global_index]);
				if(file != null && file.filestatus == -1) {
					file_queue[index] = file;
					index++;
				}
				global_index++;
			} while (file != null);
			this.sorted_queue = file_queue.sort(function(a,b){
				if(b.name < a.name){return (1)}
			})
			self = this;
			jQuery(this.sorted_queue).each( function(index, file) {
				li = jQuery('<li></li>').attr({ 'id': file.id, 'class': 'swfupload' });
				li.append(jQuery('<span></span>').attr('class', 'name').html(file.name.substring(0, 10) + '...'));
				li.append(jQuery('<span></span>').attr('class', 'status').html(SWFUPLOAD_PENDING));
				li.append(jQuery('<span></span>').attr('class', 'progress').append('<span></span>'));

				if(self.settings.file_queue_limit == 1) {
					jQuery("#" + self.settings.upload_id).html(li);
				} else {
					jQuery("#" + self.settings.upload_id).append(li);
				}
			})
			this.startUpload(this.sorted_queue[this.index++].id);
		}
	},
	
	upload_start: function(file)
	{
		jQuery('#' + file.id + ' .status').html(SWFUPLOAD_LOADING);
	},
	upload_progress: function(file, bytes, total)
	{
		percent = Math.ceil((bytes / total) * 100);
		jQuery('#' + file.id + ' .progress span').width(percent + '%');
	},
	upload_error: function(file, code, message)
	{
		notify(SWFUPLOAD_ERROR + " " + file.name + " (" + message + " [" + code + "])", "error");
		jQuery('#' + file.id).remove();
	},
	upload_success: function(file, data)
	{
		if(jQuery(data).length == 0) {
			notify(data, "warning");
			jQuery('#' + file.id).remove();
		} else {
			jQuery('#' + file.id).replaceWith(jQuery(data));
		}
	},
	upload_complete: function(file)
	{
		Upload.files_queued -= 1;
		if(this.sorted_queue[this.index]) { 
			this.startUpload(this.sorted_queue[this.index++].id)
		}
	},
	file_queue_error: function(file, error_code, message) {
		upload_error(file, error_code, message)
	}
}
{'fraction_non_alphanumeric': 0.19563747040919852, 'fraction_numerical': 0.011498140006763611, 'mean_word_length': 3.8404255319148937, 'pattern_counts': {'":': 2, '<': 25, '<?xml version=': 0, '>': 25, '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': '7126612', 'n_tokens_mistral': 2424, 'n_tokens_neox': 2147, 'n_words': 395}