yeah, this is copied directly from the SO link so I didn't even think of changing it (except variable names to make it work).  Hoping to extract all this hacky contenteditable + drag as text input stuff into a plugin (also when I make it not look like shit), so the ugliness would be hidden.