2021-03-20 16:40:38 +00:00
|
|
|
// Should be included using 'defer' after servers.js and functions.js
|
2021-03-20 00:04:26 +00:00
|
|
|
|
2021-03-21 01:38:30 +00:00
|
|
|
let server = getRandomItem(instances);
|
2021-03-20 00:04:26 +00:00
|
|
|
|
2021-03-21 01:38:30 +00:00
|
|
|
console.log('Randomly selected: ', server);
|
2021-03-20 00:04:26 +00:00
|
|
|
|
2021-03-21 01:38:30 +00:00
|
|
|
// Server link
|
2021-03-20 00:04:26 +00:00
|
|
|
let linkElement = document.getElementById('reg-link');
|
2021-03-21 01:38:30 +00:00
|
|
|
linkElement.setAttribute('href', server.url);
|
|
|
|
linkElement.innerText = 'Регистрация на ' + server.name;
|
|
|
|
|
|
|
|
let platform = platforms[server.platform];
|
|
|
|
let regMode = registrationModes[server.registration];
|
|
|
|
|
|
|
|
// Additional metadata elements
|
|
|
|
let platformElement = document.getElementById('node-platform');
|
|
|
|
let registrationElement = document.getElementById('node-registration');
|
|
|
|
|
|
|
|
// Icon element
|
|
|
|
let platformIcon = document.createElement('img');
|
|
|
|
platformIcon.setAttribute('src', platform.icon);
|
|
|
|
|
|
|
|
platformElement.innerHTML = '';
|
|
|
|
platformElement.appendChild(platformIcon);
|
|
|
|
platformElement.appendChild(document.createTextNode(' ' + platform.name));
|
|
|
|
|
|
|
|
registrationElement.innerText = regMode.name;
|