diff -r abd11be23718 -r ea0c7ac589c4 src/pyams_content/zmi/resources/js/tinymce/onflinks/plugin.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/zmi/resources/js/tinymce/onflinks/plugin.js Thu Nov 08 10:50:52 2018 +0100 @@ -0,0 +1,20 @@ +tinymce.PluginManager.add('internal_links', function(editor, url) { + + editor.addButton('internal_links', { + icon: 'cloud-check', + tooltip: "Insert internal link", + image: '/--static--/pyams_content/img/external.png', + onclick: function() { + editor.windowManager.open({ + title: "Insert internal link", + body: [ + {type: 'textbox', name: 'title', label: 'Link title', value: editor.selection.getContent()}, + {type: 'textbox', name: 'oid', label:'Internal number'} + ], + onsubmit: function(e) { + editor.insertContent('' + e.data.title + ''); + } + }); + } + }) +});