2019-02-18 09:18:32 +00:00
|
|
|
<template>
|
2019-08-03 19:03:45 +00:00
|
|
|
<div id="changelog" class="window" aria-label="Changelog">
|
2019-02-18 09:18:32 +00:00
|
|
|
<div class="header">
|
2019-04-13 20:44:04 +00:00
|
|
|
<SidebarToggle />
|
2019-02-18 09:18:32 +00:00
|
|
|
</div>
|
|
|
|
<div class="container">
|
2019-10-28 13:48:13 +00:00
|
|
|
<router-link id="back-to-help" to="/help">« Help</router-link>
|
2019-02-18 09:18:32 +00:00
|
|
|
|
2019-08-05 15:37:59 +00:00
|
|
|
<template
|
2022-06-19 00:25:21 +00:00
|
|
|
v-if="store.state.versionData?.current && store.state.versionData?.current.version"
|
2019-08-05 15:37:59 +00:00
|
|
|
>
|
|
|
|
<h1 class="title">
|
2022-06-19 00:25:21 +00:00
|
|
|
Release notes for {{ store.state.versionData.current.version }}
|
2019-08-05 15:37:59 +00:00
|
|
|
</h1>
|
2019-02-18 09:18:32 +00:00
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
<template v-if="store.state.versionData.current.changelog">
|
2019-02-20 15:09:44 +00:00
|
|
|
<h3>Introduction</h3>
|
2019-08-05 15:37:59 +00:00
|
|
|
<div
|
2019-08-07 12:12:36 +00:00
|
|
|
ref="changelog"
|
2019-08-05 15:37:59 +00:00
|
|
|
class="changelog-text"
|
2022-06-19 00:25:21 +00:00
|
|
|
v-html="store.state.versionData.current.changelog"
|
2019-08-05 15:37:59 +00:00
|
|
|
></div>
|
2019-02-20 15:09:44 +00:00
|
|
|
</template>
|
|
|
|
<template v-else>
|
2020-01-02 10:54:47 +00:00
|
|
|
<p>Unable to retrieve changelog for current release from GitHub.</p>
|
2019-02-20 15:09:44 +00:00
|
|
|
<p>
|
|
|
|
<a
|
2022-06-19 00:25:21 +00:00
|
|
|
v-if="store.state.serverConfiguration?.version"
|
|
|
|
:href="`https://github.com/thelounge/thelounge/releases/tag/v${store.state.serverConfiguration?.version}`"
|
2019-02-20 15:09:44 +00:00
|
|
|
target="_blank"
|
2019-03-01 14:18:16 +00:00
|
|
|
rel="noopener"
|
2019-08-03 19:03:45 +00:00
|
|
|
>View release notes for this version on GitHub</a
|
|
|
|
>
|
2019-02-20 15:09:44 +00:00
|
|
|
</p>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<p v-else>Loading changelog…</p>
|
2019-02-18 09:18:32 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
<script lang="ts">
|
|
|
|
import {defineComponent, onMounted, onUpdated, ref} from "vue";
|
2019-08-07 11:58:35 +00:00
|
|
|
import socket from "../../js/socket";
|
2022-06-19 00:25:21 +00:00
|
|
|
import {useStore} from "../../js/store";
|
2019-04-13 20:44:04 +00:00
|
|
|
import SidebarToggle from "../SidebarToggle.vue";
|
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
export default defineComponent({
|
2019-02-18 09:18:32 +00:00
|
|
|
name: "Changelog",
|
2019-04-13 20:44:04 +00:00
|
|
|
components: {
|
|
|
|
SidebarToggle,
|
|
|
|
},
|
2022-06-19 00:25:21 +00:00
|
|
|
setup() {
|
|
|
|
const store = useStore();
|
|
|
|
const changelog = ref<HTMLDivElement | null>(null);
|
2019-08-07 12:12:36 +00:00
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
const patchChangelog = () => {
|
|
|
|
if (!changelog.value) {
|
2019-10-17 16:56:44 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
const links = changelog.value.querySelectorAll("a");
|
2019-08-07 12:12:36 +00:00
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
links.forEach((link) => {
|
2019-08-07 12:12:36 +00:00
|
|
|
// Make sure all links will open a new tab instead of exiting the application
|
|
|
|
link.setAttribute("target", "_blank");
|
2019-10-20 14:35:42 +00:00
|
|
|
link.setAttribute("rel", "noopener");
|
2019-08-07 12:12:36 +00:00
|
|
|
|
|
|
|
if (link.querySelector("img")) {
|
|
|
|
// Add required metadata to image links, to support built-in image viewer
|
|
|
|
link.classList.add("toggle-thumbnail");
|
|
|
|
}
|
2022-06-19 00:25:21 +00:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
if (!store.state.versionData) {
|
|
|
|
socket.emit("changelog");
|
2019-08-07 12:12:36 +00:00
|
|
|
}
|
2022-06-19 00:25:21 +00:00
|
|
|
|
|
|
|
patchChangelog();
|
|
|
|
});
|
|
|
|
|
|
|
|
onUpdated(() => {
|
|
|
|
patchChangelog();
|
|
|
|
});
|
|
|
|
|
|
|
|
return {
|
|
|
|
store,
|
|
|
|
};
|
2019-08-05 15:37:59 +00:00
|
|
|
},
|
2022-06-19 00:25:21 +00:00
|
|
|
});
|
2019-02-18 09:18:32 +00:00
|
|
|
</script>
|