-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathMain.js
More file actions
81 lines (78 loc) · 1.5 KB
/
Copy pathMain.js
File metadata and controls
81 lines (78 loc) · 1.5 KB
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
74
75
76
77
78
79
80
81
/*
This file is only used for testing purpose and have no impact on actual production.
The equivalent to this file on production is Special:RLA, and should be kept in sync with it.
*/
// Mock MediaWiki APIs for testing
window.mw = window.mw || {
config: {
get: function ( key ) {
const mockConfig = {
wgPageName: 'Test_Page',
wgNamespaceNumber: 0,
wgServer: 'https://liquipedia.net',
wgScriptPath: ''
};
return mockConfig[ key ];
}
},
user: {
isAnon: function () {
return false;
}
},
loader: {
using: function () {
return Promise.resolve();
}
},
Api: function () {
return {
get: function () {
return Promise.resolve( {
query: {
logevents: [],
pages: {}
}
} );
}
};
}
};
// List of JavaScript modules to include
const jsModules = [
'UseStrict',
'Core',
'Analytics',
'BattleRoyale',
'Bracket',
'Carousel',
'Collapse',
'Commons_mainpage',
'Commons_tools',
'CopyToClipboard',
'Countdown',
'Crosstable',
'Dialog',
'Dropdown',
'ExportImage',
'FilterButtons',
'Liquipedia_links',
'Mainpage',
'Miscellaneous',
'PanelBoxCollapsible',
'Prizepooltable',
'RankingTable',
'Selectall',
'Slider',
'SwitchButtons',
'Tabs',
'Table2',
'CoreEnd'
];
// Dynamically load JavaScript modules
jsModules.forEach( ( module ) => {
const script = document.createElement( 'script' );
script.src = `../../javascript/commons/${ module }.js`;
script.async = false; // Ensure scripts load in order
document.head.appendChild( script );
} );