Installation instructions: WIRIS plugin for Cute Editor

DOWNLOAD

1 Requirements

  • Cute Editor for .NET installed.
  • A valid license to install the plugin in a production environment; otherwise, you can use the downloaded file just for demo purposes.

2 Copy files

Unzip the Cute Editor WIRIS plugin and copy the cuteeditor_wiris directory into your Cute Editor directory. The name of the WIRIS plugin directory must be cuteeditor_wiris.

  1. Create an application through your IIS control panel at cuteeditor_wiris/integration.
  2. Give write permissions to cuteeditor_wiris/cache and to cuteeditor_wiris/formulas folders to the web server user. Those folders will be used to store formula MathML codes and temporal images.

3 Include WIRIS plugin for Cute Editor on your own platform

  1. Add the following HTML line in the head section.
    <script type="text/javascript" src="CuteSoft_Client/CuteEditor/cuteeditor_wiris/core/core.js"></script>

    and the following one after <CE:Editor id="Editor1" runat="server" />
    <script type="text/javascript" id="wirisScript" src="CuteSoft_Client/CuteEditor/cuteeditor_wiris/cuteeditor.js"></script>

    If you're using a submit button instead of the save button of the Cute Editor toolbar to post the data add the submitForm(); function in your onclick or onclientclick attribute as below.

    onclick="submitForm();"
    onclientclick="submitForm();"
     
  2. Add the following button holder in the .config file used for the button configuration in CuteSoft_Client\CuteEditor\Configuration\AutoConfigure

    <item type="g_start" />
    <item type="holder" name="wirisbuttons" />
    <item type="g_end" />

     
  3. In order to add the Wiris buttons in the Cute Editor toolbar you need to modify the Code file of the page containing the editor as explained below. Add in the Page_Load function the following code where Editor1 is the editor id.

    //If null, default browser language is chosen.
    //change if you need a particular language. e.g. it-IT, es-ES
    string currentLanguage = null;

    CuteEditor.ToolControl tc = Editor1.ToolControls["wirisbuttons"];   
    if(tc!=null)   
    {      
        //Add Wiris buttons
        System.Web.UI.WebControls.Image Image1 = new System.Web.UI.WebControls.Image ();  
        Image1.ToolTip    = "WirisEditor";  
        Image1.ImageUrl    = "CuteSoft_Client/CuteEditor/cuteeditor_wiris/core/icons/formula.gif";  
        Image1.CssClass    = "CuteEditorButton";  
        SetMouseEvents(Image1);  
        Image1.Attributes["onclick"]="CuteEditor_GetEditor(this).ExecCommand('WirisEditor')";  
        tc.Control.Controls.Add(Image1);
        System.Web.UI.WebControls.Image Image2 = new System.Web.UI.WebControls.Image ();  
        Image2.ToolTip    = "WirisCAS";  
        Image2.ImageUrl    = "CuteSoft_Client/CuteEditor/cuteeditor_wiris/core/icons/cas.gif";  
        Image2.CssClass    = "CuteEditorButton";  
        SetMouseEvents(Image2);  
        Image2.Attributes["onclick"]="CuteEditor_GetEditor(this).ExecCommand('WirisCAS')";  
        tc.Control.Controls.Add(Image2);
    }      

    if (currentLanguage != null){
        Editor1.CustomCulture = currentLanguage;
    }else{
        currentLanguage = Page.Request.UserLanguages[0];
    }
    var scriptTag = new HtmlGenericControl {TagName = "script"};
    scriptTag.Attributes.Add("type", "text/javascript");
    scriptTag.InnerText = "var currentLanguage ='" + currentLanguage + "';";
    this.Page.Header.Controls.Add(scriptTag);


    and the following function if not present.

    void SetMouseEvents(WebControl control)
    {
        control.Attributes["onmouseover"]="CuteEditor_ButtonCommandOver(this)";
        control.Attributes["onmouseout"]="CuteEditor_ButtonCommandOut(this)";
        control.Attributes["onmousedown"]="CuteEditor_ButtonCommandDown(this)";
        control.Attributes["onmouseup"]="CuteEditor_ButtonCommandUp(this)";
        control.Attributes["ondragstart"]="CuteEditor_CancelEvent()";
    }

4 Configure

Edit cuteeditor_wiris/configuration.ini to set your own values. This table specifies all possible parameters.

5 Check that the plugin works correctly

In order to check if the plugin is installed correctly, there is a page that makes some tests on your server. Open this link to see where is your test page.

6 Clean and backup your WIRIS plugin for Cute Editor

Check this page.