首页 Domino整合Fckeditor(文件上传、可视化编辑)
文章
取消

Domino整合Fckeditor(文件上传、可视化编辑)

1.修改Notes.ini设置:
DominoDisableFileUploadChecks=1

2.新建一富文本域

如果你的编辑与显示表单是同一张,可能会遇到不解析HTML的情况,那就需要把富文本域加在“[         ]”之间。

3.建一数据库,存放通过FckEditor上传的资源

新建三类表单分别存放图片、Flash和普通文件(对应FckEditor中的ImageUpload 、FlashUpload 和LinkUpload ),如果觉得不需要分类也可以只建一个表单。[wpfilebase tag='file' id='1']

4.修改FckEditor JS文件

*根据需要修改fckconfig.js

FCKConfig.LinkUpload = true ;FCKConfig.ImageUpload = true ;FCKConfig.FlashUpload = true ;

*修改fck_flash.js,在

// Set the actual uploader URL.
if ( FCKConfig.FlashUpload )
	GetE('frmUpload').action = FCKConfig.FlashUploadURL ;

后添加:

if(FCKConfig.FlashUploadName)
	GetE("txtUploadFile").name = FCKConfig.FlashUploadName;
*修改fck_image.js,在
UpdateOriginal() ;
// Set the actual uploader URL.
if ( FCKConfig.ImageUpload )
	GetE('frmUpload').action = FCKConfig.ImageUploadURL ;

后添加:

if(FCKConfig.ImageUploadName)
	GetE('txtUploadFile').name=FCKConfig.ImageUploadName;

*修改fck_link.js,在

// Set the actual uploader URL.
if ( FCKConfig.LinkUpload )
	GetE('frmUpload').action = FCKConfig.LinkUploadURL ;

后添加

if(FCKConfig.LinkUploadName)
	GetE("txtUploadFile").name=FCKConfig.LinkUploadName;

4.集成FckEditor至富文本域

在JS头上添加加载FckEditor替换富文本域的代码:

window.onload = function()
{
var curDBPath = document.location.href.substring(0, document.location.href.indexOf(".nsf")+4)var sBasePath = '/fckeditor/';
var fckDBPath = "/StdPublic/fckeditor.nsf"
var blogsphereRepID = '862570e0004d5a0a';
var ImageUploadUNID    = '7776b9e374369061862570e200292c38';
var LinkUploadUNID = '288fb109df6447d5862570e20029030f';
var FlashUploadUNID    = '54a04ff5fdbd678d862570e200287d46';var oFCKeditor = new FCKeditor('fldBody') ;
oFCKeditor.BasePath    = sBasePath ;
oFCKeditor.Height    = 400 ;oFCKeditor.Config.ImageBrowserURL        = fckDBPath + '/fck_ImageBrowser' ;
oFCKeditor.Config.ImageUploadURL         = fckDBPath + '/fck_ImageUpload?CreateDocument' ;
oFCKeditor.Config.LinkBrowserURL        = fckDBPath + '/fck_LinkBrowser' ;
oFCKeditor.Config.LinkUploadURL        = fckDBPath + '/fck_LinkUpload?CreateDocument' ;
oFCKeditor.Config.FlashBrowserURL        = fckDBPath + '/fck_FlashBrowser' ;
oFCKeditor.Config.FlashUploadURL        = fckDBPath + '/fck_FlashUpload?CreateDocument' ;oFCKeditor.Config.ImageUploadName        = '%%File.' + blogsphereRepID + '.'+ImageUploadUNID+'.$Body.0.70' ;
oFCKeditor.Config.LinkUploadName        = '%%File.' + blogsphereRepID + '.'+ LinkUploadUNID +'.$Body.0.70' ;
oFCKeditor.Config.FlashUploadName        = '%%File.' + blogsphereRepID + '.'+ FlashUploadUNID +'.$Body.0.70' ;oFCKeditor.ReplaceTextarea();
}

注:测试成功于FckEditor 2.6.4

参考:FckEditor Server Side Integration

Adding Your Own File Uploads to Forms

Rich text editing, browser & Domino - here's is how to do it

本文由作者按照 CC BY 4.0 进行授权