This repository has been archived on 2021-02-20. You can view files and clone it, but cannot push or open issues or pull requests.
shapez.io/src/js/states/changelog.js

46 lines
1.2 KiB
JavaScript

import { TextualGameState } from "../core/textual_game_state";
import { T } from "../translations";
import { CHANGELOG } from "../changelog";
export class ChangelogState extends TextualGameState {
constructor() {
super("ChangelogState");
}
getStateHeaderTitle() {
return T.changelog.title;
}
getMainContentHTML() {
const entries = CHANGELOG;
let html = "";
for (let i = 0; i < entries.length; ++i) {
const entry = entries[i];
html += `
<div class="entry">
<span class="version">${entry.version}</span>
<span class="date">${entry.date}</span>
<ul class="changes">
${entry.entries.map(text => `<li>${text}</li>`).join("")}
</ul>
</div>
`;
}
return html;
}
onEnter() {
const links = this.htmlElement.querySelectorAll("a[href]");
links.forEach(link => {
this.trackClicks(
link,
() => this.app.platformWrapper.openExternalLink(link.getAttribute("href")),
{ preventClick: true }
);
});
}
}