X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Findex.js;h=e460f868786c94fd2e0c4a7a16fa2cd5233d93aa;hb=3acb852d971bc17d31ccc05756524f40038adf95;hp=d95f96a52da6bb54ec5e5fc3b5bdb8c2c4f46c23;hpb=b019d603c837db3e3c2d294a383b6ca1cf4705d4;p=vchess.git diff --git a/public/javascripts/index.js b/public/javascripts/index.js index d95f96a5..e460f868 100644 --- a/public/javascripts/index.js +++ b/public/javascripts/index.js @@ -1,3 +1,4 @@ +// Javascript for index page: mostly counters updating new Vue({ el: "#indexPage", data: { @@ -7,7 +8,11 @@ new Vue({ }, computed: { sortedCounts: function () { - const variantsCounts = variantArray.map( v => { + const variantsCounts = variantArray + .filter( v => { + return v.name.startsWith(this.curPrefix); + }) + .map( v => { return { name: v.name, desc: v.description, @@ -72,6 +77,16 @@ new Vue({ // Show welcome dialog box if "first visit" const visited = getCookie("visited"); if (!visited || visited !== "1") - document.getElementById("modal-welcome").checked = true; + document.getElementById("modalB4welcome").checked = true; + }, + methods: { + showWelcomeMsg: function() { + document.getElementById("modalB4welcome").checked = false; + document.getElementById("modalWelcome").checked = true; + }, + markAsVisited: function() { + setCookie('visited', '1'); + document.getElementById('modalWelcome').checked = false; + }, }, });