<commit_before>function changePopupColor(event) { //changes the events object
	$("#popupTitleButton").removeClass("btn-success btn-inverse btn-warning btn-danger");
	if(event.valid == false) {
			$("#popupTitleButton").addClass("btn-inverse");
		} else if(event.staffAdded == 0) {
			$("#popupTitleButton").addClass("btn-danger");
		}
		else if(event.staffAdded < event.staffNeeded) {
			$("#popupTitleButton").addClass("btn-warning");
		} else if(event.staffAdded == event.staffNeeded) {
			$("#popupTitleButton").addClass("btn-success");
	}
}

$('#eventButton').click(function(e) {
	$('#eventButton').addClass('disabled');
	$('#popup').modalPopover('hide');
});

$('.modal').on('show', function () {
  $('#popup').css('opacity', 0.7);
}).on('hide', function () {
  $('#popup').css('opacity', 1);
});

resizeMap = function () {
		var column_height = $(window).height();
		$('#calendar').fullCalendar('option', 'height', column_height - 40);
		//$("#calendar").css("height", + "px")
	};



function setTimeline(view) { //this is borrowed from stackoverflow
    var parentDiv = jQuery(".fc-agenda-slots:visible").parent();
    var timeline = parentDiv.children(".timeline");
    if (timeline.length == 0) { //if timeline isn't there, add it
        timeline = jQuery("<hr>").addClass("timeline");
        parentDiv.prepend(timeline);
    }
    var curTime = new Date();
    var curCalView = jQuery("#calendar").fullCalendar('getView');
    if (curCalView.visStart < curTime && curCalView.visEnd > curTime) {
        timeline.show();
    } else {
        timeline.hide();
        return;
    }
    var curSeconds = (curTime.getHours() * 60 * 60) + (curTime.getMinutes() * 60) + curTime.getSeconds();
    var percentOfDay = curSeconds / 86400; //24 * 60 * 60 = 86400, # of seconds in a day
    var topLoc = Math.floor(parentDiv.height() * percentOfDay);
    timeline.css("top", topLoc + "px");
    if (curCalView.name == "agendaWeek") { //week view, don't want the timeline to go the whole way across
        var dayCol = jQuery(".fc-today:visible");
        var left = dayCol.position().left + 1;
        var width = dayCol.width()-2;
        timeline.css({
            left: left + "px",
            width: width + "px"
        });
    }
}

Array.prototype.removeItem = function(a) {
            for (i = 0; i < this.length; i++) {
                if (this[i] == a) {
                    for (i2 = i; i2 < this.length - 1; i2++) {
                        this[i2] = this[i2 + 1];
                    }
                    this.length = this.length - 1
                    return;
                }
            }
        }

function dropdownActiveFix() {
	$('a').removeClass('drop-active');
	$('a[href="#' + Backbone.history.fragment + '"]').addClass('drop-active');

}


// The functions above are mostly done
var lastClick, lastRightClick;

// BACKBONE.JS ROUTER SECTION
var AppRouter = Backbone.Router.extend({
  routes: {
  	"printToday": "printToday",
    "recentVideo": "recentVideo",
    "*filter": "all"
  }
});


//User info must be imported for this part
var username = 'ckorkut';
      
var app = new AppRouter;

app.on('route:printToday', function() {
  	console.log('printToday');
});
app.on('route:recentVideo', function() {
  	console.log('recentVideo');
});

app.on('route:all', function(filter) {
	dropdownActiveFix();
	if(filter == null) {
		//Show all of events
		$('#calendar').fullCalendar('clientEvents', function(event) {
			event.className.removeItem('hide');
			$('#calendar').fullCalendar('updateEvent', event);
		});
		console.log('all');

	} else if(filter == 'hideCancelled') {
		
		$('#calendar').fullCalendar('clientEvents', function(event) {
			event.className.removeItem('hide');
			if(event.valid == false) {
				event.className.push('hide');
			}
			$('#calendar').fullCalendar('updateEvent', event);
		});
		console.log(filter);
	} else if(filter == 'unstaffed') {
		$('#calendar').fullCalendar('clientEvents', function(event) {
			event.className.removeItem('hide');
			if(event.staffAdded == event.staffNeeded || event.valid == false) {
				event.className.push('hide');
			}
			$('#calendar').fullCalendar('updateEvent', event);
		});
		console.log(filter);
	} else if(filter == 'onlyMine') {
		$('#calendar').fullCalendar('clientEvents', function(event) {
			event.className.removeItem('hide');
			if(event.people.indexOf(username) == -1) {
				event.className.push('hide');
			}
			$('#calendar').fullCalendar('updateEvent', event);
		});
		console.log(filter);
	}
});

Backbone.history.start();

var lastClickedEvent;
$('a[href="#split"]').click(function(e) {
	//Split window update should be done here
	$('.eventName').html(lastClickedEvent.title);
});
$('a[href="#staffEvent"]').click(function(e) {
	//Staff window update should be done here
	$('.eventName').html(lastClickedEvent.title);
});


// Solves Bootstrap typeahead dropdown problem
$('.collapse').on({
    shown: function(){
       $(this).css('overflow','visible');
    },
    hide: function(){
       $(this).css('overflow','hidden');
    }
});

$(document).ready(function() {


	var date = new Date();
	var d = date.getDate();
	var m = date.getMonth();<commit_msg>fix: inventory dropdown overflow finally fixed<commit_after>function changePopupColor(event) { //changes the events object
	$("#popupTitleButton").removeClass("btn-success btn-inverse btn-warning btn-danger");
	if(event.valid == false) {
			$("#popupTitleButton").addClass("btn-inverse");
		} else if(event.staffAdded == 0) {
			$("#popupTitleButton").addClass("btn-danger");
		}
		else if(event.staffAdded < event.staffNeeded) {
			$("#popupTitleButton").addClass("btn-warning");
		} else if(event.staffAdded == event.staffNeeded) {
			$("#popupTitleButton").addClass("btn-success");
	}
}

$('#eventButton').click(function(e) {
	$('#eventButton').addClass('disabled');
	$('#popup').modalPopover('hide');
});

$('.modal').on('show', function () {
  $('#popup').css('opacity', 0.7);
}).on('hide', function () {
  $('#popup').css('opacity', 1);
});

resizeMap = function () {
		var column_height = $(window).height();
		$('#calendar').fullCalendar('option', 'height', column_height - 40);
		//$("#calendar").css("height", + "px")
	};



function setTimeline(view) { //this is borrowed from stackoverflow
    var parentDiv = jQuery(".fc-agenda-slots:visible").parent();
    var timeline = parentDiv.children(".timeline");
    if (timeline.length == 0) { //if timeline isn't there, add it
        timeline = jQuery("<hr>").addClass("timeline");
        parentDiv.prepend(timeline);
    }
    var curTime = new Date();
    var curCalView = jQuery("#calendar").fullCalendar('getView');
    if (curCalView.visStart < curTime && curCalView.visEnd > curTime) {
        timeline.show();
    } else {
        timeline.hide();
        return;
    }
    var curSeconds = (curTime.getHours() * 60 * 60) + (curTime.getMinutes() * 60) + curTime.getSeconds();
    var percentOfDay = curSeconds / 86400; //24 * 60 * 60 = 86400, # of seconds in a day
    var topLoc = Math.floor(parentDiv.height() * percentOfDay);
    timeline.css("top", topLoc + "px");
    if (curCalView.name == "agendaWeek") { //week view, don't want the timeline to go the whole way across
        var dayCol = jQuery(".fc-today:visible");
        var left = dayCol.position().left + 1;
        var width = dayCol.width()-2;
        timeline.css({
            left: left + "px",
            width: width + "px"
        });
    }
}

Array.prototype.removeItem = function(a) {
            for (i = 0; i < this.length; i++) {
                if (this[i] == a) {
                    for (i2 = i; i2 < this.length - 1; i2++) {
                        this[i2] = this[i2 + 1];
                    }
                    this.length = this.length - 1
                    return;
                }
            }
        }

function dropdownActiveFix() {
	$('a').removeClass('drop-active');
	$('a[href="#' + Backbone.history.fragment + '"]').addClass('drop-active');

}


// The functions above are mostly done
var lastClick, lastRightClick;

// BACKBONE.JS ROUTER SECTION
var AppRouter = Backbone.Router.extend({
  routes: {
  	"printToday": "printToday",
    "recentVideo": "recentVideo",
    "*filter": "all"
  }
});


//User info must be imported for this part
var username = 'ckorkut';
      
var app = new AppRouter;

app.on('route:printToday', function() {
  	console.log('printToday');
});
app.on('route:recentVideo', function() {
  	console.log('recentVideo');
});

app.on('route:all', function(filter) {
	dropdownActiveFix();
	if(filter == null) {
		//Show all of events
		$('#calendar').fullCalendar('clientEvents', function(event) {
			event.className.removeItem('hide');
			$('#calendar').fullCalendar('updateEvent', event);
		});
		console.log('all');

	} else if(filter == 'hideCancelled') {
		
		$('#calendar').fullCalendar('clientEvents', function(event) {
			event.className.removeItem('hide');
			if(event.valid == false) {
				event.className.push('hide');
			}
			$('#calendar').fullCalendar('updateEvent', event);
		});
		console.log(filter);
	} else if(filter == 'unstaffed') {
		$('#calendar').fullCalendar('clientEvents', function(event) {
			event.className.removeItem('hide');
			if(event.staffAdded == event.staffNeeded || event.valid == false) {
				event.className.push('hide');
			}
			$('#calendar').fullCalendar('updateEvent', event);
		});
		console.log(filter);
	} else if(filter == 'onlyMine') {
		$('#calendar').fullCalendar('clientEvents', function(event) {
			event.className.removeItem('hide');
			if(event.people.indexOf(username) == -1) {
				event.className.push('hide');
			}
			$('#calendar').fullCalendar('updateEvent', event);
		});
		console.log(filter);
	}
});

Backbone.history.start();

var lastClickedEvent;
$('a[href="#split"]').click(function(e) {
	//Split window update should be done here
	$('.eventName').html(lastClickedEvent.title);
});
$('a[href="#staffEvent"]').click(function(e) {
	//Staff window update should be done here
	$('.eventName').html(lastClickedEvent.title);
});


// Solves Bootstrap typeahead dropdown problem
$('.collapse').on({
    hide: function(){
       $(this).css('overflow','hidden');
       //$(this).hide();
    },
    click: function() {
		$('.collapse').css('overflow','visible');
	}
});


$(document).ready(function() {


	var date = new Date();
	var d = date.getDate();
	var m = date.getMonth();
{'fraction_non_alphanumeric': 0.1961142637299221, 'fraction_numerical': 0.00788689044916803, 'mean_word_length': 3.4022015241320913, 'pattern_counts': {'":': 6, '<': 13, '<?xml version=': 0, '>': 7, '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': '451652', 'n_tokens_mistral': 3474, 'n_tokens_neox': 3248, 'n_words': 643}