-
-
Notifications
You must be signed in to change notification settings - Fork 994
/
Copy pathmain.js
73 lines (58 loc) · 1.52 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Require.js Module Loader - http://requirejs.org
define(function () {
var mods = [
'mod/mobile-menu', // require mobile menu automatically
];
//detect Class function
function hasClass(className) {
return !!document.getElementsByClassName(className).length; //return a boolean
}
//feature list
if (hasClass('list-features')) {
mods.push('mod/list-feature');
}
//collapsing list
if (hasClass('list-collapsing')) {
mods.push('mod/list-collapsing');
}
if (hasClass('doc-floating-warning')) {
mods.push('mod/floating-warning');
}
//fundraising heart
if (hasClass('fundraising-heart')) {
mods.push('mod/fundraising-heart');
}
//fundraising donation form
if (hasClass('fundraising-index')) {
mods.push('mod/fundraising-index');
}
if (hasClass('dashboard-index')) {
mods.push('dashboard/index');
}
if (hasClass('dashboard-detail')) {
mods.push('dashboard/detail');
}
// search form
if (hasClass('search')) {
mods.push('mod/search-key');
}
if (hasClass('stripe-donation')) {
mods.push('mod/stripe-donation');
}
if (hasClass('django-hero-form')) {
mods.push('mod/stripe-change-card');
}
if (hasClass('corporate-membership-join-form')) {
mods.push('mod/corporate-member-join');
}
if (hasClass('messages')) {
mods.push('mod/messages');
}
if (hasClass('code-block-caption') || hasClass('snippet')) {
mods.push('mod/clippify');
}
if (hasClass('console-block')) {
mods.push('mod/console-tabs');
}
require(mods);
});