-
- // TODO: AJAX call get corr games (all variants)
- // 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)
-
- //TODO: si une partie en cours dans storage, rediriger vers cette partie
- //(à condition que l'URL n'y corresponde pas déjà !)
- // TODO: à l'arrivée sur le site : set peerID (un identifiant unique
- // en tout cas...) si pas trouvé dans localStorage "myid"
- // (l'identifiant de l'utilisateur si connecté)
-// if (!!localStorage["variant"])
-// location.hash = "#game?id=" + localStorage["gameId"];
- },
- // Later, for icons (if using feather):
-// mounted: function() {
-// feather.replace();
-// },
- created: function() {
- store.initialize();
+ document.addEventListener("keydown", (e) => {
+ if (e.code === "Escape")
+ {
+ let modalBoxes = document.querySelectorAll("[id^='modal']");
+ modalBoxes.forEach(m => {
+ if (m.checked)
+ m.checked = false;
+ });
+ }
+ });
+ // TODO: why is this wrong? (Maybe because $route still uninitialized?)
+ //store.initialize(this.$route.path);
+ store.initialize(window.location.href.split("#")[1].split("?")[0]);
+ // NOTE: at this point, variants and tr(anslations) might be uninitialized