The tests etc happened to work because it fell back on the non-standard browser behavior of finding the element on the page with the id of 'editor' when the editor variable did not exist in the current scope in one case, and it found a variable bound in an outer scope that happened to be the correct value in the other
This is the first time I've changed the rendering through "extension" code so it is still super messy. This is the beginning of how future extensions can be written though. The selection itself is also still buggy but its getting closer
It /kind of/ works except: * There's not way to trigger it except test functions * It doesn't pay attention to if the cursor is visible * Mouse clicks don't work if scrolled past the first line * The code is super messy * It doesn't work Still, the first steps :)
Rather than overriding and trying to interpret every key pressed, let the default behavior happen if a specific keybinding hasn't been registered over the top. This enables a /ton/ * Weird keyboards * Cross browser input (for unregistered keys) * Paste without flash! (no copy yet) This works by attaching a hidden field when the input goes. If the editor doesn't recognize the keys pressed as a registered binding, the default behavior is executed upon this hidden field and its results inserted into the editor. It is then cleared out.
Hide some of the helper functions so they can't be called from external code. Still need to do some work to figure out what the final API of the display will be, but it should be intelligently chosen, not just every function/method that I've needed