List of Commands

Last post 07-18-2006, 7:53 PM by HomecitySupport. 6 replies.
Sort Posts: Previous Next
  •  07-18-2006, 1:03 PM 21027

    List of Commands

    Is there a list of commands for the ExecCommand function?

    Like PasteHTML...

    is there a command for Spell Check? that would really make my life easier, lol

  •  07-18-2006, 1:07 PM 21028 in reply to 21027

    Re: List of Commands

  •  07-18-2006, 2:49 PM 21033 in reply to 21028

    Re: List of Commands

     Adam wrote:
    Please check this article:
     
     


    Thank you, that is helpful.

    I have this code in my application:
    ctrl.Attributes("onclick") = "CuteEditor_GetEditor(this).ExecCommand('PasteHTML',false,'<h2>Submit Here!!</h2>')"


    As you can see, ExecCommand uses 'PasteHTML' as the first parameter. Firstly, I have no idea what these parameters are because they are within a string. I assume (which is a bad habit) that 'PasteHTML' is sometype of function name.

    But I do not see 'PasteHTML' in the Toolbar reference documentation.
    http://cutesoft.net/developer+guide/ReferenceToolbar.htm

    Is there more than PasteHTML that is not in the list? I am trying to fire off a "SpellCheck" function but cannot get it to work. I have tried to use "netspell" as the first parameter to 'ExecCommand' but it doesnt seem to like that. Any suggestions on how to create a dynamic toolbar button using the existing "netspell" functionality with the ExecCommand as exampled above?

    I hope that makes sense.
    Thank you for all the help
    HomecitySupport

  •  07-18-2006, 3:35 PM 21041 in reply to 21033

    Re: List of Commands

    HomecitySupport,
     
    For the 'PasteHTML' issue, please use the following JavaScript API:
     
     
    PasteHTML()
    This method is used for pasting the specified HTML into a range within a editor document. If anything is selected, the selection is replaced with the new HTML and text.
    Example:

    // get the cute editor instance
    var editor1 = document.getElementById('<% = Editor1.ClientID%>');

    // pasting the specified HTML into a range within a editor document
    editor1.pasteHTML("Hello World");

     
    For the netspell issue, please use the following code:
     
        // get the cute editor instance
        var editor1 = document.getElementById('<% = Editor1.ClientID%>');
        
        editor1.ExecCommand("netspell");
     
    Demo is here:
     
     
     
     
     

    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

  •  07-18-2006, 6:43 PM 21045 in reply to 21041

    Re: List of Commands

    Thank you, that put me towards the right direction but now I have a new problem.

    I get a Javascript error, regarding "Object Expected".

    Here is my Javascript Function:
    function fireSpellCheck(){
    // get the cute editor instance  
    var editor1 = document.getElementById('CE_Editor1_ID');
    editor1.ExecCommand("netspell");
    }



    This works for "PasteHTML", "InsertDate" and pretty much anything else Ive tried from the command list. But for some reason when I used "netspell" it doesnt fire.

    I also looked at the example on the Javascript API example page. There is a dropdown box that has a list of command names, "netspell" being one of them. It works over there, but I notice all you do is pass the option value to ExecCommand. What am I doing wrong?

    NetSpell works when I leave the toolbar set to FULL. So I know my DLL references to NetSpell are fine. Its not a reference problem because I can use NetSpell with the full toolbar, I just need to minimize the toolbar and fire the Spell Check from a webForm button (or programmatically).

    Thanks alot
    HomecitySupport




  •  07-18-2006, 7:09 PM 21047 in reply to 21045

    Re: List of Commands

    HomecitySupport,
     
    1. First:
     
    Please use:
     
    var editor1 = document.getElementById('<% = Editor1.ClientID%>');
     
    instead of
     
    var editor1 = document.getElementById('CE_Editor1_ID');
     
    2. Does your existing toolbar contains Spell button?
     
    If not, please add the following code at the top of your page:
     
    <script language=javascript src='/CuteSoft_Client/CuteEditor/spell.js'></script>
     
    For performance issue, if your existing toolbar doesn't contain the spell button, the above script will not be rendered by editor.
     
    Does it help?
     
     
     
     
     
     

    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

  •  07-18-2006, 7:53 PM 21048 in reply to 21047

    Re: List of Commands

    Thank you, that put me in the right direction. For some reason, Spell.js was not pathed correctly, or so I assume. Once I copied the contents of Spell.js into the script for my ASP page, it worked!!

    Now I have another problem (yes another one!! lol)

    How can I determine when "netspell" is complete?

    I have to force a spellcheck to occur when a user sends off an email. Everytime they push "send", it will automatically invoke netspell to check for spelling errors. I have already spent alot of time writing VB code to validate the email message, SMTP server and all that good stuff. but I need to check for spelling and then fire my validation code.

    Would you recommend that I call my VB Validation functions through Javascript, once the netspell is completed?

    how can I tell netspell is complete? is there a flag or property?

    Thank you so much for your support, You have been a great help!
    HomecitySupport
View as RSS news feed in XML