Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
Latest commit
60 lines (48 loc) · 2.14 KB
/
Copy pathscript.js
File metadata and controls
60 lines (48 loc) · 2.14 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
asyncfunctionfetchData(){
constresponse=awaitfetch('https://ymanagement.mefi.workers.dev');
constdata=awaitresponse.json();
displayData(data);
}
functiondisplayData(data){
constversionsContainer=document.getElementById('versions');
constchangelogContainer=document.getElementById('changelog');
for(const[key,value]ofObject.entries(data)){
if(key!=='Latest_Changelog'){
constversionDiv=document.createElement('div');
versionDiv.className='version';
constversionTitle=document.createElement('span');
versionTitle.textContent=key.replace(/_/g,' ');
versionDiv.appendChild(versionTitle);
if(value.error){
versionDiv.appendChild(document.createTextNode(value.error));
}else{
constcreateLink=(text,url)=>{
constlink=document.createElement('a');
link.textContent=text;
link.href=url;
link.target='_blank';
link.className='button-link';
returnlink;
};
constlink1=createLink('Download',value.Link_1);
constlink2=createLink('Mirror',value.Link_2);
// const mirror = createLink('Mirror 2', value.Mirror);
versionDiv.appendChild(link1);
versionDiv.appendChild(document.createTextNode(' '));
if(window.innerWidth>=400){
versionDiv.appendChild(link2);
versionDiv.appendChild(document.createTextNode(' '));
}
// versionDiv.appendChild(document.createTextNode(' '));
// versionDiv.appendChild(mirror);
if(key==='Wave_Patched'){
versionDiv.classList.add('wave');
}
}
versionsContainer.appendChild(versionDiv);
}
}
constlatestChangelog=data.Latest_Changelog.Patched_Changelogs;
changelogContainer.textContent=`${latestChangelog}`;
}
fetchData();