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

[Solved] Links and Usability

3 Answers 128 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Peter Zolja
Top achievements
Rank 1
Peter Zolja asked on 09 Apr 2008, 01:44 PM
Scenario: Make a download link to test.doc from the document manager and call it "test link"

1) Using the document manager and selecting a file in the document properties there should be an option to let them specify what the link should say (link text).
2) Since they don't have this option they try to modify the link text. When doing this it's very easy to remove the actual link tag (turns into text). This is very unfriendly.
3) When over the link I get URL, tooltip, etc at the bottom. This means absolutely nothing for the average user -- and it's not intuitive to click the hyperlink manager; any suggestions?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 09 Apr 2008, 03:17 PM
Hello Peter,

Thank you for your feature request. I logged it in our ToDo list for consideration and I updated your Telerik points.

My suggestion is to use the solution below which pops up a browser prompt window which invites the users to specify the inserted document link name:

<script type="text/javascript">
function OnClientPasteHtml(sender, args)
{
    var commandName = args.get_commandName();
    var value = args.get_value();

    if (commandName == "DocumentManager")
    {
        var div = document.createElement("DIV");

        //Do not use div.innerHTML as in IE this would cause the image's src or the link's href to be converted to absolute path.
        //This is a severe IE quirk.
        Telerik.Web.UI.Editor.Utils.setElementInnerHtml(div,value);

        //Now check if there is alt attribute
        var link = div.firstChild;
        //debugger;
        var alt = prompt("Please specify the desired document name", "");
        link.innerHTML = alt;
       
        //Set new content to be pasted into the editor
        args.set_value(div.innerHTML);
    }
}
</script>
<telerik:radeditor runat="server" ID="RadEditor1" OnClientPasteHtml="OnClientPasteHtml">   
    <DocumentManager ViewPaths="~/" UploadPaths="~/" />
</telerik:radeditor>  

The solution is based on the following online example: OnClientPasteHtml.


Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Peter Zolja
Top achievements
Rank 1
answered on 09 Apr 2008, 03:55 PM
The actual link (anchor) is generated by the document manager (not pasted) -- wanted to make sure I explained it properly :)
0
Rumen
Telerik team
answered on 09 Apr 2008, 04:15 PM

Sure, the provided code asks the user to set the desired document link name directly after pressing the Insert button of the Document manager.


Best regards,
Rumen
the Telerik team

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