A super simple app that replaces spaces with underscores in pasted text.
The tool no longer relies on the prompt method.
It now uses an "onpaste" event listener in the markup, which triggers the replace function after a 4ms delay. The delay is added because "onpaste" triggers directly after the paste event, before the text is pasted. 4ms is the minimum delay of the setTimeout function as per HTML 5.
The can now complete space replacement in 4 steps:
- Open Space Replacer
- Ctrl+V
- Ctrl+C
- Close Space Replacer (Ctrl+W)
Next step should be browser plug-in integration and a keyboard shortcut, reducing the number of steps to one.
Added some styling in-line. Can consider moving it to CSS in future versions.