How to set the 'Verdana' font per default on the dropdown?

2 posts, 0 answers
  1. Jorge Merino
    Jorge Merino avatar
    9 posts
    Member since:
    Mar 2009

    Posted 12 Aug 2009 Link to this post

    Hello.

    I had success putting a list of available fonts into the the Font Name Selection dropdown like follows:
    <fontNames>
       <item name="Verdana" default="true" />
       <item name="Arial" />
       <item name="Arial Narrow" />
       <item name="Arial Black" />
     </fontNames>

    But the issue is that I need to set the "Verdana" font as default on the dropdown, right now it appears like "Times New Roman". How can I do this? Where that value comes from? Is there some value to be ste in the ToolsFile.xml? or inside the ConfigFile?

    This is what I used so far, but did not work:

    Version used is 5.5.0.0.

    in the ConfigFile.xml, I put:
    <property name="OnClientLoad">ChangeFontOnDropdown</property>  

    then in he MOSSEditorTools.js file, I added:

    function ChangeFontOnDropdown(editor)
    {
     alert("Debugging to set the font ToolPart Bold");  
        var oFontTool = new Object();
        oFontTool.GetSelectedValue = function() { return "Georgia"; }
        editor.fire("FontName", oFontTool);
    }

    First of all I was using 'editor.Fire' (note the F upper case on Fire), but it sent an error. So, I changed it to be 'fire' (note the f lower case on fire), but it still won't work.

    Any help is highly appreciated.

    Thank you.
  2. Jorge Merino
    Jorge Merino avatar
    9 posts
    Member since:
    Mar 2009

    Posted 12 Aug 2009 Link to this post

    Problem fixed.

    Perhaps because I was using the latest and greatest version of Radeditor, but the solution on the online help didn't work.

    I had to use the big guns, I asked to Dasaev Cerqueda, our Javascript guru and he came with the solution after some API debugging.

    The chunk of code that he gave me was:

    function ChangeFontOnDropdown(editor)
    {
        setTimeout(function(){
        editor.fire("FontName", {value:'Verdana'});
        }, 100);
    }

    So, now it works.

Back to Top