The UI of Write a New Note of Facebook is quite straightforward and … shabby:
If you happen to use Firefox, this userscript would make Facebook’s notes suck less.
Exactly the same as WordPress’s quicktags, — no wonder, the core functionality is a port from WordPress’s quicktags.js:
- You may click to button to start a tag, type some words, then click button again to close the tag.
- Select the words, and click the button to surround it with the corresponding tag.
This piece of script is released under the GNU General Public License as WordPress, a compatible license would make my life much easier.
The development is a little bumpy than my expectation. The biggest obstacle in the way is the namespace in Greasemonky is not consistent to the general DOM model. When the page is loaded, GM takes control, we may manipulate the DOM nodes using various ways. When it is done, all the object in GM’s anonymous global namespace runs out of the scope, and they are garbage-collected.