Issues (38)

resources/modernTimeline.js (1 issue)

1
( function ( mw ) {
2
3
    modernTimelineLog( 'Timeline script' );
4
5
    function modernTimelineLog( message ) {
6
        if( mw.config.get( 'debug' ) ) {
7
            console.log( message );
8
        }
9
    }
10
11
    mw.loader.using( [ 'ext.modern.timeline' ] ).done( function () {
12
        modernTimelineLog( 'Loaded timeline JS' );
13
14
        for( var timelineId in window.modernTimeline ) {
15
            if( window.modernTimeline.hasOwnProperty( timelineId ) ) {
16
                modernTimelineLog( 'Initializing timeline "' + timelineId + '"' );
17
18
                var timelineJson = window.modernTimeline[timelineId];
19
                new TL.Timeline( timelineId, timelineJson, timelineJson.options );
0 ignored issues
show
Unused Code Best Practice introduced by
The object created with new TL.Timeline(timeline..., timelineJson.options) is not used but discarded. Consider invoking another function instead of a constructor if you are doing this purely for side effects.
Loading history...
20
21
                modernTimelineLog( 'Done initializing timeline "' + timelineId + '"' );
22
            }
23
        }
24
    } );
25
26
}( mediaWiki ) );