// 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 & "DisableEnterKeyHandler,CustomConfigurationsPath,EditorAreaCSS,ToolbarComboPreviewCSS,DocType"; lConfigKeys = lConfigKeys & ",BaseHref,FullPage,Debug,AllowQueryStringDebug,SkinPath"; lConfigKeys = lConfigKeys & ",PreloadImages,PluginsPath,AutoDetectLanguage,DefaultLanguage,ContentLangDirection"; lConfigKeys = lConfigKeys & ",ProcessHTMLEntities,IncludeLatinEntities,IncludeGreekEntities,ProcessNumericEntities,AdditionalNumericEntities"; lConfigKeys = lConfigKeys & ",FillEmptyBlocks,FormatSource,FormatOutput,FormatIndentator,ForceStrongEm"; lConfigKeys = lConfigKeys & ",GeckoUseSPAN,StartupFocus,ForcePasteAsPlainText,AutoDetectPasteFromWord,ForceSimpleAmpersand"; lConfigKeys = lConfigKeys & ",TabSpaces,ShowBorders,SourcePopup,ToolbarStartExpanded,ToolbarCanCollapse"; lConfigKeys = lConfigKeys & ",IgnoreEmptyParagraphValue,PreserveSessionOnFileBrowser,FloatingPanelsZIndex,TemplateReplaceAll,TemplateReplaceCheckbox"; lConfigKeys = lConfigKeys & ",ToolbarLocation,ToolbarSets,EnterMode,ShiftEnterMode,Keystrokes"; lConfigKeys = lConfigKeys & ",ContextMenu,BrowserContextMenuOnCtrl,FontColors,FontNames,FontSizes"; lConfigKeys = lConfigKeys & ",FontFormats,StylesXmlPath,TemplatesXmlPath,SpellChecker,IeSpellDownloadUrl"; lConfigKeys = lConfigKeys & ",SpellerPagesServerScript,FirefoxSpellChecker,MaxUndoLevels,DisableObjectResizing,DisableFFTableHandles"; lConfigKeys = lConfigKeys & ",LinkDlgHideTarget ,LinkDlgHideAdvanced,ImageDlgHideLink ,ImageDlgHideAdvanced,FlashDlgHideAdvanced"; lConfigKeys = lConfigKeys & ",ProtectedTags,BodyId,BodyClass,DefaultLinkTarget,CleanWordKeepsStructure"; lConfigKeys = lConfigKeys & ",LinkBrowser,LinkBrowserURL,LinkBrowserWindowWidth,LinkBrowserWindowHeight,ImageBrowser"; lConfigKeys = lConfigKeys & ",ImageBrowserURL,ImageBrowserWindowWidth,ImageBrowserWindowHeight,FlashBrowser,FlashBrowserURL"; lConfigKeys = lConfigKeys & ",FlashBrowserWindowWidth ,FlashBrowserWindowHeight,LinkUpload,LinkUploadURL,LinkUploadWindowWidth"; lConfigKeys = lConfigKeys & ",LinkUploadWindowHeight,LinkUploadAllowedExtensions,LinkUploadDeniedExtensions,ImageUpload,ImageUploadURL"; lConfigKeys = lConfigKeys & ",ImageUploadAllowedExtensions,ImageUploadDeniedExtensions,FlashUpload,FlashUploadURL,FlashUploadAllowedExtensions"; lConfigKeys = lConfigKeys & ",FlashUploadDeniedExtensions,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;