This is a small, but functional, WordPress plugin. It adds a button to the WordPress TinyMCE editor's toolbar which, when clicked, opens a dialog window. This dialog window then inserts a shortcode in the editor.
This plugin was created to accompany a post on my website that I am writing to help my fellow developers utilize TinyMCE to it's fullest in their WordPress plugins.
The source code is heavily commented and documented throughout. If you have a basic understanding of WordPress plugin design and have some exposure to TinyMCE, you can probably figure this out pretty easily from the code. I recommend you start with tinymce-dev-starter.php, then move to tinymce-plugin.js, and finally, end with tinymce-dialog.html.
However, as I mentioned, it is an accompaniement to a tutorial. Check out the tutorial for a step-by-step walkthrough: