X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Findex.js;h=64489262663e9237bd420d3ebeb5ece157830537;hp=007c9fe2d6c7d797d619a7b0eccb5409512b8624;hb=b6487fb9c41705187cf97215fc9e8f86a59057c7;hpb=2c99dab410af1cb902b8e6140df2348a92cf1312 diff --git a/public/javascripts/index.js b/public/javascripts/index.js index 007c9fe2..64489262 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,12 @@ new Vue({ }, computed: { sortedCounts: function () { - const variantsCounts = variantArray.map( v => { + // TODO: priorité aux parties corr où c'est à nous de jouer ! + const variantsCounts = variantArray + .filter( v => { + return v.name.startsWith(this.curPrefix); + }) + .map( v => { return { name: v.name, desc: v.description, @@ -69,15 +75,10 @@ new Vue({ } // ...ignore everything else }; - // Show welcome dialog box if "first visit" - const visited = getCookie("visited"); - if (!visited || visited !== "1") - document.getElementById("modal-b4welcome").checked = true; - }, - methods: { - showWelcomeMsg: function() { - document.getElementById("modal-b4welcome").checked = false; - document.getElementById("modal-welcome").checked = true; - }, }, }); + +// TODO: +// si dernier lastMove sur serveur n'est pas le mien et nextColor == moi, alors background orange +// ==> background orange si à moi de jouer par corr (sur main index) +// (fonction "getNextCol()" dans base_rules.js ?)