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

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

1 Answer 62 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Jorge Merino
Top achievements
Rank 1
Jorge Merino asked on 12 Aug 2009, 03:52 PM
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.

1 Answer, 1 is accepted

Sort by
0
Jorge Merino
Top achievements
Rank 1
answered on 12 Aug 2009, 09:44 PM
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.
Tags
WebParts for SharePoint
Asked by
Jorge Merino
Top achievements
Rank 1
Answers by
Jorge Merino
Top achievements
Rank 1
Share this question
or