},
},
created: function() {
+ this.setDisplay();
+ window.onhashchange = this.setDisplay;
+
const url = socketUrl;
const sid = getRandString();
this.conn = new WebSocket(url + "/?sid=" + sid + "&page=index");
if (data.code == "counts")
this.counts = data.counts;
else if (data.code == "increase")
- this.counts[data.vname]++;
+ this.counts[data.vid]++;
else if (data.code == "decrease")
- this.counts[data.vname]--;
+ this.counts[data.vid]--;
};
const socketCloseListener = () => {
this.conn = new WebSocket(url + "/?sid=" + sid + "&page=index");
// 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)
// (helper: static fonction "GetNextCol()" dans base_rules.js)
+
+ },
+ methods: {
+ setDisplay: function() {
+ if (!location.hash)
+ location.hash = "#variants"; //default
+ this.display = location.hash.substr(1);
+ },
+
},
});