Can we detect if user has selected ONLY an image?

Last post 04-25-2007, 10:54 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  04-24-2007, 3:28 PM 28794

    Can we detect if user has selected ONLY an image?

    I would like to be able to detect if a user has selected ONLY an image, ONLY text or a combination of both.  In another editor product, you can detect the selection of an image because there are 'selectedHTML' and 'selectedTEXT' function calls available.  If the length of the content returned by 'selectedTEXT' is zero but the length of the content returned by 'selectedHTML' is not zero, the user has selected only an image.   Is there a way to detect the same in CuteSoft?

  •  04-25-2007, 10:54 PM 28843 in reply to 28794

    Re: Can we detect if user has selected ONLY an image?

    rpinson,
     
    //If the length of the content returned by 'selectedTEXT' is zero but the length of the content returned by 'selectedHTML' is not zero, the user has selected only an image
     
    This logic is no correct.

     
    // get the active editor selection

    var sel = editor1.GetSelection();
     
    if(sel.type=="Control")
    {
       var img=editor.GetSelectionElement("IMG");
       if(img)
       {
           //do something
       }
       var a=editor.GetSelectionElement("A");
       if(a)
       {
           //do something
       }
       -----------
    }
    else if(sel.type=="Text")
    {   
       //do something
    }


    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