Hi pilotsredlix,
The style builder of editor has not the function to add a <marquee> target for the selected text.
If you want to wrap the selected text as the <marquee> target, then please try the example below.
- <%@ Page Language="C#" AutoEventWireup="True" %>
-
- <%@ Register TagPrefix="CE" Assembly="CuteEditor" Namespace="CuteEditor" %>
- <html>
- <head>
- </head>
- <body>
- <form id="Form1" runat="server">
- <CE:Editor ID="editor1" runat="server">
- </CE:Editor>
- <input type="button" value="add marquee target" onclick="addMarquee()" />
- </form>
- </body>
- </html>
-
- <script>
- function addMarquee()
- {
- var editor1=document.getElementById("<%= editor1.ClientID %>");
- var code=getSelectedHTML();
- editor1.PasteHTML("<marquee>"+code+"</marquee>");
- }
- function getSelectedHTML()
- {
- var editor1=document.getElementById("<%= editor1.ClientID %>");
- var rng=null,html="";
-
-
- var editdoc = editor1.GetDocument();
-
-
- var editwin = editor1.GetWindow();
- if (document.selection && document.selection.createRange)
- {
- rng=editdoc.selection.createRange();
- if( rng.htmlText )
- {
- html=rng.htmlText;
- }
- else if(rng.length >= 1)
- {
- html=rng.item(0).outerHTML;
- }
- }
- else if (window.getSelection)
- {
- rng=editwin.getSelection();
- if (rng.rangeCount > 0 && window.XMLSerializer)
- {
- rng=rng.getRangeAt(0);
- html=new XMLSerializer().serializeToString(rng.cloneContents());
- }
- }
- return html;
- }
- </script>
Regards,
Ken