msgid "{0} changed the language of the board to {1}"
msgstr "{0} a changé la langue du plateau en {1}"
- msgid "Configuration"
- msgstr "Options de configuration"
++msgid "Settings"
++msgstr "Paramètres"
+
- msgid "Configuration window"
- msgstr "Fenêtre de configuration"
+ msgid "Check spelling for new words"
+ msgstr "Vérifier l'orthographe des mots nouveaux"
+
+ msgid "Incorrect spelling for {0} from {1}"
+ msgstr "Orthographe incorrecte pour {0} parmi {1}"
+
+ msgid "All words are correct: {0}"
+ msgstr "Tous les mots sont corrects : {0}"
+
+ msgid "No new word found"
+ msgstr "Aucun nouveau mot trouvé"
+
+ msgid "Incorrect dictionary file."
+ msgstr "Dictionnaire incorrect."
+
+ msgid "Can't load dictionary file."
+ msgstr "Impossible de charger le dictionnaire"
+
+ msgid "Enable spell checker"
+ msgstr "Activer le vérificateur orthographique"
+
+ msgid "Spell checking requires Trivabble to download a dictionary. Do you confirm?"
+ msgstr "La vérification orthographique nécessite que Trivabble télécharge un dictionnaire. Confirmez-vous ?"
+
+ msgid "Spell checking is based on:"
+ msgstr "La vérification orthographique est basée sur :"
-msgid "Settings"
-msgstr "Paramètres"
+msgid "Turn timer:"
+msgstr "Temps du tour :"
+
+msgid "Global timer:"
+msgstr "Temp global :"
+
+msgid "{0}d"
+msgstr "{0}j"
+
+msgid "{0}h"
+msgstr "{0}h"
+
+msgid "{0}' {1}''"
+msgstr "{0}' {1}''"
+
+msgid "Enable timer"
+msgstr "Activer le timer"
msgid "{0} changed the language of the board to {1}"
msgstr ""
- msgid "Configuration"
++msgid "Settings"
+msgstr ""
+
- msgid "Configuration window"
+ msgid "Check spelling for new words"
+ msgstr ""
+
+ msgid "Incorrect spelling for {0} from {1}"
+ msgstr ""
+
+ msgid "All words are correct: {0}"
+ msgstr ""
+
+ msgid "No new word found"
+ msgstr ""
+
+ msgid "Incorrect dictionary file."
+ msgstr ""
+
+ msgid "Can't load dictionary file."
+ msgstr ""
+
+ msgid "Enable spell checker"
+ msgstr ""
+
+ msgid "Spell checking requires Trivabble to download a dictionary. Do you confirm?"
+ msgstr ""
+
+ msgid "Spell checking is based on:"
msgstr ""
-msgid "Settings"
-msgstr ""
+msgid "Turn timer:"
+msgstr ""
+
+msgid "Global timer:"
+msgstr ""
+
+msgid "{0}d"
+msgstr ""
+
+msgid "{0}h"
+msgstr ""
+
+msgid "{0}' {1}''"
+msgstr ""
+
+msgid "Enable timer"
+msgstr ""
</div>
</div>
- <div class="modal" id="modal-config-dialog">
+ <div class="modal" id="modal-settings-dialog">
<div class="modal-content">
<h2>
- <span data-l10n="text-content">Configuration window</span>
- <span class="modal-button" id="modal-close-btn">×</span>
- </h2>
- <div id="prefs-sound">
+ <span data-l10n="text-content">Settings</span>
+ <span class="modal-button" id="btn-settings-close">×</span>
+ </h2>
- <div id="prefs-sound">
++ <div id="prefs">
<p><label><input type="checkbox" id="tiles-sound" checked="checked" /><span data-l10n="text-content">Sound of the tiles</span></label></p>
<p><label><input type="checkbox" id="msg-sound" checked="checked" /><span data-l10n="text-content">Sound of messages</span></label></p>
+ <p id="enable-spell-checker-outer" style="display:none"><label><input type="checkbox" id="enable-spell-checker" /> <span data-l10n="text-content">Enable spell checker</span></label></p>
+ <p><label><input type="checkbox" id="enable-timer" /> <span data-l10n="text-content">Enable timer</span></label></p>
</div>
</div>
</div>
</div>
<div id="panel">
- <div id="timer" style="display:none">
- <p>
- <span data-l10n="text-content">Turn timer:</span>
- <span id="timer-turn">0</span>
- </p>
- <p>
- <span data-l10n="text-content">Global timer:</span>
- <span id="timer-global">0</span>
- </p>
- </div>
+ <button id="btn-settings" data-l10n="text-content">Settings</button>
++ <p id="timer" style="display:none">
++ <span data-l10n="text-content">Turn timer:</span>
++ <span id="timer-turn">0</span>
++ <br />
++ <span data-l10n="text-content">Global timer:</span>
++ <span id="timer-global">0</span>
++ </p>
<div id="bag"></div>
<p><span data-l10n="text-content">Number of tiles in the bag:</span><br /><span id="remaining-letters">102</span><br /><span id="help-bag" data-l10n="text-content">Click on it to take one.</span><a href="#" id="help-clear" style="display:none"></a></p>
<table id="participants">
}
}
--#prefs-sound {
++#prefs {
margin:1ex 0 0 0;
}
--#prefs-sound p {
++#prefs p {
margin:0;
padding:0;
font-size:small
font-size:small;
}
--#prefs-sound input, #prefs-sound label {
++#prefs input, #prefs label {
vertical-align:middle
}
transition: visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s;
}
-}
+ .alert {
+ z-index: 2;
+ }
+
+ #btn-settings {
+ background:lightgray;
+ color:black;
+ font-size:small;
+ border-radius:3px;
+ border:none;
+ margin:0 0 0 auto;
+ min-height: 2em;
+ }
+
+ #btn-settings:before {
+ content: "⚙️ "
+ }
+
+ #info-spell-checking {
+ font-size:small;
+ color:gray;
+ }
+
+ #info-spell-checking a {
+ color:black;
++}
++
+#timer {
+ text-align: center;
+}
++
setConf("ENABLE_EVENT_SOURCE", true);
setConf("MAX_WEBSOCKET_ERRORS", 1);
setConf("APP_PATH", "");
- setConf("APP_PATH", "");
- setConf("ENABLE_TIMER", true);
+ setConf("ENABLE_SPELL_CHECKER", false);
++ setConf("ENABLE_TIMER", true);
const _ = (window.libD && libD.l10n) ? libD.l10n() : function (s) {
return s;
function setCurrentPlayer(player) {
if (currentPlayer && tablePlayers[currentPlayer]) {
tablePlayers[currentPlayer].classList.remove("current-player");
+ localStorage.timerTurn = 0;
}
+ currentTilePlayed = {};
currentPlayer = player;
refreshCurrentPlayer();
}
}
}
+ function initSpellChecker() {
+ if (Conf.ENABLE_SPELL_CHECKER) {
+ document.getElementById("enable-spell-checker-outer").style.display = "";
+ }
+
+ document.getElementById("enable-spell-checker").onclick = spellCheckerSettingChecked;
+
+ if (!Conf.ENABLE_SPELL_CHECKER || localStorage.spellCheckerEnabled === "false") {
+ document.getElementById("check-spelling").style.display = "none";
+ document.getElementById("enable-spell-checker").checked = false;
+ document.getElementById("info-spell-checking").style.display = "none";
+ } else {
+ document.getElementById("check-spelling").style.display = "";
+ document.getElementById("info-spell-checking").style.display = "";
+ document.getElementById("enable-spell-checker").checked = true;
+ }
+ }
+
+ function timerString(delta) {
+ const d = Math.floor(delta / (60 * 60 * 24));
+ const h = Math.floor((delta % (60 * 60 * 24)) / (60 * 60));
+ const m = Math.floor((delta % (60 * 60)) / 60);
+ const s = Math.floor(delta % 60);
+ return ((d > 0) ? format(_("{0}d "), d) : "") +
+ ((h > 0) ? format(_("{0}h "), h) : "") +
+ format(_("{0}' {1}''"), m, s);
+ }
+
+ function initTimer() {
+ if (!Object.prototype.hasOwnProperty.call(localStorage, "timerTurn")) {
+ localStorage.timerTurn = 0;
+ }
+ if (!Object.prototype.hasOwnProperty.call(localStorage, "timerGlobal")) {
+ localStorage.timerGlobal = 0;
+ }
+ if (!Object.prototype.hasOwnProperty.call(localStorage, "timerEnable")) {
+ localStorage.timerEnable = Conf.ENABLE_TIMER;
+ }
+ document.getElementById("enable-timer").onclick = function () {
+ setTimerState(document.getElementById("enable-timer").checked);
+ };
+ setTimerState(localStorage.timerEnable);
+ }
+
+ function setTimerState(state) {
+ if (state) {
+ document.getElementById("timer").style.display = "block";
+ document.getElementById("enable-timer").checked = true;
+ localStorage.timer = setInterval(function () {
+ document.getElementById("timer-turn").innerHTML = timerString(++localStorage.timerTurn);
+ document.getElementById("timer-global").innerHTML = timerString(++localStorage.timerGlobal);
+ }, 1000);
+ } else {
+ document.getElementById("timer").style.display = "none";
+ document.getElementById("enable-timer").checked = false;
+ if (Object.prototype.hasOwnProperty.call(localStorage, "timer")) {
+ clearInterval(localStorage.timer);
+ delete localStorage.timer;
+ }
+ localStorage.timerGlobal = localStorage.timerTurn = 0;
+ }
+ }
+
function repromptName(f) {
if (localStorage.trivabblePlayerName && localStorage.trivabblePlayerName.trim()) {
f();
initChat();
initGame();
initSound();
+ initSpellChecker();
+ initTimer();
};
trivabble.l10nError = trivabble.run;