﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
716	Extend Number of Font Sizes	Nicholas Couri		"The editor comes with only 7 different font sizes: 

xx-small;x-small;small;medium;large;x-large;xx-large

when trying to change the number of fonts, I found out 
that IE has only 7 different font sizes in its native font size
command. 

In order to bypass this limitation, I changed the fckconfig.js and fck_othercommands.js and it has worked fine on both IE and firefox. 

I don't know if it is the correct solution but it worked fine so far.

////////////////////////////////////////////////////////////////
FILE:  fckconfig.js 

{{{

// ORIGINAL 
// FCKConfig.FontSizes		= '1/xx-small;2/x-small;3/small;4/medium;5/large;6/x-large;7/xx-large' ;
FCKConfig.FontSizes		= '1/5;2/6;3/7;4/8;5/9;6/10;7/11;8/12;9/14;10/16;11/18;12/20;13/24;14/28;15/30;16/60;17/90' ;

}}}


FILE: fck_othercommands.js 

{{{


FCKFontSizeCommand.prototype.Execute = function( fontSize )
{
//ORIGINAL 
//      if ( typeof( fontSize ) == 'string' ) fontSize = parseInt(fontSize, 10) ;
//
//	if ( fontSize == null || fontSize == '' )
//	{
//		// TODO: Remove font size attribute (Now it works with size 3. Will it work forever?)
//		FCK.ExecuteNamedCommand( 'FontSize', 3 ) ;
//	}
//	else {
//            FCK.ExecuteNamedCommand( 'FontSize', fontSize ) ;
//      }


// CHANGED CODE 
	var oSel = null;
	var bHasSelection = false;

        if ( typeof( fontSize ) == 'string' ) fontSize = parseInt(fontSize, 10) ;

	var e = FCK.EditorDocument.createElement( 'SPAN' ) ;

	if ( fontSize == null || fontSize == '' ) {
		e.style.fontSize = '3px';
	} else {
		e.style.fontSize = fontSize + 'px';
	}
	try{ 
		if(document.all) { 
			oSel = FCK.EditorDocument.selection ; // ie 
			bHasSelection = !(oSel.type == ""None""); 
		} else { 				
			oSel = FCK.EditorWindow.getSelection() ; // gecko 
			bHasSelection = (oSel && oSel.rangeCount == 1 && oSel.getRangeAt(0).cloneContents().childNodes.length > 0); 
		} 
	} catch (e) {} 
	if( bHasSelection  )  {
		if (document.selection && document.selection.createRange) { // IE code goes here
			var range = FCK.EditorDocument.selection.createRange();
			e.innerHTML  = FCK.EditorDocument.selection.createRange().text;					
		} else {
			FCK.EditorWindow.getSelection() ;
			e.innerHTML  = FCK.EditorWindow.getSelection();
		}
		FCK.InsertElement( e );				
	}

}


}}}

"	New Feature	closed	Normal	FCKeditor 2.5 Beta	Core : Styles		fixed		
