// display the html editor or a plain textarea?
if( isCompatible() )
showHTMLEditor();
else
showTextArea();
var sAgent = lCase( cgi.HTTP_USER_AGENT );
var stResult = "";
var sBrowserVersion = "";
// do not check if argument "checkBrowser" is false
if( not this.checkBrowser )
return true;
// check for Internet Explorer ( >= 5.5 )
if( find( "msie", sAgent ) and not find( "mac", sAgent ) and not find( "opera", sAgent ) )
{
// try to extract IE version
stResult = reFind( "msie ([5-9]\.[0-9])", sAgent, 1, true );
if( arrayLen( stResult.pos ) eq 2 )
{
// get IE Version
sBrowserVersion = mid( sAgent, stResult.pos[2], stResult.len[2] );
return ( sBrowserVersion GTE 5.5 );
}
}
// check for Gecko ( >= 20030210+ )
else if( find( "gecko/", sAgent ) )
{
// try to extract Gecko version date
stResult = reFind( "gecko/(200[3-9][0-1][0-9][0-3][0-9])", sAgent, 1, true );
if( arrayLen( stResult.pos ) eq 2 )
{
// get Gecko build (i18n date)
sBrowserVersion = mid( sAgent, stResult.pos[2], stResult.len[2] );
return ( sBrowserVersion GTE 20030210 );
}
}
return false;
// append unit "px" for numeric width and/or height values
if( isNumeric( this.width ) )
this.width = this.width & "px";
if( isNumeric( this.height ) )
this.height = this.height & "px";
var sURL = "";
// try to fix the basePath, if ending slash is missing
if( len( this.basePath) and right( this.basePath, 1 ) is not "/" )
this.basePath = this.basePath & "/";
// construct the url
sURL = this.basePath & "editor/fckeditor.html?InstanceName=" & this.instanceName;
// append toolbarset name to the url
if( len( this.toolbarSet ) )
sURL = sURL & "&Toolbar=" & this.toolbarSet;
var sParams = "";
var key = "";
var fieldValue = "";
var fieldLabel = "";
var lConfigKeys = "";
var iPos = "";
/**
* CFML doesn't store casesensitive names for structure keys, but the configuration names must be casesensitive for js.
* So we need to find out the correct case for the configuration keys.
* We "fix" this by comparing the caseless configuration keys to a list of all available configuration options in the correct case.
* changed 20041206 hk@lwd.de (improvements are welcome!)
*/
lConfigKeys = lConfigKeys & "CustomConfigurationsPath,EditorAreaCSS,DocType,BaseHref,FullPage,Debug,SkinPath,PluginsPath,AutoDetectLanguage,DefaultLanguage,ContentLangDirection,EnableXHTML,EnableSourceXHTML,ProcessHTMLEntities,IncludeLatinEntities,IncludeGreekEntities";
lConfigKeys = lConfigKeys & ",FillEmptyBlocks,FormatSource,FormatOutput,FormatIndentator,GeckoUseSPAN,StartupFocus,ForcePasteAsPlainText,ForceSimpleAmpersand,TabSpaces,ShowBorders,UseBROnCarriageReturn";
lConfigKeys = lConfigKeys & ",ToolbarStartExpanded,ToolbarCanCollapse,ToolbarSets,ContextMenu,FontColors,FontNames,FontSizes,FontFormats,StylesXmlPath,SpellChecker,IeSpellDownloadUrl,MaxUndoLevels";
lConfigKeys = lConfigKeys & ",LinkBrowser,LinkBrowserURL,LinkBrowserWindowWidth,LinkBrowserWindowHeight";
lConfigKeys = lConfigKeys & ",LinkUpload,LinkUploadURL,LinkUploadWindowWidth,LinkUploadWindowHeight,LinkUploadAllowedExtensions,LinkUploadDeniedExtensions";
lConfigKeys = lConfigKeys & ",ImageBrowser,ImageBrowserURL,ImageBrowserWindowWidth,ImageBrowserWindowHeight,SmileyPath,SmileyImages,SmileyColumns,SmileyWindowWidth,SmileyWindowHeight";
for( key in this.config )
{
iPos = listFindNoCase( lConfigKeys, key );
if( iPos GT 0 )
{
if( len( sParams ) )
sParams = sParams & "&";
fieldValue = this.config[key];
fieldName = listGetAt( lConfigKeys, iPos );
// set all boolean possibilities in CFML to true/false values
if( isBoolean( fieldValue) and fieldValue )
fieldValue = "true";
else if( isBoolean( fieldValue) )
fieldValue = "false";
sParams = sParams & HTMLEditFormat( fieldName ) & '=' & HTMLEditFormat( fieldValue );
}
}
return sParams;