Commit graph

5232 commits

Author SHA1 Message Date
Jack
1cb0c8d2a2 fixed sound not playing on backspace 2021-09-30 13:50:44 +01:00
Jack
e5eec1220f fixed layout emulation causing undefined to be entered as text 2021-09-30 13:46:34 +01:00
Jack
7ef93b6f22 fixed enter key support 2021-09-30 13:41:28 +01:00
Jack
ac23609ab2 added sound on click 5 (typewriter) 2021-09-30 01:06:04 +01:00
Jack
164ea185d4 fixed hide extra letter breaking input highlighting 2021-09-30 00:39:07 +01:00
SeerLite
c323efea26
Rewrite input system to use <input> content (#1325)
* Rewrite input system to use <input> content

* Tab/Escape, Backspace and Enter are always handled by
  $(document).keydown.
* The rest of characters are handled by either $("#wordsInput").on("input")
  (default) or $(document).keydown (layout emulation).
* New special handling for dead keys, compose keys and diacritics in
  general with the new regex Misc.trailingComposeChars.

input-controller.js has been updated to use the above changes:
* handleBackspace() replaced with simplified backspaceToPrevious().
  On PC, a space is immediately re-added to the end of the input to make
  use of the browser/OS's Backspace. This lets the browser handle input-
  specific things like ctrl+backspace.
* handleSpace() refactored a bit to repeat less logic when word is correct
  or incorrect.

* test-ui.js updated to highlight the Misc.trailingComposeChars
correctly, and also refactored a bit to make logic easier to follow.

* AFK checking has also been simplified, now just set with a boolean
flag (TestStats.) setKeypressNotAfk() instead of checking every key and
modifier press (so incrementKeypressMod() was removed as it wasn't used
for anything else).

* Refactor input controller

New function isCharCorrect().

* Remove caps lock backspace setting

Not supported with the input rewrite anymore because we're relying on the
browser's/OS's actual backspace effects. There's no way to emulate this
keypress.

* Refactor input controller

* Reimplement opposite shift mode

* Reimplement the layout emulator

* Fix replay events for input rewrite

Now it's more flexible for a variable amount of backspacing or letter
replacing.

* Pad input with space to handle backspace on mobile

Backspace isn't fired as an event on current mobile browsers, so I worked
around that by adding a permanent space at the start of the input and
treating its removal as a fallback to Backspace to the previous word.

* Force caret to end of input on focus

Fixes initial selection on iOS.

* Use offsetTop from the DOM instead of TestUI

I didn't wanna mess too much with what happens in test-ui.js. Basically,
on a restart after having completed a test, TestUI.activeWordTop is always
wrong for some reason. This caused swipe/instant input after a restart to
always drop the first few characters.

* Prevent pasting on the input

* Revert "Reimplement opposite shift mode"

This reverts commit 9a716ad39b004f0719b05f486465ea03060430ca.

* Use key code to check opposite shift usage

Today I learned what closure actually meant.

* Accept all whitespace as word space
2021-09-30 00:22:38 +01:00
Aaron
6039820c26
Update CONTRIBUTING.md (#1915) 2021-09-29 23:25:58 +01:00
Aaron
403d36368e
Update README.md (#1912) 2021-09-29 17:04:10 +01:00
Jack
614f7fde03 marking all results coming from the input rewrite 2021-09-29 14:21:35 +01:00
Jack
83422d2f99
Update CONTRIBUTING.md 2021-09-29 01:48:42 +01:00
Jack
3316d58ac8 fixed broken list 2021-09-29 01:44:41 +01:00
Jack
8d35c54086 clarified a step. i would like to dedicate this commit to SeerLite 2021-09-29 01:43:20 +01:00
Jack
3d9c5f1fb1 fixed infinite loop causing website to freeze 2021-09-28 18:51:57 +01:00
Jack
d089a773f7 not rounding if mode is exact 2021-09-27 23:56:43 +01:00
Jack
a65f017431 added stddev and avg to stats function 2021-09-27 21:25:24 +01:00
ballerboo
bb168aa994
update boo layout (#1908) 2021-09-27 18:51:50 +01:00
Jack
26372eb820 Merge branch 'master' of https://github.com/Miodec/monkey-type 2021-09-27 01:26:49 +01:00
Jack
e30c71878e fixed showalllines breaking quote mode,
hiding quote rating button by default
2021-09-27 01:25:29 +01:00
Jack
b52d58e9f8 fixed quote ratings resetting after submitting a rating 2021-09-27 01:25:26 +01:00
Jack
cd77779475 quotes now use the words bound system, fixes plus one and two funboxes not working for quotes 2021-09-27 00:55:16 +01:00
Jack
c00dfc2385 only checking active word when needed 2021-09-27 00:00:48 +01:00
Jack
4aae37413d updating icon after submitting rating 2021-09-26 20:38:37 +01:00
Jack
3d479d5eb5 reduced image size 2021-09-26 20:31:54 +01:00
refact0r
3eea87c803
fix background color input border (#1907) by refact0r 2021-09-26 18:59:08 +01:00
Jack
f8bbe88bcf adjusted scrolling 2021-09-26 15:59:42 +01:00
Jack
4ec9ff3d54 fixed pb tables popup first table header not updating 2021-09-25 21:55:19 +01:00
Jack
c1b59e9f17 updated apple touch icons 2021-09-25 14:10:24 +01:00
Jack
fb64ad62fa more compact log 2021-09-25 13:54:12 +01:00
Jack
0fb3e2ae04 left out object parameter 2021-09-25 13:53:15 +01:00
Jack
d2e5c0afab only adding device when needed 2021-09-25 13:52:09 +01:00
Jack
860de29955 better agent log 2021-09-25 13:49:46 +01:00
Jack
a9a9afa2e4 added ip and useragent logging 2021-09-25 13:38:59 +01:00
Jack
05c639117b fixed legacy pbs causing issues 2021-09-25 01:02:17 +01:00
Jack
71fcef7e04 Merge branch 'master' of https://github.com/Miodec/monkey-type 2021-09-24 22:23:36 +01:00
Jack
590ade59c6 not saving pb if test was bailed out 2021-09-24 22:22:39 +01:00
Miodec
5f6b6c15f8 added popup to view all personal bests 2021-09-24 20:22:08 +01:00
Miodec
bc40ff48d2 updated package 2021-09-24 17:07:41 +01:00
Miodec
53e3cea31d updated spelling 2021-09-24 17:00:50 +01:00
Jack
843bee022b removed / adjusted some quotes 2021-09-24 00:38:55 +01:00
Jack
e0b0a809db Merge branch 'master' of https://github.com/Miodec/monkey-type 2021-09-23 22:56:45 +01:00
Jack
7dc91cd797 fixed indonesian quotes 2021-09-23 22:56:38 +01:00
Michael
b0b48292b9
Fix spelling error in german.json (#1901) by kemonprogrammer
"Frucht" means fruit, "Furcht" means fear.
Additional source: http://www.worte-projekt.de/herbert.html
2021-09-23 22:54:47 +01:00
Jack
3b6fb2d3b3 fixed name change when logged in with google 2021-09-23 15:06:05 +01:00
Jack
cc1ccf6d9a fixed dissapearing input 2021-09-23 14:58:54 +01:00
Jack
fcbfbeb893 fixed chaos theory not working 2021-09-23 14:57:58 +01:00
Jack
14bf670ae1 Merge branch 'master' of https://github.com/Miodec/monkey-type 2021-09-22 23:54:53 +01:00
Jack
c745d5e3ce initialising error sound only when its needed 2021-09-22 23:32:28 +01:00
Jack
9cd89f768b added arabic mac 2021-09-22 23:28:16 +01:00
Miigon
999779677a
completed lazy mode for chinese pinyin (#1866) by Miigon
* completed lazy mode for chinese pinyin

* lazy-mode accent override for pinyin 'ü'

* lazy-mode accent override for chinese pinyin
2021-09-22 14:37:42 +01:00
Jack
5767daa27b logs 2021-09-21 23:24:30 +01:00