summaryrefslogtreecommitdiffstats
path: root/theme/javascript/gitbook.js
blob: b9f7d01091c0f25fe98feb32f5fa531cef76dd2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
define([
    'jQuery',
    'utils/storage',
    'utils/sharing',
    'utils/dropdown',

    'core/events',
    'core/state',
    'core/keyboard',
    'core/navigation',
    'core/progress',
    'core/sidebar',
    'core/search',

    'apis/toolbar'
], function($, storage, sharing, dropdown, events, state,
keyboard, navigation, progress, sidebar, search, toolbar){
    var start = function(config) {
        // Init sidebar
        sidebar.init();

        // Load search
        search.init();

        // Init keyboard
        keyboard.init();

        // Bind sharing button
        sharing.init();

        // Bind dropdown
        dropdown.init();

        // Init navigation
        navigation.init();

        events.trigger('start', config);
    };

    // Export APIs for plugins
    return {
        start: start,
        events: events,
        state: state,

        toolbar: toolbar,
        storage: storage
    };
});