From 2431ae3afa27a171090a183e77024d511990d026 Mon Sep 17 00:00:00 2001 From: Manish Kumar <77256586+m4dd0c@users.noreply.github.com> Date: Sun, 22 Dec 2024 05:08:18 +0530 Subject: chore: fix typo (@m4dd0c) (#6121) --- packages/contracts/src/users.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contracts/src/users.ts b/packages/contracts/src/users.ts index 4a835284e..498f8af62 100644 --- a/packages/contracts/src/users.ts +++ b/packages/contracts/src/users.ts @@ -45,7 +45,7 @@ export const UserNameSchema = doesNotContainProfanity( .max(16) .regex( /^[\da-zA-Z_-]+$/, - "Can only contain lower/uppercase letters, underscare and minus." + "Can only contain lower/uppercase letters, underscore and minus." ) ); -- cgit v1.2.3 From f0a7b82725a1409e4ecc317dbec188d6cbd544c0 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sat, 21 Dec 2024 23:53:59 +0100 Subject: fix: test not failing if min speed check failed on the last second --- frontend/src/ts/test/test-timer.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/ts/test/test-timer.ts b/frontend/src/ts/test/test-timer.ts index 1cbf5e19f..e8ba4416d 100644 --- a/frontend/src/ts/test/test-timer.ts +++ b/frontend/src/ts/test/test-timer.ts @@ -129,7 +129,7 @@ function layoutfluid(): void { function checkIfFailed( wpmAndRaw: { wpm: number; raw: number }, acc: number -): void { +): boolean { if (timerDebug) console.time("fail conditions"); TestInput.pushKeypressesToHistory(); TestInput.pushErrorToHistory(); @@ -143,16 +143,17 @@ function checkIfFailed( SlowTimer.clear(); slowTimerCount = 0; TimerEvent.dispatch("fail", "min speed"); - return; + return true; } if (Config.minAcc === "custom" && acc < Config.minAccCustom) { if (timer !== null) clearTimeout(timer); SlowTimer.clear(); slowTimerCount = 0; TimerEvent.dispatch("fail", "min accuracy"); - return; + return true; } if (timerDebug) console.timeEnd("fail conditions"); + return false; } function checkIfTimeIsUp(): void { @@ -200,8 +201,8 @@ async function timerStep(): Promise { const acc = calculateAcc(); monkey(wpmAndRaw); layoutfluid(); - checkIfFailed(wpmAndRaw, acc); - checkIfTimeIsUp(); + const failed = checkIfFailed(wpmAndRaw, acc); + if (!failed) checkIfTimeIsUp(); if (timerDebug) console.timeEnd("timer step -----------------------------"); } -- cgit v1.2.3 From a670438bb98931ed7f62780293f8eb5dddfddd07 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sun, 22 Dec 2024 00:28:16 +0100 Subject: fix: css funboxes not being applied when logging in --- frontend/src/ts/controllers/account-controller.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/ts/controllers/account-controller.ts b/frontend/src/ts/controllers/account-controller.ts index 70191802c..c60b5d21e 100644 --- a/frontend/src/ts/controllers/account-controller.ts +++ b/frontend/src/ts/controllers/account-controller.ts @@ -48,6 +48,7 @@ import { navigate } from "./route-controller"; import { FirebaseError } from "firebase/app"; import * as PSA from "../elements/psa"; import defaultResultFilters from "../constants/default-result-filters"; +import { getActiveFunboxes } from "../test/funbox/list"; export const gmailProvider = new GoogleAuthProvider(); export const githubProvider = new GithubAuthProvider(); @@ -171,6 +172,11 @@ async function getDataAndInit(): Promise { ); await UpdateConfig.apply(snapshot.config); UpdateConfig.saveFullConfigToLocalStorage(true); + + //funboxes might be different and they wont activate on the account page + for (const fb of getActiveFunboxes()) { + fb.functions?.applyGlobalCSS?.(); + } } AccountButton.loading(false); TagController.loadActiveFromLocalStorage(); -- cgit v1.2.3 From baaea33490e889c987844771de64a1fa9202e097 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sun, 22 Dec 2024 00:28:50 +0100 Subject: refactor: ready function now awaits config to be loaded to avoid concurrency issues --- frontend/src/ts/ready.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/src/ts/ready.ts b/frontend/src/ts/ready.ts index e1b923688..695c82478 100644 --- a/frontend/src/ts/ready.ts +++ b/frontend/src/ts/ready.ts @@ -8,8 +8,10 @@ import * as AccountButton from "./elements/account-button"; import Konami from "konami"; import * as ServerConfiguration from "./ape/server-configuration"; import { getActiveFunboxes } from "./test/funbox/list"; +import { loadPromise } from "./config"; -$((): void => { +$(async (): Promise => { + await loadPromise; Misc.loadCSS("/css/slimselect.min.css", true); Misc.loadCSS("/css/balloon.min.css", true); @@ -19,11 +21,10 @@ $((): void => { //to make sure the initial theme application doesnt animate the background color $("body").css("transition", "background .25s, transform .05s"); MerchBanner.showIfNotClosedBefore(); - setTimeout(() => { - for (const fb of getActiveFunboxes()) { - fb.functions?.applyGlobalCSS?.(); - } - }, 500); //this approach will probably bite me in the ass at some point + + for (const fb of getActiveFunboxes()) { + fb.functions?.applyGlobalCSS?.(); + } $("#app") .css("opacity", "0") -- cgit v1.2.3 From c18feb07481af6152c445327105876760ed95dd0 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sun, 22 Dec 2024 00:31:51 +0100 Subject: chore: add additional isAuthenticated check in case user logs out during the request --- frontend/src/ts/db.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/ts/db.ts b/frontend/src/ts/db.ts index ff437e07f..8accd57c2 100644 --- a/frontend/src/ts/db.ts +++ b/frontend/src/ts/db.ts @@ -372,6 +372,9 @@ export async function getUserResults(offset?: number): Promise { return false; } + //another check in case user logs out while waiting for response + if (!isAuthenticated()) return false; + const results: SnapshotResult[] = response.body.data.map((result) => { if (result.bailedOut === undefined) result.bailedOut = false; if (result.blindMode === undefined) result.blindMode = false; -- cgit v1.2.3 From a1397b798130818bd457292180bebc688ce47541 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sun, 22 Dec 2024 00:37:34 +0100 Subject: fix(language): remove non-polish word closes #6120 --- frontend/static/languages/polish_2k.json | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/static/languages/polish_2k.json b/frontend/static/languages/polish_2k.json index e004e46d8..3eba85e53 100644 --- a/frontend/static/languages/polish_2k.json +++ b/frontend/static/languages/polish_2k.json @@ -2039,7 +2039,6 @@ "Bóg", "wybrać", "zjawisko", - "abugida", "według", "kara", "czas", -- cgit v1.2.3 From 775908026fd9b9940caf7b90c98500fb70832c2b Mon Sep 17 00:00:00 2001 From: mak448a Date: Sat, 21 Dec 2024 17:44:14 -0600 Subject: impr(quotes): grammar fix for English quote 192 (@mak448a) (#6118) --- frontend/static/quotes/english.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/static/quotes/english.json b/frontend/static/quotes/english.json index 202b69bd2..28a20306c 100644 --- a/frontend/static/quotes/english.json +++ b/frontend/static/quotes/english.json @@ -1094,7 +1094,7 @@ "length": 204 }, { - "text": "There are mysteries to the universe we were never meant to solve, but who we are and why we are here, are not among them, those answers we carry inside.", + "text": "There are mysteries to the universe we were never meant to solve. But who we are and why we are here, are not among them. Those answers we carry inside.", "source": "Transformers: Age of Extinction", "id": 192, "length": 152 -- cgit v1.2.3 From 772e4a1d014c096e9723574bea347ec0581045e7 Mon Sep 17 00:00:00 2001 From: igs <34313633+iggedi-ig-ig@users.noreply.github.com> Date: Sun, 22 Dec 2024 00:45:00 +0100 Subject: feat(language): add code_typst (@iggedi-ig-ig) (#6117) --- frontend/static/languages/_groups.json | 1 + frontend/static/languages/_list.json | 1 + frontend/static/languages/code_typst.json | 50 +++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 frontend/static/languages/code_typst.json diff --git a/frontend/static/languages/_groups.json b/frontend/static/languages/_groups.json index 6335a4790..512b259e1 100644 --- a/frontend/static/languages/_groups.json +++ b/frontend/static/languages/_groups.json @@ -606,6 +606,7 @@ "code_lua", "code_luau", "code_latex", + "code_typst", "code_matlab", "code_sql", "code_perl", diff --git a/frontend/static/languages/_list.json b/frontend/static/languages/_list.json index c6b02836b..460cfbd13 100644 --- a/frontend/static/languages/_list.json +++ b/frontend/static/languages/_list.json @@ -339,6 +339,7 @@ ,"code_lua" ,"code_luau" ,"code_latex" + ,"code_typst" ,"code_matlab" ,"code_sql" ,"code_perl" diff --git a/frontend/static/languages/code_typst.json b/frontend/static/languages/code_typst.json new file mode 100644 index 000000000..bd9f85323 --- /dev/null +++ b/frontend/static/languages/code_typst.json @@ -0,0 +1,50 @@ +{ + "name": "code_typst", + "noLazyMode": true, + "ligatures": false, + "words": [ + "#use", + "#set par(justify: true)", + "#show", + "#set", + "#let", + "#par", + "#figure", + "#underline", + "#smallcaps", + "#grid", + "#box", + "#place", + "#import", + "#link", + "#lorem(50)", + "let", + "#{", + "}", + "#(", + ")", + "#[", + "]", + "$", + "@", + "*", + "-", + "_", + "\\", + "/", + "//", + "floor(x)", + "cal(A)", + "NN", + "RR", + ">", + "<", + ">=", + "gt.eq.not", + "sum_(k=1)^oo", + "pi", + "&=", + "vec", + "mat" + ] +} -- cgit v1.2.3 From 7d53e9eba3ab63c85ce1b9665a0505fb2f18a229 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sun, 22 Dec 2024 00:57:58 +0100 Subject: impr(typing): add ʻ to the list of interchangable 'quotelike' characters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this means it can be typed correctly with the usual ' --- frontend/src/ts/controllers/input-controller.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/ts/controllers/input-controller.ts b/frontend/src/ts/controllers/input-controller.ts index dcb263ca9..50a7c8bc4 100644 --- a/frontend/src/ts/controllers/input-controller.ts +++ b/frontend/src/ts/controllers/input-controller.ts @@ -425,12 +425,14 @@ function isCharCorrect(char: string, charIndex: number): boolean { char === "‘" || char === "'" || char === "ʼ" || - char === "׳") && + char === "׳" || + char === "ʻ") && (originalChar === "’" || originalChar === "‘" || originalChar === "'" || originalChar === "ʼ" || - originalChar === "׳") + originalChar === "׳" || + originalChar === "ʻ") ) { return true; } -- cgit v1.2.3 From 4baae8fe37ae1b4938d7f59d0ab2ec6b35427fbc Mon Sep 17 00:00:00 2001 From: Kevin Petit <46157744+petieken@users.noreply.github.com> Date: Sun, 22 Dec 2024 12:07:57 +0100 Subject: impr(quotes): added dutch quotes (@petieken) (#6114) ### Description Added Dutch quotes. Dutch quotes translation: - "Give all your money to the poor people... If they do the same maybe you'll get it back tomorrow." - "Remove the word 'me' from the language use and the whole humanity is perplexed and has panic sweat on their forehead." - "A James Bond novel is stupid but exciting, while a masterpiece of Flemish literature is equally stupid but boring as well." - "I am absolutely against the purity of the language. If it brings something essential, you should cultivate Anglicisms, Germanisms and Gallicisms immediately. I do not believe in the thinned-out, which is presented as the only Dutch, I am irritated by the Dutch domination." ### Checks - [X ] Adding quotes? - [X ] Make sure to include translations for the quotes in the description (or another comment) so we can verify their content. - [x] Adding a language or a theme? - [x] If is a language, did you edit `_list.json`, `_groups.json` and add `languages.json`? - [x] If is a theme, did you add the theme.css? - Also please add a screenshot of the theme, it would be extra awesome if you do so! - [x] Check if any open issues are related to this PR; if so, be sure to tag them below. - [x] Make sure the PR title follows the Conventional Commits standard. (https://www.conventionalcommits.org for more info) - [x] Make sure to include your GitHub username prefixed with @ inside parentheses at the end of the PR title. Closes # --- frontend/static/quotes/dutch.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/frontend/static/quotes/dutch.json b/frontend/static/quotes/dutch.json index bc716cd88..fad54d712 100644 --- a/frontend/static/quotes/dutch.json +++ b/frontend/static/quotes/dutch.json @@ -396,6 +396,30 @@ "source": "Etty Hillesum", "length": 95, "id": 65 + }, + { + "text": "Geef al uw geld aan de arme mensen... als zij hetzelfde doen heb je het morgen misschien al terug.", + "source": "Herman Brusselmans", + "length": 98, + "id": 66 + }, + { + "text": "Schrap het woord 'ik' uit het taalgebruik en de hele mensheid staat met de mond vol tanden en het paniekzweet op het voorhoofd.", + "source": "Herman Brusselmans", + "length": 127, + "id": 67 + }, + { + "text": "Een James Bond-boek is stom maar opwindend, terwijl een meesterwerk van de Vlaamse literatuur even stom maar daarbij ook nog vervelend is.", + "source": "Louis Paul Boon", + "length": 138, + "id": 68 + }, + { + "text": "Ik ben absoluut tegen de puurheid van de taal. Als het iets wezenlijks meebrengt, moet je anglicismen, germanismen en gallicismen meteen cultiveren. Ik geloof niet in het uitgedunde, dat men voorhoudt als het enige Nederlands, ik irriteer me aan de Nederlandse overheersing.", + "source": "Hugo Claus", + "length": 274, + "id": 69 } ] } -- cgit v1.2.3