f1vis/js/main.js

39 lines
998 B
JavaScript
Raw Normal View History

"use strict";
2017-11-16 23:08:14 +01:00
/*
* This file contains the main control flow.
*/
preprocessor.load(function(data) {
var $frame = $('.strecken-selector');
var $slidee = $frame.children('ul').eq(0);
var $wrap = $frame.parent();
var options = {
horizontal: 1,
itemNav: 'basic',
smart: 1,
activateOn: 'click',
mouseDragging: 1,
touchDragging: 1,
releaseSwing: 1,
startAt: 3,
scrollBar: $wrap.find('.scrollbar'),
scrollBy: 1,
pagesBar: $wrap.find('.pages'),
activatePageOn: 'click',
speed: 300,
elasticBounds: 1,
dragHandle: 1,
dynamicHandle: 1,
clickBar: 1,
};
$('.frame').sly(options);
// Some sample code for a year selector - TODO: Improve a lot and move somewhere else
var yearSelector = $("#seasonByYearSelector");
var seasons = processor.getSeasonsWithLapData();
for(var season in seasons){ yearSelector.append("<option>" + seasons[season].year + "</option>"); }
2017-12-15 14:00:44 +01:00
createLineGraph("#lineGraphBox", processor.getRace(970));
});