Hi Martin,
Thank you for your question and for sharing your scenario!
You can override the OpenLink command as shown below:
<script>
function OnClientLoad(editor) {
Telerik.Web.UI.Editor.CommandList.OpenLink = function (commandName, editor, commandArgs) {
var $T = Telerik.Web.UI;
var $Editor = $T.Editor;
var linkCmd = new $Editor.InsertLinkCommand(commandName, editor.get_contentWindow(), null, editor);
var selectedLink = linkCmd.getCurrentFormattedAncestor();
debugger
if (selectedLink) {
window.open(selectedLink.href || "about:blank", "_blank");
}
}
}
</script>
<telerik:RadEditor runat="server" id="RadEditor1" OnClientLoad="OnClientLoad">
<Content>
<a href="http://www.telerik.com">Telerik link</a>
</Content>
</telerik:RadEditor>
The link href is returned by the selectedLink.href property and you can modify it with the replace JS method.
Please don't forget to remove the debugger :)
Keep me in touch!
Best Regards,
Rumen
Progress Telerik
Get
quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.
Learn More.