mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-16 05:09:57 +00:00
27 lines
1 KiB
JavaScript
27 lines
1 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"]}" onerror="this.style.display='none'" 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;
|
|
}
|