Hello,
With the old RadEditor, we had a custom link manager that we built. We used some of your internal functions to make things happen (per your advice), but now it seems that some of the functionality that we used to accomplish the task has either changed or is no longer available. We've converted from using ASPX pages to ASCX pages throughout, and up until this custom dialog have not had issues. We have a basic working custom link manager in place, but there is certain functionality that we're missing. Code that we used in the past that we've been unable to reproduce in the new RadEditor includes:
var link = RadEditorNamespace.GetSelectionLinkArgument(editor);
if (link.realLinkObject && link.realLinkObject.style && link.realLinkObject.style.cssText)
{
link.style = link.realLinkObject.style.cssText;
}
We used this to get the currently selected link from the content area. What can we call in the new editor to accomplish the same thing? The new RadEditor's built-in Hyperlink Manager does this functionality still, so there must be a function that we can still call. Also:
function callBackFunctionPtr(returnValue, arg2)
{
if (returnValue)
{
var originalFunctionToExecute = returnValue.realLinkObject == null
? RadEditorNamespace.radEditorCreateLink
: RadEditorNamespace.radEditorSetLinkProperties;
originalFunctionToExecute(returnValue, arg2);
}
}
This was our old callback function that received back from the RadWindow:
function insertLink()
{
var returnValue =
{
realLinkObject:dialogArguments.realLinkObject,
href:document.linkform.oHref.value,
target:document.linkform.oTarget.value,
style:document.linkform.oStyle.value,
className:document.linkform.oClass.value,
name:document.linkform.oName.value
};
CloseDlg(returnValue);
}
This is the other missing piece of the puzzle. How can we now take the new hyperlink parameters and create a new hyperlink, or replace the parameters of the one that was currently selected? We've managed to put together:
Telerik.Web.UI.Editor.CommandList["InternalLink"] = function(commandName, editor, args)
{
var myCallbackFunction = function(sender, args)
{
if (args)
{
editor.setFocus();
editor.get_document().execCommand("createlink", false, args.href);
}
}
editor.showDialog("InternalLink", {}, myCallbackFunction);
}
We do not, however, know how to pass the hyperlink parameters to "createlink" to properly form the new hyperlink (or update the currently selected one). This may not even be the function that is called by the built-in Hyperlink Manager upon return, but it's all we've been able to dig up in the documentation/forums.
With the old RadEditor, we had a custom link manager that we built. We used some of your internal functions to make things happen (per your advice), but now it seems that some of the functionality that we used to accomplish the task has either changed or is no longer available. We've converted from using ASPX pages to ASCX pages throughout, and up until this custom dialog have not had issues. We have a basic working custom link manager in place, but there is certain functionality that we're missing. Code that we used in the past that we've been unable to reproduce in the new RadEditor includes:
var link = RadEditorNamespace.GetSelectionLinkArgument(editor);
if (link.realLinkObject && link.realLinkObject.style && link.realLinkObject.style.cssText)
{
link.style = link.realLinkObject.style.cssText;
}
We used this to get the currently selected link from the content area. What can we call in the new editor to accomplish the same thing? The new RadEditor's built-in Hyperlink Manager does this functionality still, so there must be a function that we can still call. Also:
function callBackFunctionPtr(returnValue, arg2)
{
if (returnValue)
{
var originalFunctionToExecute = returnValue.realLinkObject == null
? RadEditorNamespace.radEditorCreateLink
: RadEditorNamespace.radEditorSetLinkProperties;
originalFunctionToExecute(returnValue, arg2);
}
}
This was our old callback function that received back from the RadWindow:
function insertLink()
{
var returnValue =
{
realLinkObject:dialogArguments.realLinkObject,
href:document.linkform.oHref.value,
target:document.linkform.oTarget.value,
style:document.linkform.oStyle.value,
className:document.linkform.oClass.value,
name:document.linkform.oName.value
};
CloseDlg(returnValue);
}
This is the other missing piece of the puzzle. How can we now take the new hyperlink parameters and create a new hyperlink, or replace the parameters of the one that was currently selected? We've managed to put together:
Telerik.Web.UI.Editor.CommandList["InternalLink"] = function(commandName, editor, args)
{
var myCallbackFunction = function(sender, args)
{
if (args)
{
editor.setFocus();
editor.get_document().execCommand("createlink", false, args.href);
}
}
editor.showDialog("InternalLink", {}, myCallbackFunction);
}
We do not, however, know how to pass the hyperlink parameters to "createlink" to properly form the new hyperlink (or update the currently selected one). This may not even be the function that is called by the built-in Hyperlink Manager upon return, but it's all we've been able to dig up in the documentation/forums.
