X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2FApp.vue;h=77059bba9d223ccb88c88bb20da3fe29d3173af8;hb=d54f6261c9e30f4eabb402ad301dd5c5e40fb656;hp=78cd10b1c1dcfe4cb6bb6d8e515988ebc35a8eb9;hpb=a17ae3179cd6d68f8ecaa94261dd97f0f4480969;p=vchess.git diff --git a/client/src/App.vue b/client/src/App.vue index 78cd10b1..77059bba 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -34,7 +34,13 @@ .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 footer router-link.menuitem(to="/about") {{ st.tr["About"] }} - router-link.menuitem(to="/news") {{ st.tr["News"] }} + router-link.menuitem#newsMenu(to="/news") {{ st.tr["News"] }} + a.menuitem(href="https://discord.gg/a9ZFKBe") + span Discord + img(src="/images/icons/discord.svg") + a.menuitem(href="https://github.com/yagu0/vchess") + span {{ st.tr["Code"] }} + img(src="/images/icons/github.svg") p.clickable(onClick="window.doClick('modalContact')") | {{ st.tr["Contact"] }} @@ -43,8 +49,8 @@ import ContactForm from "@/components/ContactForm.vue"; import Settings from "@/components/Settings.vue"; import UpsertUser from "@/components/UpsertUser.vue"; -import { store } from "./store.js"; -import { processModalClick } from "./utils/modalClick.js"; +import { store } from "@/store.js"; +import { ajax } from "@/utils/ajax.js"; export default { components: { ContactForm, @@ -52,19 +58,22 @@ export default { UpsertUser }, data: function() { - return { - st: store.state - }; + return { st: store.state }; }, mounted: function() { - let dialogs = document.querySelectorAll("div[role='dialog']"); - dialogs.forEach(d => { - d.addEventListener("click", processModalClick); - }); + ajax( + "/newsts", + "GET", + { + success: (res) => { + if (this.st.user.newsRead < res.timestamp) + document.getElementById("newsMenu").classList.add("somenews"); + } + } + ); }, methods: { hideDrawer: function(e) { - if (e.target.innerText == "Forum") return; //external link e.preventDefault(); //TODO: why is this needed? document.getElementsByClassName("drawer")[0].checked = false; } @@ -75,8 +84,8 @@ export default {