mirror of
https://github.com/wukko/cobalt.git
synced 2025-05-23 18:16:14 +02:00

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.
45 lines
2.0 KiB
JavaScript
45 lines
2.0 KiB
JavaScript
import { replaceBase } from "../../localization/manager.js";
|
|
import loadJSON from "../sub/loadJSON.js";
|
|
|
|
let changelog = loadJSON('./src/modules/changelog/changelog.json')
|
|
|
|
export default function(string) {
|
|
try {
|
|
switch (string) {
|
|
case "version":
|
|
return `<span class="text-backdrop changelog-tag-version">v.${changelog["current"]["version"]}</span>${
|
|
changelog["current"]["date"] ? `<span class="changelog-tag-date">· ${changelog["current"]["date"]}</span>` : ''
|
|
}`
|
|
case "title":
|
|
return replaceBase(changelog["current"]["title"]);
|
|
case "banner":
|
|
return changelog["current"]["banner"] ? {
|
|
url: `updateBanners/${changelog["current"]["banner"]["file"]}`,
|
|
width: changelog["current"]["banner"]["width"],
|
|
height: changelog["current"]["banner"]["height"]
|
|
} : false;
|
|
case "content":
|
|
return replaceBase(changelog["current"]["content"]);
|
|
case "history":
|
|
return changelog["history"].map((i) => {
|
|
return {
|
|
title: replaceBase(i["title"]),
|
|
version: `<span class="text-backdrop changelog-tag-version">v.${i["version"]}</span>${
|
|
i["date"] ? `<span class="changelog-tag-date">· ${i["date"]}</span>` : ''
|
|
}`,
|
|
content: replaceBase(i["content"]),
|
|
banner: i["banner"] ? {
|
|
url: `updateBanners/${i["banner"]["file"]}`,
|
|
width: i["banner"]["width"],
|
|
height: i["banner"]["height"]
|
|
} : false,
|
|
}
|
|
});
|
|
default:
|
|
return replaceBase(changelog[string])
|
|
}
|
|
} catch (e) {
|
|
return `!!CHANGELOG_${string}!!`
|
|
}
|
|
}
|