This repository has been archived by the owner on Aug 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 211
/
main.js
57 lines (55 loc) · 1.84 KB
/
main.js
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
50
51
52
53
54
55
56
57
/**
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/
requirejs.config({
//By default load any module IDs from ...
baseUrl: './static',
waitSeconds: 60,
packages: [
{ name: 'urth-common', location: 'dashboard-common' }
],
paths: {
jquery: 'bower_components/jquery/dist/jquery.min',
lodash: 'bower_components/lodash/lodash.min',
Gridstack: 'bower_components/gridstack/dist/gridstack.min',
Thebe: 'thebe/main-built'
// jquery-ui is included in Thebe
},
map: {
'*': {
'jQuery': 'jquery'
},
// jquery-ui is included in Thebe's main-built.js. Map Gridstack to load from there.
Gridstack: {
'jquery-ui/core': 'Thebe',
'jquery-ui/mouse': 'Thebe',
'jquery-ui/widget': 'Thebe',
'jquery-ui/resizable': 'Thebe',
'jquery-ui/draggable': 'Thebe'
}
},
shim: {
Thebe: {
deps: ['jquery']
}
}
});
requirejs(['urth/dashboard'], function(Dashboard) {
Dashboard.init().then(function() {
// Ugly, because we're tying dashboards specifically to urth_widgets
// but we don't have another way to detect and determine if / how these
// should be setup at the moment.
requirejs(['urth_widgets/js/init/init'], function(widgetInit) {
// Initialize the widgets which we assume is blocking here (which it
// is as of right now ...)
widgetInit('static/');
// Now that all dependencies are ready, execute everything
Dashboard.executeAll();
}, function(err) {
console.warn('urth widgets not available');
// Continue with execution of cells
Dashboard.executeAll();
});
});
});