2022-09-11 16:04:06 +01:00
|
|
|
import changelogManager from "../changelog/changelogManager.js"
|
2023-08-04 19:43:12 +01:00
|
|
|
import { cleanHTML } from "../sub/utils.js";
|
2022-09-11 16:04:06 +01:00
|
|
|
|
2023-03-09 18:41:17 +00:00
|
|
|
let cache = {}
|
|
|
|
|
2022-09-11 16:04:06 +01:00
|
|
|
export function changelogHistory() { // blockId 0
|
2023-03-09 18:41:17 +00:00
|
|
|
if (cache['0']) return cache['0'];
|
2022-09-11 16:04:06 +01:00
|
|
|
let history = changelogManager("history");
|
|
|
|
let render = ``;
|
2022-11-15 17:37:33 +00:00
|
|
|
|
2023-04-03 17:36:23 +01:00
|
|
|
let historyLen = history.length;
|
2022-09-11 16:04:06 +01:00
|
|
|
for (let i in history) {
|
2023-04-03 17:36:23 +01:00
|
|
|
let separator = (i !== 0 && i !== historyLen) ? '<div class="separator"></div>' : '';
|
2023-08-04 19:43:12 +01:00
|
|
|
|
|
|
|
render += `
|
2023-08-11 16:53:30 +01:00
|
|
|
${separator}${history[i]["banner"] ?
|
|
|
|
`<div class="changelog-banner">
|
|
|
|
<img class="changelog-img" ` +
|
|
|
|
`src="${history[i]["banner"]["url"]}" ` +
|
2024-01-15 00:30:37 +00:00
|
|
|
`alt="${history[i]["banner"]["alt"].replaceAll('"', '"')}" ` +
|
2023-08-11 16:53:30 +01:00
|
|
|
`width="${history[i]["banner"]["width"]}" ` +
|
|
|
|
`height="${history[i]["banner"]["height"]}" ` +
|
|
|
|
`onerror="this.style.opacity=0" loading="lazy">`+
|
2024-01-13 00:35:07 +00:00
|
|
|
`
|
2023-08-04 19:43:12 +01:00
|
|
|
</div>` : ''}
|
2024-01-13 00:35:07 +00:00
|
|
|
<div class="popup-desc changelog-tags">${history[i]["version"]}</div>
|
|
|
|
<div class="popup-desc changelog-subtitle">${history[i]["title"]}</div>
|
|
|
|
<div class="popup-desc desc-padding">${history[i]["content"]}</div>`
|
2022-09-11 16:04:06 +01:00
|
|
|
}
|
2023-08-04 19:43:12 +01:00
|
|
|
render = cleanHTML(render);
|
2023-03-09 18:41:17 +00:00
|
|
|
cache['0'] = render;
|
2022-09-11 16:04:06 +01:00
|
|
|
return render;
|
2022-11-15 17:37:33 +00:00
|
|
|
}
|