From 01be6603d0e50e0c288c780cad498ba014d6f703 Mon Sep 17 00:00:00 2001 From: decaf Date: Sun, 8 Nov 2020 22:21:48 -0600 Subject: [PATCH 1/3] Added result options to commandline --- src/js/commandline.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/js/commandline.js b/src/js/commandline.js index faf52de62..aa370328c 100644 --- a/src/js/commandline.js +++ b/src/js/commandline.js @@ -614,6 +614,44 @@ let commands = { window.open("https://discord.gg/monkeytype"); }, }, + { + id: "repeatTest", + display: "Repeat test", + exec: () => { + if (resultVisible) { + restartTest(true); + } + }, + }, + { + id: "practiceMissedWords", + display: "Practice missed words", + exec: () => { + if (Object.keys(missedWords).length > 0) { + initPractiseMissedWords(); + } else { + showNotification("You haven't missed any words.", 2000); + } + }, + }, + { + id: "toggleWordHistory", + display: "Toggle word history", + exec: () => { + if (resultVisible) { + toggleResultWordsDisplay(); + } + }, + }, + { + id: "saveScreenshot", + display: "Save screenshot", + exec: () => { + if (resultVisible) { + copyResultToClipboard(); + } + }, + }, ], }; From 2b059bbefa545295f9a2953ae96f90babb466a75 Mon Sep 17 00:00:00 2001 From: decaf Date: Sun, 8 Nov 2020 22:42:31 -0600 Subject: [PATCH 2/3] Added onedark theme --- static/themes/list.json | 5 +++++ static/themes/onedark.css | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 static/themes/onedark.css diff --git a/static/themes/list.json b/static/themes/list.json index 3fa346d8f..d47c3aa99 100644 --- a/static/themes/list.json +++ b/static/themes/list.json @@ -433,5 +433,10 @@ "name": "iceberg_light", "bgColor": "#e8e9ec", "textColor": "#33374c" + }, + { + "name": "onedark", + "bgColor": "#2f343f", + "textColor": "#98c379" } ] diff --git a/static/themes/onedark.css b/static/themes/onedark.css new file mode 100644 index 000000000..ac94e1f58 --- /dev/null +++ b/static/themes/onedark.css @@ -0,0 +1,11 @@ +:root { + --bg-color: #2f343f; + --caret-color: #61afef; + --main-color: #61afef; + --sub-color: #eceff4; + --text-color: #98c379; + --error-color: #e06c75; + --error-extra-color: #d62436; + --colorful-error-color: #d62436; + --colorful-error-extra-color: #ff0019; +} From b376ebf95e768772beb389a0c20c12170b75a920 Mon Sep 17 00:00:00 2001 From: decaf Date: Mon, 9 Nov 2020 17:29:49 -0600 Subject: [PATCH 3/3] Added resultVisible check to missed words command --- src/js/commandline.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/commandline.js b/src/js/commandline.js index aa370328c..a87e0622a 100644 --- a/src/js/commandline.js +++ b/src/js/commandline.js @@ -627,10 +627,12 @@ let commands = { id: "practiceMissedWords", display: "Practice missed words", exec: () => { - if (Object.keys(missedWords).length > 0) { - initPractiseMissedWords(); - } else { - showNotification("You haven't missed any words.", 2000); + if (resultVisible) { + if (Object.keys(missedWords).length > 0) { + initPractiseMissedWords(); + } else { + showNotification("You haven't missed any words.", 2000); + } } }, },