22-FCKEditor參數配置 (經過JS文件實現)

22-FCKEditor參數配置 (經過JS文件實現)
 
今天咱們來繼續上一篇博文的話題,咱們介紹一下FCKEditor編輯器的參數配置!
1、FCKEditor編輯器的配置選項

根據FCKEditor官網解釋:FCKEditor的配置選項共分爲如下六類117項:

1  Editor Behavior

2  Styles

3  HTML Output

4  User Interface

5  Advanced

6  File Browser and Uploader

具體的配置有:

Editor Behavior

•AutoDetectPasteFromWord

•BaseHref

•CleanWordKeepsStructure

•ContentLangDirection

•DefaultLinkTarget
 
•DocType

•ForcePasteAsPlainText
•FullPage

•LinkDlgHideTarget

•MaxUndoLevels

•StartupFocus

•StartupShowBlocks
•TemplateReplaceAll
•TemplateReplaceCheckbox
•ToolbarComboPreviewCSS

Styles

•BodyId and BodyClass

•CoreStyles

•CustomStyles
 
•EditorAreaCSS
 
•EditorAreaStyles
 
•FontColors

•FontFormats
 
•FontNames
 
•FontSizes
•IndentClasses
 
•IndentLength
•IndentUnit
 
•JustifyClasses
•RemoveFormatTags
 
•StylesXmlPath
HTML Output
 
•AdditionalNumericEntities
 
•EMailProtection and EMailProtectionFunction
•EnterMode
 
•FillEmptyBlocks
•ForceSimpleAmpersand
•FormatIndentator
 
•FormatOutput
•FormatSource
 
•HtmlEncodeOutput
•IgnoreEmptyParagraphValue
 
•IncludeGreekEntities
•IncludeLatinEntities
•ProcessHTMLEntities
 
•ProcessNumericEntities
•ShiftEnterMode
 
•TabSpaces
User Interface
 
•AutoDetectLanguage
•ContextMenu
 
•DefaultFontFormatLabel
•DefaultFontSizeLabel
 
•DefaultFontLabel
•DefaultLanguage
•DefaultStyleLabel
 
•DisableFFTableHandles
•DisableObjectResizing
 
•EnableMoreFontColors
•FlashDlgHideAdvanced
 
•FloatingPanelsZIndex
•ImageDlgHideLink
 
•ImageDlgHideAdvanced
•Keystrokes
 
•LinkDlgHideAdvanced
•ShowBorders
 
•ShowDropDialog
•SkinPath
 
•SourcePopup
•SmileyColumns
•SmileyWindowHeight
 
•SmileyWindowWidth
•ToolbarCanCollapse
 
•ToolbarStartExpanded
•ToolbarLocation
 
•ToolbarSets
Advanced
 
•AllowQueryStringDebug
•BrowserContextMenuOnCtrl
 
•CustomConfigurationsPath
•Debug
 
•FirefoxSpellChecker
•IeSpellDownloadUrl
 
•PluginsPath
•Plugins.Add
 
•PreloadImages
•PreserveSessionOnFileBrowser
 
•ProtectedSource.Add
•ProtectedTags
 
•SmileyPath
•SmileyImages
 
•SpellChecker
•ScaytAutoStartup
 
•SpellerPagesServerScript
•TemplatesXmlPath
 
•MsWebBrowserControlCompat
File Browser and Uploader
 
•LinkBrowser
•LinkBrowserURL
 
•LinkBrowserWindowWidth
•LinkBrowserWindowHeight
 
•ImageBrowser
•ImageBrowserURL
 
•ImageBrowserWindowWidth
•ImageBrowserWindowHeight
 
•FlashBrowser
•FlashBrowserURL
 
•FlashBrowserWindowWidth
•FlashBrowserWindowHeight
 
•LinkUpload
•LinkUploadURL
 
•LinkUploadAllowedExtensions
•LinkUploadDeniedExtensions
 
•ImageUpload
•ImageUploadURL
 
•ImageUploadAllowedExtensions
•ImageUploadDeniedExtensions
 
•FlashUpload
•FlashUploadURL
 
•FlashUploadAllowedExtensions
•FlashUploadDeniedExtensions
 
2、編輯器配置的實現方法
 
對於FCKEditor編輯器的配置能夠經過兩種方法實現:
 
(1):經過設置fckconfig.js實現

(2):經過PHP文件實現編輯器的配置
 
3、經過fckconfig.js實現編輯器的配置
 
不管其配置參數有多少項,配置過程仍是很是簡單的!基本的語法結構是
 
FCKConfig.屬性名稱 = 屬性值;
 
咱們舉幾個例子來講明一下吧!
 
FontNames

功能:設置字體列表

語法:

FCKConfig.FontNames = ‘字體;字體;…’;

如:
FCKConfig.FontNames = ‘宋體;隸書;華文行楷; Arial;Times New Roman;Verdana’;

FontSizes

功能:設置字號列表

語法:

FCKConfig.FontSizes = ‘字號;字號;…’;

如:

FCKConfig.FontSizes = ‘12px;14px;16px;18px;20px;24px;28px’;
ToolbarSets

功能:設置工具欄

FCKConfig.ToolbarSets[「工具欄名稱」] = [

['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],

['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],

['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],

['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],

'/',

['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],

['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],

['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],

['Link','Unlink','Anchor'],

['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],

'/',

['Style','FontFormat','FontName','FontSize'],

['TextColor','BGColor'],

['FitWindow','ShowBlocks','-','About']

];

說明:

一項完整的工具欄必須位於英文中括號之間;

若是某項工具欄被劃分爲多個子部分(如樣式工具欄又可爲基礎樣式(加粗、傾斜等)、上標與下標),那麼能夠採用豎線進行分隔

若是將工具欄進行換行,可採用"/"

以下圖
 

 
SmileyPath

功能:設置表情圖片存放的路徑

語法:

FCKConfig. SmileyPath = FCKConfig.BasePath + 「表情圖片存放的路徑」;

說明:

在默認狀況下,表情存放的位置在FCKConfig.BasePath文件夾下的p_w_picpaths/smiley/msn/

若是想改變表情圖片,那麼須要事先將表情圖片複製到相應的文件夾並且還須要修改SmileyImages屬性.
 
在初始狀態下截圖以下:
 

 
配置參數以下:

FCKConfig.FontNames  = '宋體;隸書;華文行楷;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;

FCKConfig.FontSizes  = '12px;14px;16px;18px;20px;24px;28px;smaller;larger;xx-small;x-small;small;medium;large;x-large;xx-large' ;
FCKConfig.SmileyPath = FCKConfig.BasePath + 'p_w_picpaths/smiley/QQFace/' ;

FCKConfig.SmileyImages = ['0.gif','1.gif','2.gif','3.gif','4.gif','5.gif','6.gif','7.gif','8.gif','9.gif','10.gif','11.gif','12.gif','13.gif','14.gif','15.gif','16.gif','17.gif','18.gif','20.gif','21.gif','22.gif','23.gif','24.gif','25.gif','26.gif','27.gif','28.gif','29.gif','30.gif’];
 
配置後的效果以下圖:
 
 
 
另外,當改變設置後必須清除緩存!

關於經過PHP來實現編輯器配置的方法,咱們明天再來研究吧!

祝各位聖誕節快樂!

晚安!
相關文章
相關標籤/搜索