public/javascripts/common.js
/**
 * GET all schedule names from the cloud
 */
GET all schedule names from the cloud
GET all schedule names from the cloud
function loadOptions(data) {
	var names = data.map(function (obj) {
		return obj.name;
	});
	names.forEach(function (name) {
		var op = document.createElement("option");
		op.textContent = name;
		op.value = name;
		dropdown.append(op);
	});
	window.scheduleNames = names;
    var index = names.indexOf(localStorage.defaultSchedule);
    if (index >= 0) {
	    $("#dropdown").children()[index].selected = true;
    } else {
    	localStorage.defaultSchedule = names[0];
    }
    ScheduleView.load(localStorage.defaultSchedule);
}
function loadOptions ( data ) { var names = data . map ( function ( obj ) { return obj . name ; } ) ; names . forEach ( function ( name ) { var op = document . createElement ( "option" ) ; op . textContent = name ; op . value = name ; dropdown . append ( op ) ; } ) ; window . scheduleNames = names ; var index = names . indexOf ( localStorage . defaultSchedule ) ; if ( index >= 0 ) { $ ( "#dropdown" ) . children ( ) [ index ] . selected = true ; } else { localStorage . defaultSchedule = names [ 0 ] ; } ScheduleView . load ( localStorage . defaultSchedule ) ; }
GET all schedule names from the cloud
GET all schedule names from the cloud
// TODO: remove this // set default schedule if none