If you connect the min library, then:
../plugins/pasteImage/plugin.min.js
If full , then
../plugins/pasteImage/plugin.js
Plugin content:
tinymce.PluginManager.add('PasteImage', function(editor, url) { // Adds a menu item to the tools menu editor.addMenuItem('PasteImage', { text: 'PasteImage plugin', context: 'tools', onclick: function() { var images = [ {image: 'https://secure.gravatar.com/avatar/870c227ab02e5c61101a8265cdd14989?s=128&d=identicon&r=g' , id: '120'}, {image: 'https://secure.gravatar.com/avatar/870c227ab02e5c61101a8265cdd14989?s=128&d=identicon&r=g' , id: '123'}, {image: 'https://secure.gravatar.com/avatar/870c227ab02e5c61101a8265cdd14989?s=128&d=identicon&r=g' , id: '142'}, ]; for(var i=0, html = ''; i < images.length; i++) { html += "<img src='" + images[i].image + "' style='width:190px;margin: 10px;' data-paste='{images-" + images[i].id + "}'>"; } // Open window with a specific url editor.windowManager.open({ title: 'Choise image', width: 600, height: 400, html: html, buttons: [{text: 'Закрыть', onclick: 'close'}], onclick: function(ed) { ed.preventDefault(); if(ed.target.tagName.toLowerCase() == 'img') { editor.insertContent(ed.target.outerHTML); var win = editor.windowManager.getWindows()[0]; win.close(); } } }); } }); });
In init :
tinymce.init({ selector: "textarea", plugins: 'PasteImage' });