This is a migrated thread and some comments may be shown as answers.

[Solved] Operation of the RadEditorHtmlInspector

8 Answers 132 Views
Editor
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 16 May 2008, 12:21 AM
Two things-

Are changes in RadEditorHtmlInspector supposed to update the design view, and visa-versa?  Is there a polling interval, or something, or ??  I've tinkered with it both, in your demos, and my local install and it seems inoperable or inconsistent.

And, the arial font in the HtmlInspector and the Html View is not a good font for code.  Is there a way to specify a different font?

Thanks,
David

8 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 19 May 2008, 11:55 AM
Hi David,

The RadEditorHtmlInspector modules is not updatable on key press to not decrease performance. The module updates its content on enter key press or when executing editor's commands.

You can customize the appearance of the real time HTML view module with the following class:

    <style>
    .rade_textarea
    {
        font-family: Courier New !important;
        font-size: 15px !important;
        color: red !important;
    }
    </style>


To customize the appearance of the Html mode of RadEditor for ASP.NET AJAX use the following code:
<script type="text/javascript">
function OnClientLoad(editor, args)
{
    editor.add_modeChange(function(sender, args)
    {
        var mode = editor.get_mode();
        if(mode == "2")
        {
           
                editor.get_textArea().style.color = "red";
                editor.get_textArea().style.backgroundColor = "black";
                editor.get_textArea().style.fontName = "Times New Roman";
           
        }
    });
}
</script>
<telerik:RadEditor ID="RadEditor1" OnClientLoad="OnClientLoad" runat="server" >
</telerik:RadEditor>

All the best,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
David
Top achievements
Rank 1
answered on 21 May 2008, 02:02 PM
Thanks for the Info.

Is there a way to get Indenting applied to HtmlInspector?

I'm not seeing it update on Enter.  I wonder how much overhead it would put if it updated on any key down/up.  Could this be configured/overriden on the client?

Thanks!
David
0
Rumen
Telerik team
answered on 21 May 2008, 03:58 PM
Hi David,

For the time being it is not possible to modify the code of the editor's modules, but I will try to find a solution. I will write back at the beginning of next week.

Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
David
Top achievements
Rank 1
answered on 21 May 2008, 04:04 PM
Thanks.. I'd appreciate that.

It would surely make it much more useful.

David
0
Accepted
Rumen
Telerik team
answered on 27 May 2008, 12:51 PM
Hi David,

I was able to find a solution but unfortunately it introduced a side effect which appears randomly, e.g. the cursor position is sometimes lost in the content area and set in the HTML view module. I talked with our developers and they told me that we will further enhance the Real HTML View module and hopefully we will provide the requested by you functionality.

Currently, you can try the following setting and if you are satisfied with it to use it:
  1. Set the editor to use its external script files - copy the Script folder from the Telerik.Web.UI installation. This will allow us to modify its modules.js file and the Real HTML Viewer code:

    <asp:ScriptManager ID="ScriptManager1" runat="server" >
        <Scripts>
               <asp:ScriptReference Path ="Scripts/Common/Core.js" />
               <asp:ScriptReference Path ="Scripts/Common/Popup/PopupScripts.js"/>
               <asp:ScriptReference Path ="Scripts/Editor/RadEditor.js"/>
               <asp:ScriptReference Path ="Scripts/Dialogs/DialogOpener.js"/>
               <asp:ScriptReference Path ="Scripts/Editor/Modules.js"/>
               <asp:ScriptReference Path ="Scripts/Spell/SpellCheckService.js"/>
               <asp:ScriptReference Path ="Scripts/Editor/AjaxSpellCheck.js"/>
               <asp:ScriptReference Path ="Scripts/Window/RadWindow.js"/>
    </Scripts>

    </asp:ScriptManager>
    <telerik:radeditor runat="server" ID="RadEditor1" EnableEmbeddedScripts="false" ></telerik:radeditor>
  2. Open the \Scripts\Editor\Modules.js file and locate the following line:
    this._interval=window.setInterval(this._intervalDelegate,4000);

    Set the interval to be smaller for example:

    this._interval=window.setInterval(this._intervalDelegate,10);

    Note that as smaller interval you set as ofter you will see the focus lose side effect.
  3. Save the files and test the module.


Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Karl
Top achievements
Rank 1
answered on 12 May 2009, 07:07 PM
Sorry to dig up an old thread, but the default font in the HTML view on RadEditor is a bit too small (and I want a monospaced font). I see the answer posted by the admin, however, I don't know where to put this code. Which files get edited?

thanks,
0
Rumen
Telerik team
answered on 15 May 2009, 12:45 PM
Hello Karl,

Could you please specify the exact version of RadEditor that you use in your project? Do you use RadEditor for ASP.NET AJAX (Telerik.Web.UI.dll) or RadEditor Classic (RadEditor.dll)?

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Karl
Top achievements
Rank 1
answered on 15 May 2009, 01:11 PM
Not sure what version we're using (how do i check?). RadEditor .NET was packaged with OpenText Content management system.

Anyway, after poking around the documentation, I got it to work by editing the RadEditor.aspx file:

    <script type="text/javascript">
            function OnClientModeChange(editor)
            {
            
             window.setTimeout( function()
               {
                   var currentMode = editor.GetMode();
                   if(currentMode == "2")
                    {
                       var style = editor.GetTextArea().style;
                       
                       style.fontFamily= "Consolas, Courier New";
                       style.fontSize= "14";
                       
                    }
               }
               ,10
            );
            }
        </script>


<rade:radeditor id="editor" OnClientModeChange="OnClientModeChange" Runat="server" Skin="Skin" ToolsWidth="100%" AllowScripts="true"></rade:radeditor>

Thanks for the prompt response though.





Tags
Editor
Asked by
David
Top achievements
Rank 1
Answers by
Rumen
Telerik team
David
Top achievements
Rank 1
Karl
Top achievements
Rank 1
Share this question
or