mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-16 13:19:58 +00:00
998ab635d3
new in this commit: - rounded corners everywhere! cobalt is now safe for everyone who can't handle sharp objects. - proper banner loading. no more jumping text! - proper banner error handling. if banner wasn't loaded, it'll simply go grey instead of disappearing. - links are no longer italic and are instead underlined. - collapsible lists now have corresponding emoji. - donate button is now highlighted with magenta instead of white. - added a list of keyboard shortcuts to about tab. - centered old changelog loader.
33 lines
1.2 KiB
JavaScript
33 lines
1.2 KiB
JavaScript
import changelogManager from "../changelog/changelogManager.js"
|
|
import { cleanHTML } from "../sub/utils.js";
|
|
|
|
let cache = {}
|
|
|
|
export function changelogHistory() { // blockId 0
|
|
if (cache['0']) return cache['0'];
|
|
let history = changelogManager("history");
|
|
let render = ``;
|
|
|
|
let historyLen = history.length;
|
|
for (let i in history) {
|
|
let separator = (i !== 0 && i !== historyLen) ? '<div class="separator"></div>' : '';
|
|
|
|
render += `
|
|
${separator}${history[i]["banner"] ?
|
|
`<div class="changelog-banner">
|
|
<img class="changelog-img" ` +
|
|
`src="${history[i]["banner"]["url"]}" ` +
|
|
`width="${history[i]["banner"]["width"]}" ` +
|
|
`height="${history[i]["banner"]["height"]}" ` +
|
|
`onerror="this.style.opacity=0" loading="lazy">`+
|
|
`</img>
|
|
</div>` : ''}
|
|
<div id="popup-desc" class="changelog-tags">${history[i]["version"]}</div>
|
|
<div id="popup-desc" class="changelog-subtitle">${history[i]["title"]}</div>
|
|
<div id="popup-desc" class="desc-padding">${history[i]["content"]}</div>`
|
|
}
|
|
render = cleanHTML(render);
|
|
cache['0'] = render;
|
|
return render;
|
|
}
|