Re: Need documentation to the whole Javascript API

  •  04-28-2011, 3:17 PM

    Re: Need documentation to the whole Javascript API

    Dear Sergejack,
     
    Please try the following snippet:

    <%@ Page Language="C#"%>
    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
    <html>
        <head>
      <title>JavaScript API</title>
      <link rel="stylesheet" href="../example.css" type="text/css" />
       <script language="JavaScript" type="text/javascript" >
           function getSelectedFormatBlock()
                     {
                         var formatblock = document.getElementById("CE_Editor1_IDformatblock");
                         var table = formatblock.getElementsByTagName("table")[0];
                         var spanArr = table.getElementsByTagName("span");
                         var textnode = spanArr[0].firstChild;
                         alert(textnode.nodeValue);                  
         }    
      </script>
      <script runat="server">
      override protected void OnInit(EventArgs e)
      {
       base.OnInit(e);
       Editor1.Text = @"<table cellspacing=""4"" cellpadding=""4"" border=""0""> <tbody> <tr> <td> <p> <img src=""http://cutesoft.net/Uploads/j0262681.jpg"" width=""80"" alt=""""/></p></td> <td> <p>When your algorithmic and programming skills have reached a level which you cannot improve any further, refining your team strategy will give you that extra edge you need to reach the top. We practiced programming contests with different team members and strategies for many years, and saw a lot of other teams do so too.  </p></td></tr> <tr> <td> <p>  <img src=""http://cutesoft.net/Uploads/PH02366J.jpg"" width=""80"" alt="""" /></p></td> <td> <p>From this we developed a theory about how an optimal team should behave during a contest. However, a refined strategy is not a must: The World Champions of 1995, Freiburg University, were a rookie team, and the winners of the 1994 Northwestern European Contest, Warsaw University, met only two weeks before that contest.  </p></td></tr></tbody></table> <br /> <br />";
       Editor1.SetScriptProperty("ServerTime",DateTime.Now.ToString("HH:mm:ss"));
      }
      </script>

        </head>
    <body>
        <form id="Form1" runat="server">     
                                    <CE:Editor id="Editor1" Width="860"  ThemeType="Office2007"
                                         Height="350"  runat="server">
                                    </CE:Editor><br />
                                 
                                    <p style="width: 580px">
                                        <input type="button" value="Get Selected Dropdown Item" onclick="getSelectedFormatBlock()" id="Button1">
                                       </p>
                                    <br />
        </form>
    </body>
    </html>

    <script language="JavaScript" type="text/javascript" >
      var editor1=document.getElementById("<%=Editor1.ClientID%>");
      if(editor1.IsReady)CuteEditor_OnInitialized(editor);
    </script>
     
    Thank you for asking
     
View Complete Thread