From c8764790b8d4f235382a3794dfe5413badf604ec Mon Sep 17 00:00:00 2001 From: Joel Bradshaw Date: Fri, 30 Oct 2020 01:06:46 -0700 Subject: [PATCH 1/4] Remove private methods from simplePopup The added simplePopup had private methods, which totally breaks Firefox and Safari since it's a syntax error and this file then doesn't load at all. We can simply make these methods public, there's no reason they need to be private to work, it's just a code organization thing. --- public/js/misc.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/js/misc.js b/public/js/misc.js index 06bd35b5d..c368243e6 100644 --- a/public/js/misc.js +++ b/public/js/misc.js @@ -510,7 +510,7 @@ class SimplePopup { this.element = $("#simplePopup"); this.buttonText = buttonText; } - #reset() { + reset() { this.element.html(`
@@ -518,11 +518,11 @@ class SimplePopup {
`); } - #init() { + init() { let el = this.element; el.find("input").val(""); if (el.attr("popupId") !== this.id) { - this.#reset(); + this.reset(); el.attr("popupId", this.id); el.find(".title").text(this.title); el.find(".text").text(this.text); @@ -546,7 +546,7 @@ class SimplePopup { } show() { - this.#init(); + this.init(); this.wrapper .stop(true, true) .css("opacity", 0) From 08cbb8cb30095d513f27b49d962d7bee7ed1da7c Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 30 Oct 2020 12:17:41 +0000 Subject: [PATCH 2/4] using experimanetal long polling to hopefully fix account issues --- public/js/db.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/js/db.js b/public/js/db.js index 70aecc002..81b6c5643 100644 --- a/public/js/db.js +++ b/public/js/db.js @@ -1,4 +1,5 @@ const db = firebase.firestore(); +db.settings({experimentalForceLongPolling: true}); let dbSnapshot = null; From aa6d27586aa60e7813a1a980dc68130d21ccf651 Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 30 Oct 2020 14:20:46 +0000 Subject: [PATCH 3/4] fixed practise missed words not working when practising after a practise --- public/js/script.js | 46 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/public/js/script.js b/public/js/script.js index b7d16f39d..0da60940b 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -4381,22 +4381,28 @@ $(document.body).on("click", "#restartTestButton", (event) => { restartTest(); }); +function initPractiseMissedWords() { + let currentMode = config.mode; + changeMode("custom"); + let newCustomText = []; + Object.keys(missedWords).forEach((missedWord) => { + for (let i = 0; i < missedWords[missedWord]; i++) { + newCustomText.push(missedWord); + } + }); + customText = newCustomText; + customTextIsRandom = true; + customTextWordCount = 50; + let mode = modeBeforePractise === null ? currentMode : modeBeforePractise; + modeBeforePractise = null; + restartTest(); + modeBeforePractise = mode; +} + $(document).on("keypress", "#practiseMissedWordsButton", (event) => { if (event.keyCode == 13) { if (Object.keys(missedWords).length > 0) { - let currentMode = config.mode; - changeMode("custom"); - let newCustomText = []; - Object.keys(missedWords).forEach((missedWord) => { - for (let i = 0; i < missedWords[missedWord]; i++) { - newCustomText.push(missedWord); - } - }); - customText = newCustomText; - customTextIsRandom = true; - customTextWordCount = 50; - restartTest(); - modeBeforePractise = currentMode; + initPractiseMissedWords(); } else { showNotification("You haven't missed any words.", 2000); } @@ -4405,19 +4411,7 @@ $(document).on("keypress", "#practiseMissedWordsButton", (event) => { $(document.body).on("click", "#practiseMissedWordsButton", (event) => { if (Object.keys(missedWords).length > 0) { - let currentMode = config.mode; - changeMode("custom"); - let newCustomText = []; - Object.keys(missedWords).forEach((missedWord) => { - for (let i = 0; i < missedWords[missedWord]; i++) { - newCustomText.push(missedWord); - } - }); - customText = newCustomText; - customTextIsRandom = true; - customTextWordCount = 50; - restartTest(); - modeBeforePractise = currentMode; + initPractiseMissedWords(); } else { showNotification("You haven't missed any words.", 2000); } From 7995e6bfbdba6535c55bc97e4aacd469f6cf9631 Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 30 Oct 2020 15:59:18 +0000 Subject: [PATCH 4/4] fixed keymap being messed up by the iso change added an iso flag to the layout that needs it displaying iso key if needed added two colemak iso layouts --- public/css/style.scss | 11 +- public/index.html | 108 ++++++-------- public/js/layouts.js | 314 +++++++++++++++++++++++++--------------- public/js/script.js | 2 +- public/js/userconfig.js | 138 +++++++++++------- 5 files changed, 333 insertions(+), 240 deletions(-) diff --git a/public/css/style.scss b/public/css/style.scss index d3bda77b5..a594acfa5 100644 --- a/public/css/style.scss +++ b/public/css/style.scss @@ -3037,28 +3037,27 @@ key { .r1 { display: grid; - grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 2fr; - opacity: 0; + grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr; } .r2 { display: grid; - grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1.5fr; + grid-template-columns: 0.5fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1rem; } .r3 { display: grid; - grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 2fr; + grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr; } .r4 { display: grid; - grid-template-columns: 2.5fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 2.5fr; + grid-template-columns: 0.5fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 2.75fr; } .r5 { display: grid; - grid-template-columns: 4fr 5.5fr 4fr; + grid-template-columns: 3.5fr 6fr 3.5fr; // &.matrixSpace { // // grid-template-columns: 6.75fr 1.9fr 6.75fr; // grid-template-columns: 6.9fr 4.6fr 6.9fr; // wider spacebar diff --git a/public/index.html b/public/index.html index b2e28dbd5..9fb7f1099 100644 --- a/public/index.html +++ b/public/index.html @@ -952,56 +952,47 @@
123