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";
 export default {
   components: {
     ContactForm,
       st: store.state
     };
   },
-  mounted: function() {
-    let dialogs = document.querySelectorAll("div[role='dialog']");
-    dialogs.forEach(d => {
-      d.addEventListener("click", processModalClick);
-    });
-  },
   methods: {
     hideDrawer: function(e) {
       e.preventDefault(); //TODO: why is this needed?
 
       baseGameDiv.addEventListener("keydown", this.handleKeys);
       baseGameDiv.addEventListener("wheel", this.handleScroll);
     }
-    document.getElementById("eogDiv").addEventListener(
-      "click",
-      processModalClick);
+    document.getElementById("eogDiv")
+      .addEventListener("click", processModalClick);
   },
   methods: {
     focusBg: function() {
 
     type="checkbox"
     @change="trySetEnterTime($event)"
   )
-  div(
+  div#contactDiv(
     role="dialog"
     data-checkbox="modalContact"
   )
 import { ajax } from "@/utils/ajax";
 import { store } from "@/store";
 import { checkNameEmail } from "@/data/userCheck";
+import { processModalClick } from "@/utils/modalClick.js";
 export default {
   name: "my-contact-form",
   data: function() {
       infoMsg: ""
     };
   },
+  mounted: function() {
+    document.getElementById("contactDiv")
+      .addEventListener("click", processModalClick);
+  },
   methods: {
     trySetEnterTime: function(event) {
       if (event.target.checked) {
 
     };
   },
   mounted: function() {
-    document.getElementById("adjuster").addEventListener(
-      "click",
-      processModalClick);
+    document.getElementById("adjuster")
+      .addEventListener("click", processModalClick);
     if ("ontouchstart" in window) {
       // Disable tooltips on smartphones:
       document.querySelectorAll("#aboveMoves .tooltip").forEach(elt => {
 button
   margin: 0
 
-button.tooltip
+#aboveMoves button
   padding-bottom: 5px
 </style>
 
 <template lang="pug">
 div
   input#modalSettings.modal(type="checkbox")
-  div(
+  div#settingsDiv(
     role="dialog"
     data-checkbox="modalSettings"
   )
           )
       div(@change="updateSettings($event)")
         fieldset
-          label(for="setHints") {{ st.tr["Show possible moves?"] }}
+          label(for="setHints") {{ st.tr["Show possible moves"] }}
           input#setHints(
             type="checkbox"
             v-model="st.settings.hints"
           )
         fieldset
           label(for="setHighlight")
-            | {{ st.tr["Highlight last move and checks?"] }}
+            | {{ st.tr["Highlight last move"] }}
           input#setHighlight(
             type="checkbox"
             v-model="st.settings.highlight"
             option(value="chesstempo") {{ st.tr["blue"] }}
         fieldset
           label(for="setSound")
-            | {{ st.tr["Sound alert when game starts?"] }}
+            | {{ st.tr["Sound alert at game start"] }}
           input#setSound(
             type="checkbox"
             v-model="st.settings.sound"
           )
         fieldset
           label(for="setGotonext")
-            | {{ st.tr["Show next game after move?"] }}
+            | {{ st.tr["Show next game after a move"] }}
           input#setGotonext(
             type="checkbox"
             v-model="st.settings.gotonext"
 
 <script>
 import { store } from "@/store.js";
+import { processModalClick } from "@/utils/modalClick.js";
 export default {
   name: "my-settings",
   data: function() {
     };
   },
   mounted: function() {
+    document.getElementById("settingsDiv")
+      .addEventListener("click", processModalClick);
     // NOTE: better style would be in pug directly, but how?
     document.querySelectorAll("#langSelect > option").forEach(opt => {
       if (opt.value == this.st.lang) opt.selected = true;
 
     type="checkbox"
     @change="trySetEnterTime($event)"
   )
-  div(
+  div#upsertDiv(
     role="dialog"
     data-checkbox="modalUser"
   )
 import { store } from "@/store";
 import { checkNameEmail } from "@/data/userCheck";
 import { ajax } from "@/utils/ajax";
+import { processModalClick } from "@/utils/modalClick.js";
 export default {
   name: "my-upsert-user",
   data: function() {
       user: {}
     };
   },
+  mounted: function() {
+    document.getElementById("upsertDiv")
+      .addEventListener("click", processModalClick);
+  },
   watch: {
     nameOrEmail: function(newValue) {
       if (newValue.indexOf("@") >= 0) {
 
   Go: "Go",
   green: "green",
   Hall: "Hall",
-  "Highlight last move and checks?": "Highlight last move and checks?",
+  "Highlight last move": "Highlight last move",
   Instructions: "Instructions",
   "Invalid email": "Invalid email",
   "It's your turn!": "It's your turn!",
   "Self-challenge is forbidden": "Self-challenge is forbidden",
   "Send challenge": "Send challenge",
   Settings: "Settings",
-  "Show next game after move?": "Show next game after move?",
-  "Show possible moves?": "Show possible moves?",
+  "Show next game after a move": "Show next game after move",
+  "Show possible moves": "Show possible moves",
   "Show solution": "Show solution",
   Solution: "Solution",
-  "Sound alert when game starts?": "Sound alert when game starts?",
+  "Sound alert at game start": "Sound alert at game start",
   Stop: "Stop",
   "Stop game": "Stop game",
   Subject: "Subject",
 
   Go: "Go",
   green: "verde",
   Hall: "Salón",
-  "Highlight last move and checks?": "¿Resaltar el último movimiento y jaques?",
+  "Highlight last move": "Resaltar el último movimiento",
   Instructions: "Instrucciones",
   "Invalid email": "Email inválido",
   "It's your turn!": "¡Es su turno!",
   "Self-challenge is forbidden": "Auto desafío está prohibido",
   "Send challenge": "Enviar desafío",
   Settings: "Configuraciones",
-  "Show next game after move?": "¿Mostrar la siguiente partida después de una jugada?",
-  "Show possible moves?": "¿Mostrar posibles movimientos?",
+  "Show next game after a move": "Mostrar la siguiente partida después de una jugada",
+  "Show possible moves": "Mostrar posibles movimientos",
   "Show solution": "Mostrar la solución",
   Solution: "Solución",
-  "Sound alert when game starts?": "¿Alerta audible cuando comienza una partida?",
+  "Sound alert at game start": "Alerta audible cuando comienza una partida",
   Stop: "Interrupción",
   "Stop game": "Terminar la partida",
   Subject: "Asunto",
 
   Go: "Go",
   green: "vert",
   Hall: "Salon",
-  "Highlight last move and checks?": "Mettre en valeur le dernier coup et les échecs ?",
+  "Highlight last move": "Mettre en valeur le dernier coup",
   Instructions: "Instructions",
   "Invalid email": "Email invalide",
   "It's your turn!": "À vous de jouer !",
   "Self-challenge is forbidden": "Interdit de s'auto-défier",
   "Send challenge": "Envoyer défi",
   Settings: "Réglages",
-  "Show next game after move?": "Montrer la partie suivante après un coup ?",
-  "Show possible moves?": "Montrer les coups possibles ?",
+  "Show next game after a move": "Montrer la partie suivante après un coup",
+  "Show possible moves": "Montrer les coups possibles",
   "Show solution": "Montrer la solution",
   Solution: "Solution",
-  "Sound alert when game starts?": "Alerte sonore quand une partie démarre ?",
+  "Sound alert at game start": "Alerte sonore quand une partie démarre",
   Stop: "Arrêt",
   "Stop game": "Arrêter la partie",
   Subject: "Sujet",
 
     for (let c of ["w", "b"]) {
       if (c == 'b' && randomness == 1) {
         pieces['b'] = pieces['w'];
+        antikingPos['b'] = antikingPos['w'];
         break;
       }
 
 
   },
   mounted: function() {
     document.addEventListener('visibilitychange', this.visibilityChange);
-    document
-      .getElementById("chatWrap")
-      .addEventListener("click", processModalClick);
+    ["chatWrap", "infoDiv"].forEach(eltName => {
+      document.getElementById(eltName)
+        .addEventListener("click", processModalClick);
+    });
     if ("ontouchstart" in window) {
       // Disable tooltips on smartphones:
       document.querySelectorAll("#aboveBoard .tooltip").forEach(elt => {
 
   mounted: function() {
     document.addEventListener('visibilitychange', this.visibilityChange);
     ["peopleWrap", "infoDiv", "newgameDiv"].forEach(eltName => {
-      let elt = document.getElementById(eltName);
-      elt.addEventListener("click", processModalClick);
+      document.getElementById(eltName)
+        .addEventListener("click", processModalClick);
     });
     document.querySelectorAll("#predefinedCadences > button").forEach(b => {
       b.addEventListener("click", () => {
 
     );
   },
   mounted: function() {
-    document
-      .getElementById("newprobDiv")
+    document.getElementById("newprobDiv")
       .addEventListener("click", processModalClick);
   },
   watch: {