This is a migrated thread and some comments may be shown as answers.

[Solved] Controlling the Link Manager

1 Answer 155 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Wei Min Chan
Top achievements
Rank 1
Wei Min Chan asked on 24 Jan 2008, 01:37 AM
Hi there, just want to know if there was a way to control the Link Manager dialog for the RadEditor control?

It's a bit TOO powerful for my purpose right now, all I want is to allow the users to create HTTP links that's all.

Yes, I know I still need to filter out the actual content on the server side but if the client side doesn't reveal the options the users will have no reason to yell at me if I silently fail their post or filter it. ;)

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 24 Jan 2008, 03:11 PM
Hello Wei,

Currently, it is not possible to modify the built-in RadEditor "Prometheus" dialogs, because their code is embedded in the Telerik.Web.UI.dll file. We plan to provide external dialog files for the Q1 2008 version of RadEditor "Prometheus". This will allow the dialog customizations.

My suggestions is to replace the build-in hyperlink manager with the link manager of the browser. It is quite simple and it will be suitable for your scenario. Here is an example how to use the browser Create Link dialog:

<telerik:radeditor runat="server" ID="RadEditor1"  
 OnClientCommandExecuting="OnClientCommandExecuting"
 Height="400px"> 
    <Tools>
        <telerik:EditorToolGroup>
            <telerik:EditorTool Name="LinkManager" Text="Link Manager" />
        </telerik:EditorToolGroup>               
    </Tools>                     
</telerik:radeditor>
<script type="text/javascript"> 
 function OnClientCommandExecuting(editor, args) 
 {               
    var commandName = args.get_CommandName(); 
    if (commandName == "LinkManager") 
    { 
        editor.setFocus();
                                               
        //FireFox - will work only if there is selection of text, otherwise built-in browser command does not work
        if (!document.all)
        {                   
            var href = prompt("Enter a URL:", "http://");                       
            if (href) editor.get_document().execCommand("createlink", false, href);  
        }   
        else editor.get_document().execCommand("createlink", true, null);       
                 
        //Cancel the further execution of the command to avoid error 
        args.set_cancel(true);               
    } 
 }        
 </script>

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Wei Min Chan
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or