PageRenderTime 98ms CodeModel.GetById 47ms app.highlight 4ms RepoModel.GetById 44ms app.codeStats 0ms

/timeline/ext/planning/scripts/planning.js

http://showslow.googlecode.com/
JavaScript | 47 lines | 36 code | 7 blank | 4 comment | 3 complexity | 037d55ab7fc3c68df1b3a1f09411589c MD5 | raw file
 1/*==================================================
 2 *  Planning
 3 *==================================================
 4 */
 5
 6Timeline.Planning = new Object();
 7
 8Timeline.Planning.createBandInfo = function(params) {
 9    var theme = ("theme" in params) ? params.theme : Timeline.getDefaultTheme();
10    
11    var eventSource = ("eventSource" in params) ? params.eventSource : null;
12    
13    var ether = new Timeline.LinearEther({ 
14        centersOn:          ("date" in params) ? params.date : Timeline.PlanningUnit.makeDefaultValue(),
15        interval:           1,
16        pixelsPerInterval:  params.intervalPixels
17    });
18    
19    var etherPainter = new Timeline.PlanningEtherPainter({
20        intervalUnit:       params.intervalUnit, 
21        multiple:           ("multiple" in params) ? params.multiple : 1,
22        align:              params.align,
23        theme:              theme 
24    });
25    
26    var eventPainterParams = {
27        theme:      theme
28    };
29    if ("trackHeight" in params) {
30        eventPainterParams.trackHeight = params.trackHeight;
31    }
32    if ("trackGap" in params) {
33        eventPainterParams.trackGap = params.trackGap;
34    }
35    var eventPainter = ("overview" in params && params.overview) ?
36        new Timeline.OverviewEventPainter(eventPainterParams) :
37        new Timeline.DetailedEventPainter(eventPainterParams);
38    
39    return {   
40        width:          params.width,
41        eventSource:    eventSource,
42        timeZone:       ("timeZone" in params) ? params.timeZone : 0,
43        ether:          ether,
44        etherPainter:   etherPainter,
45        eventPainter:   eventPainter
46    };
47};