msgid "Who's turn? Click on the Turn button!"
msgstr ""
++msgid "Click on (+) to increase someone's score."
++msgstr ""
++
++msgid "Show a cell to everyone by double-clicking on it."
++msgstr ""
++
msgid "Show my rack to other players"
msgstr ""
msgid "Flash light color"
msgstr ""
--msgid "Click on (+) to increase someone's score."
-msgstr ""
-
-msgid "Show a cell to everyone by double-clicking on it."
-msgstr ""
-
+ msgid "Tip!"
msgstr ""
- msgid "Show a cell to everyone by double-clicking on it."
+ msgid "Next tip"
msgstr ""
- msgid "Tip!"
+ msgid "Disable the spell checker"
msgstr ""
- msgid "Next tip"
+ msgid "Spell checking is not available for this language."
+ msgstr ""
+
+ msgid "Score new words"
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 ""
setConf("FLASH_LIGHT_DURATIONS", [800, 1600, 3200]);
setConf("FLASH_LIGHT_DURATION", middle("FLASH_LIGHT_DURATIONS"));
setConf("FLASH_LIGHT_COLOR", "#ee6633");
+ setConf("API_ENTRY_POINT", Conf.APP_PATH + "/:trivabble");
+ setConf("PREMIUM_SEVEN_TILES", 50);
+ setConf("SCORE_LAST_PLAYER", true);
+ setConf("ENABLE_TIMER", true);
+
+ function isSetting(key) {
+ return Object.prototype.hasOwnProperty.call(Conf, key) ||
+ Object.prototype.hasOwnProperty.call(localStorage, key);
+ }
function getSetting(key) {
let type;
function setCurrentPlayer(player) {
if (currentPlayer && tablePlayers[currentPlayer]) {
tablePlayers[currentPlayer].classList.remove("current-player");
+ localStorage.timerTurnDate = timerDate();
}
- currentTilePlayed = {};
currentPlayer = player;
refreshCurrentPlayer();
}
}
}
+ 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 timerDate() {
+ return Math.floor(Date.now() / 1000);
+ }
+
+ function initTimer() {
+ if (!Object.prototype.hasOwnProperty.call(localStorage, "timerTurnDate")) {
+ localStorage.timerTurnDate = timerDate();
+ }
+ if (!Object.prototype.hasOwnProperty.call(localStorage, "timerGlobalDate")) {
+ localStorage.timerGlobalDate = timerDate();
+ }
+ if (!Object.prototype.hasOwnProperty.call(localStorage, "timerEnable")) {
+ localStorage.timerEnable = getSetting("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").textContent = timerString(timerDate() - Number(localStorage.timerTurnDate));
+ document.getElementById("timer-global").textContent = timerString(timerDate() - Number(localStorage.timerGlobalDate));
+ }, 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.timerGlobalDate = localStorage.timerTurnDate = timerDate();
+ }
+ }
+
function repromptName(f) {
- if (getSetting("trivabblePlayerName") && getSetting("trivabblePlayerName").trim()) {
+ if (getSetting("PlayerName") && getSetting("PlayerName").trim()) {
f();
} else {
myPrompt(