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

[Solved] Hiding ImageMap dialog Target dropdown

1 Answer 90 Views
Editor
This is a migrated thread and some comments may be shown as answers.
raghava
Top achievements
Rank 1
raghava asked on 02 May 2008, 02:31 PM
I am using RadEditor for creating Area maps.
But i want to customize the Image Map dialog.
I donot want to give the target option to the user.
I want to hide the target option for the user
I always want it to point to new window.

How to achive this?

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 07 May 2008, 12:55 PM
Hi Raghava,

We are currently rewriting the Image Map dialog code and for that reason I cannot provide instructions how to modify this dialog, because they will not work in the next version. For that reason I wrote the code below which will set a target="_blank" attribute to all image AREA elements in the content area on submit:

<asp:ScriptManager ID="ScriptManager1" runat="server" />
<script type="text/javascript">
   function OnClientLoad(editor, args)
   {
       editor.add_submit(function ()
       {
          
           var areas = editor.get_document().getElementsByTagName("area");
           for (var i = 0; i < areas.length; i++)
           {
               var area = areas[i];
               area.setAttribute("target", "_blank");
           }
       });
    }
</script>
<telerik:RadEditor
   ID="RadEditor1"
   ImageManager-ViewPaths="~/"
   runat="server"
   OnClientLoad="OnClientLoad">
   <Content>
        <p><img alt="" src="/editorAjaxQ12008/Doggies.jpg" usemap="#rade_img_map_1210164652784" border="0" /></p>
        <map id="rade_img_map_1210164652784" NAME="rade_img_map_1210164652784">
        <area shape="rect" coords="232,155,278,221" href="http://" /></map>
   </Content>
</telerik:RadEditor>
<asp:Button ID="Button1" runat="server" Text="Button" />


Best regards,
Rumen
the Telerik team

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