Adding custom buttons

Last post 01-07-2009, 10:37 AM by Adam. 1 replies.
Sort Posts: Previous Next
  •  01-07-2009, 8:18 AM 47501

    Adding custom buttons

    Hi,
    I would like to know if I can get the highlighted text or the position of the curser in the text area. I need this if I would like to make for example an excel importer or make an .asp function that formats the highlighted text.
     
    Thanks
    Eli
  •  01-07-2009, 10:37 AM 47511 in reply to 47501

    Re: Adding custom buttons

    ELi,
     
    1. First you need to add a custom button.
     
    Please check the following examples:
     
     
    Add a Cross Browser Modal Dialog Box to Cute Editor

    How to create a custom button(client side) which displays a dialog?( C# | VB )

    This example demonstrates how easy it can be to add your own client side buttons to the CuteEditor by creating a Cross Browser Modal Dialog Box.

     
    2.  Get the selected html code:
     
     function getSelectedHTML(){
          var rng=null,html="";

          if (document.selection && document.selection.createRange){
            rng=editdoc.selection.createRange();
            html=rng.htmlText||"";
          }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;
        }

     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML