We have created an extension of the 'Insert Link' dialog. It shows a list of videos from a video site. When a user select a video and click insert, the video url is inserter onto the editor. Is it possible to change this behaviour so that the inserted link is wrapped with an iframe embedding object? So that the video the url points to gets embedded.
What the 'Insert Link' dialog does is that it creates a anchor node with the given link and insert this node to the linkBrowser.
We wrote the following fragment of code inside the preSubmit handler of our 'Insert Link' extension.
preSubmit: function () { var widgetMacroText = "<p><img class=\"editor-inline-macro\" src=\"/confluence/plugins/servlet/confluence/placeholder/macro?definition=e3dpZGdldDp1cmw9aHR0cHM6Ly9zZW5kdmlldy50by93LzM2MTYwYmZiOH0&amp;locale=en_GB&amp;version=2\" data-macro-name=\"widget\" data-macro-parameters=\"url="+url+"\""+" ></p>"; tinymce.confluence.NodeUtils.replaceSelection(widgetMacroText); },
The above code made sure that our video url got connected with the Widget Connector extension we created.
The above code was changed to
var node = "<p><img class=\"editor-inline-macro\" src=\"/download/resources/com.dreambroker.confluence.plugins.dreambroker-confluence-plugin:image-resource/macro.png\" data-macro-name=\"widget\" data-macro-parameters=\"url="+url+"\""+" ></p>"; var ed = tinymce.activeEditor; var node = AJS.$(newNode).clone(true,false)[0]; ed.execCommand('mceInsertContent', false, node.outerHTML);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.