<commit_before>
var loadEventTable = function(event, cb){

	var eventItem = $('<li />').addClass('list-group-item').css('font-size', '12px');
	eventItem.append($('<div />').html(event.title).css('border-bottom', '1px solid #EEE'));
	var timeStr =  moment(event.start).format('hh:mm A') + '-' + moment(event.end).format('hh:mm A');
	eventItem.append($('<div />').html(timeStr));
	

	if (typeof cb === 'function')
		cb(eventItem);
}

var renderSpecialEvents = function(events){
	for (var i = 0; i < events.length; i++){
		loadEventTable(events[i], function(eventTable){
			$(".eventsList").prepend(eventTable)
		});
	}
}

var renderSpecialEventsWidget = function(){

	var panel = $("<div />").width("300px").height('200px').css('overflow', 'auto').css('margin-top', '10px');
	panel.addClass("panel panel-default");
	var eventsList = $("<ul />").addClass("eventsList").addClass('list-group ')
	panel.append(eventsList);

	$.getJSON('http://ims-dev.wesleyan.edu:8080/api/events?minutes=5000')
		.success(renderSpecialEvents)
		.error(function(err){
        	console.log(err);
    });

	$('.Widgets').append(panel);
}<commit_msg> Working on special events list<commit_after>
var loadEventTable = function(event, cb){

	var eventItem = $('<li />').addClass('list-group-item').css('font-size', '12px');
	eventItem.append($('<div />').html(event.title).css('border-bottom', '1px solid #aaa'));

	var timeDiv = $('<div />');
	timeDiv.append('<b>' + moment(event.start).format('hh:mm A') + '</b> ');
	timeDiv.append('<i>' + moment(event.eventStart).format('hh:mm A') + '</i>');
	timeDiv.append(' <i class="fa fa-long-arrow-right"></i> ');
	timeDiv.append('<i>' + moment(event.eventEnd).format('hh:mm A') + '</i> ');
	timeDiv.append('<b>' + moment(event.end).format('hh:mm A') + '</b>');

	eventItem.append(timeDiv);

	if (event.cancelled){
		eventItem.css('background-color', '#FFABAB');
	}

	eventItem.hover(function(){$(this).css('background-color', '#eee');}, 
					function(){$(this).css('background-color', '#fff')});
		

	if (typeof cb === 'function')
		cb(eventItem);
}

var renderSpecialEvents = function(events){
	for (var i = 0; i < events.length; i++){
		loadEventTable(events[i], function(eventTable){
			$(".eventsList").prepend(eventTable)
		});
	}
}

var renderSpecialEventsWidget = function(){

	var panel = $("<div />").width("300px").height('200px').css('overflow', 'auto').css('margin-top', '10px');
	panel.addClass("panel panel-default");
	var eventsList = $("<ul />").addClass("eventsList").addClass('list-group ')
	panel.append(eventsList);

	$.getJSON('http://ims-dev.wesleyan.edu:8080/api/events?minutes=20000')
		.success(renderSpecialEvents)
		.error(function(err){
        	console.log(err);
    });

	$('.Widgets').append(panel);
}
{'fraction_non_alphanumeric': 0.24190614769006913, 'fraction_numerical': 0.014914514368861403, 'mean_word_length': 5.235827664399093, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 23, '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': '2133835', 'n_tokens_mistral': 1003, 'n_tokens_neox': 937, 'n_words': 153}