[CLOSED] HTMLEditor link with new window (target=_blank)

  1. #1

    [CLOSED] HTMLEditor link with new window (target=_blank)

    Is it possible to customize HTMLEditor so it inserts a target="blank" when creating hyperlinks?
    Last edited by Daniil; Apr 25, 2012 at 10:04 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I have tried the solution suggested in the post #9.
    http://www.sencha.com/forum/showthread.php?52568

    It appears to be working fine in FireFox and Chrome, but not in IE.

    I think it's possible to get it working in IE as well.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    
        <script type="text/javascript">
            var myCreateLink = function () {
                var url = prompt(this.createLinkText, this.defaultLinkValue);
    
                if (url && url != 'http:/' + '/') {
                  if (this.linksInNewWindow) {
                    this.relayCmd('insertHTML', "<a href='" + url + "' target='_blank'>" + this.getDoc().getSelection() + "</a>");
                  } else {
                    this.relayCmd('createlink', url);
                  }
                }
            };
        </script>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:HtmlEditor runat="server">
            <CustomConfig>
                <ext:ConfigItem Name="linksInNewWindow" Value="true" Mode="Raw" />
                <ext:ConfigItem Name="createLink" Value="myCreateLink" Mode="Raw" />
            </CustomConfig>
        </ext:HtmlEditor>
    </body>
    </html>
    Last edited by Daniil; Apr 18, 2012 at 9:56 AM.

Similar Threads

  1. [CLOSED] [1.0] Button's target link
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Nov 29, 2010, 1:19 PM
  2. Set target window for Notification object
    By RPIRES in forum 1.x Help
    Replies: 7
    Last Post: Jun 17, 2010, 8:45 PM
  3. HtmlEditor link problem
    By designworxz in forum 1.x Help
    Replies: 0
    Last Post: Feb 03, 2009, 12:32 AM
  4. Replies: 3
    Last Post: Jun 24, 2008, 12:32 AM
  5. Opening a window from a dynamic link
    By t0ny in forum 1.x Help
    Replies: 2
    Last Post: Jun 11, 2008, 5:42 AM

Tags for this Thread

Posting Permissions