1.FCKeditorå¦ä½ä½¿ç¨
FCKeditorå¦ä½ä½¿ç¨
FCKEDITOR使ç¨è¯´æ-- :ä¸ãFCKEDITORç±»åè:
æé å¨:
FCKeditor( instanceName[,例源聚会支付系统源码 width, height, toolbarSet, value] )
instanceName:ç¼è¾å¨çå¯ä¸å称(ç¸å½äºID)
WIDTH:宽度
HEIGHT:é«åº¦
toolbarSet:å·¥å ·æ¡éåçå称
value:ç¼è¾å¨åå§åå 容
å±æ§:
instanceName:ç¼è¾å¨å®ä¾å
width:宽度,é»è®¤å¼ä¸º%
height:é«åº¦,é»è®¤å¼æ¯
ToolbarSet:å·¥å ·éå称,åèFCKCONFIG.JS,é»è®¤å¼æ¯Default
value:åå§åç¼è¾å¨çHTML代ç ,é»è®¤å¼ä¸ºç©º
BasePath:ç¼è¾å¨çåºè·¯å¾,é»è®¤ä¸º/Fckeditor/æ件夹,注æ,å°½éä¸è¦ä½¿ç¨ç¸å¯¹è·¯å¾.æ好è½ç¨ç¸å¯¹äºç«ç¹æ ¹è·¯å¾ç表示æ¹æ³,è¦ä»¥/ç»å°¾
CheckBrowser:æ¯å¦å¨æ¾ç¤ºç¼è¾å¨åæ£æ¥æµè§å¨å ¼å®¹æ§,é»è®¤ä¸ºtrue
DisplayErrors:æ¯å¦æ¾ç¤ºæ示é误,é»ä¸ºtrue;
éå:
Config[Key]=value;
è¿ä¸ªéåç¨äºæ´æ¹é ç½®ä¸æä¸é¡¹çå¼,å¦
oFckeditor.Config["DefaultLanguage"]="pt-br";
æ¹æ³:
Create() 建ç«å¹¶è¾åºç¼è¾å¨
RepaceTextArea(TextAreaName) ç¨ç¼è¾å¨æ¥æ¿æ¢å¯¹åºçææ¬æ¡
äºãé ç½®FCKEDITOR
主é ç½®æ件å为Fckconfig.js
FCKEDITORæä¾äºä¸å¥ç¨äºå®å¶å ¶å¤è§,ç¹æ§åè¡ä¸ºç设置é.ä½ æ¢å¯ä»¥ç¼è¾ä¸»é ç½®æ件,ä¹å¯ä»¥èªå·±å®ä¹åç¬çé ç½®æ件.é ç½®æ件使ç¨JAVASCRIPTè¯æ³.
ä¿®æ¹å,å¨å»ºç«ç¼è¾å¨æ¶,å¯ä»¥ä½¿ç¨ä»¥ä¸è¯æ³:
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.Config['CustomConfigurationsPath'] = '/myconfig.js' ;
oFCKeditor.Create() ;
æé:å½ä½ ä¿®æ¹é ç½®å,è¯·æ¸ ç©ºæµè§å¨ç¼å以æ¥çææ
é ç½®é项:
AutoDetectLanguage=true/false èªå¨æ£æµè¯è¨
BaseHref="" ç¸å¯¹é¾æ¥çåºå°å
ContentLangDirection="ltr/rtl" é»è®¤æåæ¹å
ContextMenu=å符串æ°ç»,å³é®èåçå 容
CustomConfigurationsPath="" èªå®ä¹é ç½®æ件路å¾åå称
Debug=true/false æ¯å¦å¼å¯è°è¯åè½,è¿æ ·,å½è°ç¨FCKDebug.Output()æ¶,ä¼å¨è°è¯çªä¸è¾åºå 容
DefaultLanguage="" 缺çè¯è¨
EditorAreaCss="" ç¼è¾åºçæ ·å¼è¡¨æ件
EnableSourceXHTML=true/false 为TRUEæ¶,å½ç±å¯è§åçé¢åæ¢å°ä»£ç 页æ¶,æHTMLå¤çæXHTML
EnableXHTML=true/false æ¯å¦å 许使ç¨XHTMLå代HTML
FillEmptyBlocks=true/false 使ç¨è¿ä¸ªåè½,å¯ä»¥å°ç©ºçå级å ç´ ç¨ç©ºæ ¼æ¥æ¿ä»£
FontColors="" 设置æ¾ç¤ºé¢è²æ¾åå¨æ¶æåé¢è²å表
FontFormats="" 设置æ¾ç¤ºå¨æåæ ¼å¼å表ä¸çå½å
FontNames="" åä½å表ä¸çåä½å
FontSizes="" åä½å¤§å°ä¸çåå·å表
ForcePasteAsPlainText=true/false 强å¶ç²è´´ä¸ºçº¯ææ¬
ForceSimpleAmpersand=true/false æ¯å¦ä¸æ&符å·è½¬æ¢ä¸ºXMLå®ä½
FormatIndentator="" å½å¨æºç æ ¼å¼ä¸ç¼©è¿ä»£ç 使ç¨çå符
FormatOutput=true/false å½è¾åºå 容æ¶æ¯å¦èªå¨æ ¼å¼å代ç
FormatSource=true/false å¨åæ¢å°ä»£ç è§å¾æ¶æ¯å¦èªå¨æ ¼å¼å代ç
FullPage=true/false æ¯å¦å 许ç¼è¾æ´ä¸ªHTMLæ件,è¿æ¯ä» å 许ç¼è¾BODYé´çå 容
GeckoUseSPAN=true/false æ¯å¦å 许SPANæ 记代æ¿B,I,Uæ è®°
IeSpellDownloadUrl=""ä¸è½½æ¼åæ£æ¥å¨çç½å
ImageBrowser=true/false æ¯å¦å 许æµè§æå¡å¨åè½
ImageBrowserURL="" æµè§æå¡å¨æ¶è¿è¡çURL
ImageBrowserWindowHeight="" å¾åæµè§å¨çªå£é«åº¦
ImageBrowserWindowWidth="" å¾åæµè§å¨çªå£å®½åº¦
LinkBrowser=true/false æ¯å¦å 许å¨æå ¥é¾æ¥æ¶æµè§æå¡å¨
LinkBrowserURL="" æå ¥é¾æ¥æ¶æµè§æå¡å¨çURL
LinkBrowserWindowHeight=""é¾æ¥ç®æ æµè§å¨çªå£é«åº¦
LinkBrowserWindowWidth=""é¾æ¥ç®æ æµè§å¨çªå£å®½åº¦
Plugins=object 注åæ件
PluginsPath="" æ件æ件夹
ShowBorders=true/false å并边æ¡
SkinPath="" ç®è¤æ件夹ä½ç½®
SmileyColumns= å¾ç¬¦çªåæ°
SmileyImages=å符æ°ç» å¾ç¬¦çªä¸å¾çæ件åæ°ç»
SmileyPath="" å¾ç¬¦æ件夹路å¾
SmileyWindowHeight å¾ç¬¦çªå£é«åº¦
SmileyWindowWidth å¾ç¬¦çªå£å®½åº¦
SpellChecker="ieSpell/Spellerpages" 设置æ¼åæ£æ¥å¨
StartupFocus=true/false å¼å¯æ¶FOCUSå°ç¼è¾å¨
StylesXmlPath="" 设置å®ä¹CSSæ ·å¼å表çXMLæ件çä½ç½®
TabSpaces=4 TABé®äº§ççç©ºæ ¼å符æ°
ToolBarCanCollapse=true/false æ¯å¦å 许å±å¼/æå å·¥å ·æ
ToolbarSets=object å 许使ç¨TOOLBARéå
ToolbarStartExpanded=true/false å¼å¯æ¯TOOLBARæ¯å¦å±å¼
UseBROnCarriageReturn=true/false å½å车æ¶æ¯äº§çBRæ è®°è¿æ¯Pæè DIVæ è®°
ä¸ãèªå®ä¹æ ·å¼å表
FckStyls.xmlæ¯é»è®¤çèªå®ä¹æ ·å¼å表æ件ã
FCKEDITORçæ ·å¼å·¥å ·æ ä¸æä¾äºé¢å®ä¹çæ ·å¼,æ ·å¼æ¯éè¿XMLæ件å®ä¹ç,é»è®¤çXMLæ ·å¼æ件åå¨äºFCkEditoræ ¹æ件夹ä¸çFckStyls.xmlæ件ä¸è¿ä¸ªXMLæ件çç»æåæå¦ä¸:
<?xml version="1.0" encoding="utf-8" ?>
<Styles >
<Style name="My Image" element="img">
<Attribute name="style" value="padding: 5px" />
<Attribute name="border" value="2" />
</Style >
<Style name="Italic" element="em" />
<Style name="Title" element="span">
<Attribute name="class" value="Title" />
</Style >
<Style name="Title H3" element="h3" />
</Styles>
æ¯ä¸ä¸ªSTYLEæ è®°å®ä¹ä¸ç§æ ·å¼,NAMEæ¯æ¾ç¤ºå¨ä¸æå表ä¸çæ ·å¼å,ELEMENTå±æ§æå®æ¤æ ·å¼æéç¨ç对象,å 为FCKEDITORä¸çæ ·å¼æ¯ä¸ä¸æææç,ä¹å°±æ¯è¯´,éæ©ä¸åç对象,ä» ä¼æ¾ç¤ºé对è¿ç±»å¯¹è±¡å®ä¹çæ ·å¼
åãæ¼åæ£æ¥
FCKEDITOR 带äºä¸¤ç§æ¼åæ£æ¥å·¥å ·,ä¸ç§æ¯ieSpell,é»è®¤æ åµä¸ä½¿ç¨è¿ç§,使ç¨è¿ç§æ¹å¼çæ¼åæ£æ¥,è¦æ±å®¢æ·ä¸è½½å¹¶å®è£ iespellè¿ä¸ªå°è½¯ä»¶,å¦å¤,ä¹æä¾ SpellPagerçæ¹å¼æ¥è¿è¡æ¼åæ£æ¥,ä¸è¿,ç±äºSPELLPAGERæ¯ç±PHPç¼åçæå¡å¨ç«¯èæ¬,å æ¤,è¦æ±ä½ çWEBæå¡å¨å¿ é¡»æ¯æPHPèæ¬è¯è¨æ¹å¯
æ´æ¹æ¼åæ£æ¥å¨çæ¹å¼è¯·åè§æå ³é ç½®æ件ç详ç»è¯´æ
äºãå缩èæ¬
为äºæä¾èæ¬è½½å ¥çæç,FCKEDITORéç¨ä»¥ä¸æ¹æ³å¯¹èæ¬å°½éå缩以åå°èæ¬å°ºå¯¸:
1,移é¤æèæ¬ä¸ç注é
2.移é¤æèæ¬ä¸æææ æä¹ç空ç½
å¦å¤,FCKEDITORè¿æä¾äºä¸ä¸ªä¸é¨ç¨äºå缩èæ¬çå·¥å ·ä»¥ä¾¿ ä½ å¨åå¸æ¶è½åå°æ件尺寸,ä½ å¯ä»¥å°_Packageræ件夹ä¸çFckeditor.Packager.exeå¤å¶å°FCKEDITORæ ¹æ件夹æ¥è¿è¡å¹¶å缩èæ¬
å ãæ¬å°åFCKEDITOR
å¦æFCKEDITOR没ææä¾æ¨æéè¦çè¯è¨(å®é ä¸å ¨æäº),ä½ ä¹å¯ä»¥èªè¡å¶ä½æ°çè¯è¨,ä½ åªéè¦å¤å¶åºEN.JS,ç¶åå¨å ¶åºç¡ä¸è¿è¡ç¿»è¯.å¦å¤,è¯è¨å称ä¸å¯¹åºçèæ¬æ件åå¿ é¡»éµå¾ªRFC æ å,ä½æ¯,éè¦å°å,ä¾å¦:Portuguess Language对åºçèæ¬æ件åå¿ é¡»ä¸ºpt.jså¦æéè¦é对æ个å½å®¶çæç§è¯ç³»,åå¯ä»¥å¨è¯ç³»ç¼©ååå ä¸æ¨ªçº¿åå½å®¶ç¼©åå³å¯
å¨ä½¿ç¨æ¶,ç³»ç»ä¼èªå¨ä¾¦æµå®¢æ·ç«¯è¯ç³»åå½å«èè¿ç¨éå½ççé¢è¯è¨.
å½å»ºç«ä¸ç§æ°çè¯è¨å,ä½ å¿ é¡»å¨"Edit/lang/fcklanguagemanager.js"ä¸ä¸ºå ¶å»ºç«ä¸ä¸ªæ¡ç®,å¦ä¸æ示:
FCKLanguageManager.AvailableLanguages =
{
en : 'English',
pt : 'Portuguese'
}
éè¦æéçæ¯,æä»¶å¿ é¡»ä¿å为UTF-8æ ¼å¼
å ãä¸ASP.NETæå¡å¨ç«¯èæ¬è¿è¡äº¤äº
1.æFCKEDITORæ·»ä¸å°å·¥å ·ç®±
2.ææ½FCKEDITORæ§ä»¶å°é¡µé¢
3.ä¸ºå ¶æå®å称
4.FCKEDITOR ç±»çææå±æ§ä¸å å¯ä»¥å¨ä»£ç ä¸ä½¿ç¨,èä¸å¯ä»¥ä½ä¸ºFCKEDITORæ§ä»¶çå±æ§ç´æ¥ä½¿ç¨,ä¾å¦,è¦æ¹åç®è¤,å¯ä»¥å¨UI页é¢ä¸æå®SkinPath= "/fckeditor/editor/skins/office"å³å¯,å ¶å®FCKEDITORçASP.NETçæ¬å¯ä»¥åå¾æ´å¥½,ä½ å¯ä»¥æ¾å° FCKEDITOR ASP.NET 2.1çæºæ件,ç¶åä¿®æ¹è¯¥æ§ä»¶ç设计,ä¸ºå ¶æ´é²æ´å¤æç¨çå±æ§,éæ°ç¼è¯å³å¯
5,POSTBACKåçæ°æ®,使ç¨FCKEDITORæ§ä»¶çvalueå±æ§è·å¾
6. ç±äºé»è®¤ç¶æä¸,ASP.NETä¸å 许æ交å«æHTMLåJAVASCRIPTçå 容,å æ¤,ä½ å¿ é¡»å°ä½¿ç¨FCKEDITORç页é¢ç ValidateRequest设为false.(<%@page validteRequest="false" %>å³å¯)
ä¸ã设置ä¸ä¼ æ件è¯è¨
æFCKeditoræ ¹ç®å½ä¸é¢çfckconfig.jsæ件é
var _FileBrowserLanguage = 'asp' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'asp' ; // asp | aspx | cfm | lasso | php
è¿ä¸¤è¡ä¸æ¹ææ¨æéè¦è°ç¨çç¼è¾å¨è¯è¨ï¼å¦ç¨asp.netåæ¹ä¸ºaspxï¼
å «ã解å³ä¸æçé®é¢:
å¨web.configä¸å å ¥:
<globalization requestEncoding="GB" responseEncoding="GB"/>
è¿æ ·è®¾ç½®åå¯ä»¥æ¾ç¤ºä¸æçæ件ï¼ä½URLå°åä¹æ¯ä¸æçï¼
å¦ææå¡å¨å¯¹ä¸æå°åç解æä¸å¥½ï¼å¯è½å¯¼è´å¾çæ æ³æµè§ï¼
æ以修æ¹ï¼editor\filemanager\browser\default\frmresourceslist.html
ä¸çOpenFileå½æ°ï¼æ
window.top.opener.SetUrl( fileUrl ) ;
ä¿®æ¹ä¸º:
window.top.opener.SetUrl( escape(fileUrl) ) ;
ä¹.设置ä¸ä¼ çç®å½ï¼
1:å¨web.configä¸è®¾ç½®:
<appSettings>
<add key="FCKeditor:UserFilesPath" value="/fck/UpLoad/" />
</appSettings>
2:å¨Sessionä¸è®¾ç½®:
å¨editor\filemanager\browser\default\connectors\aspx\connector.aspxä¸å å ¥ä»¥ä¸ä»£ç :
<script runat="server" language="C#">
protected override void OnInit(EventArgs e)
{
Session["FCKeditor:UserFilesPath"] = "/fck/UpLoad1/";
}
</script>