Updated 2017 to support TinyMCE Version 4.6.6
Note: ed.onChange.add(function(..)) doesn't work in the new version and it has to be substituted with ed.on('MouseUp',function(...))
Also the TinyMCE "tinyMCE.execCommand('mceInsertContent',..." can be substituted with
"tinymce.activeEditor.insertContent(..." in the new version of TinyMCE
SO question: https://stackoverflow.com/questions/21854798/insert-an-image-into-a-tinymce-editor
Updated 2017 to support TinyMCE Version 4.6.6
Note: ed.onChange.add(function(..)) doesn't work in the new version and it has to be substituted with ed.on('MouseUp',function(...))
Also the TinyMCE "tinyMCE.execCommand('mceInsertContent',..." can be substituted with
"tinymce.activeEditor.insertContent(..." in the new version of TinyMCE
SO question: https://stackoverflow.com/questions/21854798/insert-an-image-into-a-tinymce-editor