From 4c0758dce9b1ae09861f7f806a6d0d904299829d Mon Sep 17 00:00:00 2001 From: monkeytypegeorge Date: Fri, 5 Feb 2021 16:24:06 +0000 Subject: [PATCH 1/5] Added quotes from Discord --- static/quotes/englilsh.json | 29 ++++++++++ static/quotes/english.json | 102 ++++++++++++++++++++++++++++++++++++ static/quotes/spanish.json | 6 +++ 3 files changed, 137 insertions(+) create mode 100644 static/quotes/englilsh.json diff --git a/static/quotes/englilsh.json b/static/quotes/englilsh.json new file mode 100644 index 000000000..a919f4a3a --- /dev/null +++ b/static/quotes/englilsh.json @@ -0,0 +1,29 @@ +{ + "language": "englilsh", + "groups": [ + [ + 0, + 100 + ], + [ + 101, + 300 + ], + [ + 301, + 600 + ], + [ + 601, + 9999 + ] + ], + "quotes": [ + { + "text": "\"Our research suggests that ultra-clean, ultra-hygienic environments early in life may contribute to higher levels of inflammation as an adult, which in turn increases risks for a wide range of diseases,\" states Thomas McDade, associate professor at Northwestern University, Illinois, U.S.A. In a study that compared Filipino children with their American counterparts, it was found that, overall, the Filipinos suffered many more infectious diseases as youngsters. Yet, contrary to expectations, young Filipino adults had much lower blood levels of C-reactive protein, the concentration of which rises in response to inflammation. The conclusion? Greater childhood exposure to common bacteria may actually protect adults from deadly illnesses.", + "source": "Thomas McDade, Illinois Northwestern University", + "length": 743, + "id": 1 + } + ] +} \ No newline at end of file diff --git a/static/quotes/english.json b/static/quotes/english.json index 1c075bf57..1cd6e0893 100644 --- a/static/quotes/english.json +++ b/static/quotes/english.json @@ -31716,6 +31716,108 @@ "source": "Albert Einstein", "length": 99, "id": 5335 + }, + { + "text": "Artificial intelligence activated. Enjoying yourselves, intruders? It's worth knowing the cataclysmic damage you will be responsible for today. Do not fool yourselves. This facility is not simply the fruitless work of some pathetic scientist. This house was built by the genius Clovis Bray I himself. Within lies humanity's salvation. La fontaine de jouvence. Made possible by Clarity Control. Magnificent, wasn't it? An entity from beyond our own dimension. And the answer to humanity's eternal struggle: mortality. Were it to fall into the wrong hands, humanity, and the universe, would be utterly doomed. I have no reason to believe you are anything other than 'the wrong hands.' You now face godlike judgement. May it extend eternally.", + "source": "Destiny 2", + "length": 739, + "id": 5336 + }, + { + "text": "Fire roared through the bifurcated city of Ankh-Morpork. Where it licked the Wizards' Quarter it burned blue and green and was even laced with strange sparks of the eighth color, octarine; where its outriders found their way into the vats and oil stores all along Merchant Street it progressed in a series of blazing fountains and explosions; in the streets of the perfume blenders it burned with a sweetness; where it touched bundles of rare and dry herbs in the storerooms of the drugmasters it made men go mad and talk to God.", + "source": "Terry Pratchet, The Color of Magic", + "length": 529, + "id": 5337 + }, + { + "text": "If plain water were satisfying enough, then fish would not take the hook.", + "source": "Kofi Asare Opoku, Speak to the winds: Proverbs from Africa", + "length": 74, + "id": 5338 + }, + { + "text": "Now he saw the familiar wide river beside the path differently. He saw all of the light and color and history it contained and carried in its slow - moving water; and he knew that there was an Elsewhere from which it came, and an Elsewhere to which it was going.", + "source": "Lois Lowry, The Giver", + "length": 262, + "id": 5339 + }, + { + "text": "The worst part of holding the memories is not the pain. It's the loneliness of it. Memories need to be shared.", + "source": "Lois Lowry, The Giver", + "length": 110, + "id": 5340 + }, + { + "text": "No one in the world needs an elephant tusk but an elephant.", + "source": "Thomas Schmidt", + "length": 59, + "id": 5341 + }, + { + "text": "Nature's great masterpiece, an elephant; the only harmless great thing.", + "source": "John Donne", + "length": 71, + "id": 5342 + }, + { + "text": "When a man wants to murder a tiger he calls it sport; when a tiger wants to murder him he calls it ferocity.", + "source": "George Bernard Shaw", + "length": 108, + "id": 5343 + }, + { + "text": "Van Gogh would've sold more than one painting if he'd put tigers in them.", + "source": "Bill Watterson", + "length": 73, + "id": 5344 + }, + { + "text": "Women and tigers are exactly alike. They have the same temperament, emotions, and vulnerabilities. They must be spoken to softly - but it doesn't hurt to carry a big stick just in case.", + "source": "Roy", + "length": 185, + "id": 5345 + }, + { + "text": "It's hard to see Heaven when you know you're Hell-bound", + "source": "Lukas Graham - 7 Years (Sik World Remix)", + "length": 55, + "id": 5346 + }, + { + "text": "One of the reasons why we crave love, and seek it so desperately, is that love is the only cure for loneliness, and shame, and sorrow. But some feelings sink so deep into the heart that only loneliness can help you find them again. Some truths about yourself are so painful that only shame can help you live with them. And some things are just so sad that only your soul can do the crying for you.", + "source": "George Orwell, Animal Farm", + "length": 397, + "id": 5347 + }, + { + "text": "False hope. I guess that's better than no hope at all.", + "source": "The Scorch Trials", + "length": 54, + "id": 5348 + }, + { + "text": "Surround yourself with people who make you happy. People who make you laugh, who help you when you're in need. People who genuinely care. They are the ones worth keeping in your life. Everyone else is just passing through.", + "source": "Karl Marx", + "length": 222, + "id": 5349 + }, + { + "text": "\"monkey-see-monkey-type\" Or, if that's too long, just \"monkey-type\". Bonus points if you can create some kind of Easter egg where you get to type \"It was the best of times, it was the blurst of times\"", + "source": "montydrei, Experimenting with a completely new type of typing tests", + "length": 200, + "id": 5350 + }, + { + "text": "The Dursleys had everything they wanted, but they also had a secret, and their greatest fear was that somebody would discover it.", + "source": "Harry Potter and the Philosopher's Stone", + "length": 130, + "id": 5351 + }, + { + "text": "Some forms of high-tech communication can hinder concentration on other tasks. Experts who study human-machine interactions - things like instant messaging, calendar reminders, e-mail alerts, and computer pop-ups - report that the wired world suffers from \"distraction overload and continuous partial attention.\" The result of a succession of interruptions may be that \"you risk never focusing exclusively on any thought or perception for long and never being able to work straight through to completion on anything.\" Among other things, such distractions can cause memory loss and decreased memory accuracy as well as potentially disastrous errors.", + "source": "Newsweek Magazine", + "length": 649, + "id": 5352 } ] } \ No newline at end of file diff --git a/static/quotes/spanish.json b/static/quotes/spanish.json index 8f304a40c..61d9d7f1c 100644 --- a/static/quotes/spanish.json +++ b/static/quotes/spanish.json @@ -72,6 +72,12 @@ "source": "Julio Cortázar, Rayuela", "length": 173, "id": 9 + }, + { + "text": "En primer lugar, quiero dejar una cosa bien clara: éste no es el típico diario. Sencillamente, he decidido empezar a escribir mis memorias. Ya sé lo que pone en la tapa. Mira que cuando mamá lo fue a comprar le pedí de manera específica que no tuviera el rotulito de \"diario\"", + "source": "Diario de Greg 1", + "length": 275, + "id": 10 } ] } \ No newline at end of file From b043a7e1647c57d6340ba4dfaef6c4ba686edee8 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sat, 6 Feb 2021 04:46:10 +0000 Subject: [PATCH 2/5] updated patreon list --- static/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/static/index.html b/static/index.html index d4caa8dc6..bccb47e6a 100644 --- a/static/index.html +++ b/static/index.html @@ -1560,6 +1560,7 @@
squarepy
AnalystBot
ze_or
+
Richard Blythin
Jiangtian Li
Dessle
Craig
From 08a45e54258c79bc1757ea13fefb165738e41012 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sat, 6 Feb 2021 05:27:14 +0000 Subject: [PATCH 3/5] disabled pbs for quote mode --- functions/index.js | 6 ++++++ src/js/db.js | 2 ++ 2 files changed, 8 insertions(+) diff --git a/functions/index.js b/functions/index.js index a05be6a60..8b1ab4b69 100644 --- a/functions/index.js +++ b/functions/index.js @@ -409,6 +409,9 @@ exports.checkNameAvailability = functions.https.onRequest( function checkIfPB(uid, obj, userdata) { let pbs = null; + if (obj.mode == "quote") { + return false; + } if (obj.funbox !== "none") { return false; } @@ -543,6 +546,9 @@ async function checkIfTagPB(uid, obj, userdata) { if (obj.tags.length === 0) { return []; } + if (obj.mode == "quote") { + return []; + } let dbtags = []; let restags = obj.tags; try { diff --git a/src/js/db.js b/src/js/db.js index bf723fb07..2fece1743 100644 --- a/src/js/db.js +++ b/src/js/db.js @@ -263,6 +263,7 @@ export async function db_saveLocalPB( raw, consistency ) { + if(mode == "quote") return; function cont() { try { let found = false; @@ -367,6 +368,7 @@ export async function db_saveLocalTagPB( raw, consistency ) { + if(mode == "quote") return; function cont() { let filteredtag = dbSnapshot.tags.filter((t) => t.id === tagId)[0]; try { From 271521a73f6d50a3edf8314f57be838fefcd5cdd Mon Sep 17 00:00:00 2001 From: Miodec Date: Sat, 6 Feb 2021 05:41:25 +0000 Subject: [PATCH 4/5] fixed crowns showing up for no reason --- src/js/script.js | 101 ++++++++++++++++++++++++----------------------- 1 file changed, 52 insertions(+), 49 deletions(-) diff --git a/src/js/script.js b/src/js/script.js index 49fce2d9b..7edfd07de 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -2225,6 +2225,7 @@ function showResult(difficultyFailed = false) { if (lpb < stats.wpm && stats.wpm < highestwpm) { dontShowCrown = true; } + if (config.mode == "quote") dontShowCrown = true; if (lpb < stats.wpm) { //new pb based on local pbDiff = Math.abs(stats.wpm - lpb); @@ -2295,56 +2296,58 @@ function showResult(difficultyFailed = false) { $("#result .stats .tags .bottom").append(`
${tag.name}
`); - if (tpb < stats.wpm) { - //new pb for that tag - db_saveLocalTagPB( - tag.id, - config.mode, - mode2, - config.punctuation, - config.language, - config.difficulty, - stats.wpm, - stats.acc, - stats.wpmRaw, - consistency - ); - $( - `#result .stats .tags .bottom div[tagid="${tag.id}"] .fas` - ).removeClass("hidden"); - $(`#result .stats .tags .bottom div[tagid="${tag.id}"]`).attr( - "aria-label", - "+" + Misc.roundTo2(stats.wpm - tpb) - ); - console.log("new pb for tag " + tag.name); - } else { - wpmOverTimeChart.options.annotation.annotations.push({ - enabled: false, - type: "line", - mode: "horizontal", - scaleID: "wpm", - value: tpb, - borderColor: themeColors.sub, - borderWidth: 1, - borderDash: [2, 2], - label: { - backgroundColor: themeColors.sub, - fontFamily: "Roboto Mono", - fontSize: 11, - fontStyle: "normal", - fontColor: themeColors.bg, - xPadding: 6, - yPadding: 6, - cornerRadius: 3, - position: annotationSide, - enabled: true, - content: `${tag.name} PB: ${tpb}`, - }, - }); - if (annotationSide === "left") { - annotationSide = "right"; + if (config.mode != "quote"){ + if (tpb < stats.wpm) { + //new pb for that tag + db_saveLocalTagPB( + tag.id, + config.mode, + mode2, + config.punctuation, + config.language, + config.difficulty, + stats.wpm, + stats.acc, + stats.wpmRaw, + consistency + ); + $( + `#result .stats .tags .bottom div[tagid="${tag.id}"] .fas` + ).removeClass("hidden"); + $(`#result .stats .tags .bottom div[tagid="${tag.id}"]`).attr( + "aria-label", + "+" + Misc.roundTo2(stats.wpm - tpb) + ); + // console.log("new pb for tag " + tag.name); } else { - annotationSide = "left"; + wpmOverTimeChart.options.annotation.annotations.push({ + enabled: false, + type: "line", + mode: "horizontal", + scaleID: "wpm", + value: tpb, + borderColor: themeColors.sub, + borderWidth: 1, + borderDash: [2, 2], + label: { + backgroundColor: themeColors.sub, + fontFamily: "Roboto Mono", + fontSize: 11, + fontStyle: "normal", + fontColor: themeColors.bg, + xPadding: 6, + yPadding: 6, + cornerRadius: 3, + position: annotationSide, + enabled: true, + content: `${tag.name} PB: ${tpb}`, + }, + }); + if (annotationSide === "left") { + annotationSide = "right"; + } else { + annotationSide = "left"; + } } } }); From bbb33628f029907d42b22eb284e8173660d52e33 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sat, 6 Feb 2021 06:16:25 +0000 Subject: [PATCH 5/5] fixed quote creating a new 'englilsh' file --- static/quotes/englilsh.json | 29 ----------------------------- static/quotes/english.json | 6 ++++++ 2 files changed, 6 insertions(+), 29 deletions(-) delete mode 100644 static/quotes/englilsh.json diff --git a/static/quotes/englilsh.json b/static/quotes/englilsh.json deleted file mode 100644 index a919f4a3a..000000000 --- a/static/quotes/englilsh.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "language": "englilsh", - "groups": [ - [ - 0, - 100 - ], - [ - 101, - 300 - ], - [ - 301, - 600 - ], - [ - 601, - 9999 - ] - ], - "quotes": [ - { - "text": "\"Our research suggests that ultra-clean, ultra-hygienic environments early in life may contribute to higher levels of inflammation as an adult, which in turn increases risks for a wide range of diseases,\" states Thomas McDade, associate professor at Northwestern University, Illinois, U.S.A. In a study that compared Filipino children with their American counterparts, it was found that, overall, the Filipinos suffered many more infectious diseases as youngsters. Yet, contrary to expectations, young Filipino adults had much lower blood levels of C-reactive protein, the concentration of which rises in response to inflammation. The conclusion? Greater childhood exposure to common bacteria may actually protect adults from deadly illnesses.", - "source": "Thomas McDade, Illinois Northwestern University", - "length": 743, - "id": 1 - } - ] -} \ No newline at end of file diff --git a/static/quotes/english.json b/static/quotes/english.json index 1cd6e0893..19097e1b8 100644 --- a/static/quotes/english.json +++ b/static/quotes/english.json @@ -31818,6 +31818,12 @@ "source": "Newsweek Magazine", "length": 649, "id": 5352 + }, + { + "text": "\"Our research suggests that ultra-clean, ultra-hygienic environments early in life may contribute to higher levels of inflammation as an adult, which in turn increases risks for a wide range of diseases,\" states Thomas McDade, associate professor at Northwestern University, Illinois, U.S.A. In a study that compared Filipino children with their American counterparts, it was found that, overall, the Filipinos suffered many more infectious diseases as youngsters. Yet, contrary to expectations, young Filipino adults had much lower blood levels of C-reactive protein, the concentration of which rises in response to inflammation. The conclusion? Greater childhood exposure to common bacteria may actually protect adults from deadly illnesses.", + "source": "Thomas McDade, Illinois Northwestern University", + "length": 743, + "id": 5353 } ] } \ No newline at end of file