From f1bcc7b7f64b2e1b5e2299f0b20be47338f34146 Mon Sep 17 00:00:00 2001 From: Estebene <49330942+Estebene@users.noreply.github.com> Date: Mon, 20 Dec 2021 04:40:32 +1300 Subject: [PATCH 1/5] Tried to fix Wikipedia newline issue (#2193) by Estebene --- src/js/test/wikipedia.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/js/test/wikipedia.js b/src/js/test/wikipedia.js index 28c3ece9f..06eb677a2 100644 --- a/src/js/test/wikipedia.js +++ b/src/js/test/wikipedia.js @@ -46,6 +46,11 @@ export async function getSection() { sectionText = sectionText.replace(/\s+/g, " "); sectionText = sectionText.trim(); + // Add spaces + sectionText = sectionText.replace(/[a-zA-Z0-9]{3,}\.[a-zA-Z]/g, (x) => + x.replace(/\./, ". ") + ); + sectionText.split(" ").forEach((word) => { words.push(word); }); From d6d64366e5780557652a93368eb65498edc2e347 Mon Sep 17 00:00:00 2001 From: Estebene <49330942+Estebene@users.noreply.github.com> Date: Mon, 20 Dec 2021 04:41:15 +1300 Subject: [PATCH 2/5] Added functionality so that you fail on incorrect opposite shift for master and expert mode (#2190) by Estebene * Added fail on incorrect opposite shift for master and expert mode * Changed so the test only fails on master mode --- src/js/input-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/input-controller.js b/src/js/input-controller.js index 27562c508..b854e017a 100644 --- a/src/js/input-controller.js +++ b/src/js/input-controller.js @@ -428,7 +428,7 @@ function handleChar(char, charIndex) { } } - if (!correctShiftUsed) return; + if (!correctShiftUsed && Config.difficulty != "master") return; //update current corrected version. if its empty then add the current char. if its not then replace the last character with the currently pressed one / add it if (TestLogic.corrected.current === "") { From 0ece272c5eb401b9ab53ce31a3d496515ff8d8f4 Mon Sep 17 00:00:00 2001 From: sombre-hombre Date: Mon, 20 Dec 2021 16:03:21 +0300 Subject: [PATCH 3/5] Fixed typo in russian quotes (#2199) --- static/quotes/russian.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/quotes/russian.json b/static/quotes/russian.json index 9e049b26c..0fa97380f 100644 --- a/static/quotes/russian.json +++ b/static/quotes/russian.json @@ -820,8 +820,8 @@ { "id": 136, "source": "Лу Эрленд - У", - "text": "Занятно, оказывается, принимаются решения! Только что ты не знал, что делать, и вдруг, в следующую секунду, знаешь! Что-то такое происодит с тобой в одну секунду. Ты прокручиваешь в голове бесчисленные варианты и вдруг думаешь: на то-то и то-то я не буду обращать внимания, приоритетным для меня является то-то и то-то, и поэтому я принимаю такое-то и такое-то решение. Потрясающий процесс! Мозг всё расставил по полочкам. Отсеивает негодные варианты, пока не остаётся один-единственный. Сигналы забегали туда-сюда - и готово. Очень тонкий инструмент.", - "length": 551 + "text": "Занятно, оказывается, принимаются решения! Только что ты не знал, что делать, и вдруг, в следующую секунду, знаешь! Что-то такое происходит с тобой в одну секунду. Ты прокручиваешь в голове бесчисленные варианты и вдруг думаешь: на то-то и то-то я не буду обращать внимания, приоритетным для меня является то-то и то-то, и поэтому я принимаю такое-то и такое-то решение. Потрясающий процесс! Мозг всё расставил по полочкам. Отсеивает негодные варианты, пока не остаётся один-единственный. Сигналы забегали туда-сюда - и готово. Очень тонкий инструмент.", + "length": 552 }, { "id": 137, From 8156c483a596fa015b523569462b05d92869f18c Mon Sep 17 00:00:00 2001 From: Ferotiq <64989416+Ferotiq@users.noreply.github.com> Date: Mon, 20 Dec 2021 07:05:02 -0600 Subject: [PATCH 4/5] Completely Fix Wikipedia Spacing (#2195) by Ferotiq --- src/js/test/wikipedia.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/js/test/wikipedia.js b/src/js/test/wikipedia.js index 06eb677a2..04d031c22 100644 --- a/src/js/test/wikipedia.js +++ b/src/js/test/wikipedia.js @@ -30,7 +30,7 @@ export async function getSection() { rej(randomPostReq.status); } - const sectionURL = `https://en.wikipedia.org/w/api.php?action=query&format=json&pageids=${pageid}&prop=extracts&exintro=true&explaintext=true&origin=*`; + const sectionURL = `https://en.wikipedia.org/w/api.php?action=query&format=json&pageids=${pageid}&prop=extracts&exintro=true&origin=*`; var sectionReq = new XMLHttpRequest(); sectionReq.onload = () => { @@ -42,14 +42,16 @@ export async function getSection() { let words = []; // Remove non-ascii characters, double whitespaces and finally trailing whitespaces. + sectionText = sectionText.replace(/<\/p>

+/g, " "); + sectionText = $("

").html(sectionText).text(); sectionText = sectionText.replace(/[\u{0080}-\u{10FFFF}]/gu, ""); sectionText = sectionText.replace(/\s+/g, " "); sectionText = sectionText.trim(); - // Add spaces - sectionText = sectionText.replace(/[a-zA-Z0-9]{3,}\.[a-zA-Z]/g, (x) => - x.replace(/\./, ". ") - ); + // // Add spaces + // sectionText = sectionText.replace(/[a-zA-Z0-9]{3,}\.[a-zA-Z]/g, (x) => + // x.replace(/\./, ". ") + // ); sectionText.split(" ").forEach((word) => { words.push(word); From 5aa781fdfc411ad7008c4c1c1b35dbf8ec2704e2 Mon Sep 17 00:00:00 2001 From: Estebene <49330942+Estebene@users.noreply.github.com> Date: Tue, 21 Dec 2021 02:07:27 +1300 Subject: [PATCH 5/5] Added redirect to quote submission page when a language has no quotes (#2196) by Estebene --- src/js/test/test-logic.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/test/test-logic.js b/src/js/test/test-logic.js index b2b7cd9a4..c2d481f3c 100644 --- a/src/js/test/test-logic.js +++ b/src/js/test/test-logic.js @@ -20,6 +20,7 @@ import * as TimerProgress from "./timer-progress"; import * as ChartController from "./chart-controller"; import * as UI from "./ui"; import * as QuoteSearchPopup from "./quote-search-popup"; +import * as QuoteSubmitPopup from "./quote-submit-popup"; import * as PbCrown from "./pb-crown"; import * as TestTimer from "./test-timer"; import * as OutOfFocus from "./out-of-focus"; @@ -970,11 +971,14 @@ export async function init() { let quotes = await Misc.getQuotes(Config.language.replace(/_\d*k$/g, "")); if (quotes.length === 0) { + TestUI.setTestRestarting(false); Notifications.add( `No ${Config.language.replace(/_\d*k$/g, "")} quotes found`, 0 ); - TestUI.setTestRestarting(false); + if (firebase.auth().currentUser) { + QuoteSubmitPopup.show(false); + } UpdateConfig.setMode("words"); restart(); return;