网络编程
位置:首页>> 网络编程>> Asp编程>> FCKeditor编辑器基本配置优化修改使用方法(2)

FCKeditor编辑器基本配置优化修改使用方法(2)

  发布时间:2008-12-31 13:32:00 

标签:FCKeditor,编辑器,设置,配置

下面详细的说明一下一些常用的配置选项:

FCKConfig.DefaultLanguage = 'en' ; //选择编辑器的语言,editor/lang/文件夹下面的有相应的语言脚本文件。
FCKConfig.ToolbarStartExpanded = true ;//载入编辑器的时候展开还是收缩工具按钮。
FCKConfig.ToolbarSets["Default"] 和 FCKConfig.ToolbarSets["Basic"]是载入的时候显示全部工具按钮还是部分基本按钮。可以在fckeditor.js或者 fckeditor.asp/php等文件中设置。
FCKConfig.ContextMenu这个是编辑器的右键配置文件,可以自己增减对应按钮。
FCKConfig.LinkBrowser = false ;//浏览服务器上的文件,如果选择false不允许的话,接下去的几行可以相应的注释掉。后面的FCKConfig.ImageBrowser = false ;FCKConfig.FlashBrowser = false ;也是如此。如果选择允许的话,将相应的程序语言部分的注释去掉。
FCKConfig.LinkUpload = true ;FCKConfig.ImageUpload = true ;FCKConfig.FlashUpload = true ;这三个配置选项是设置文件上传的,如果不允许用户上传文件,则把true修改为false即可。如果允许,请在相应的程序语言里选择,即把对应的注释行去掉即可。
修改完毕之后再打开相应的程序语言的FCKeditor文件继续。

三、修改编辑器载入时的配置:

打开fckeditor.js或者fckeditor.asp/php/pl等文件,这些文件的配置情况都是差不多的。这里拿fckeditor.js说明。
Width:编辑器宽度。
Height:编辑器高度。
ToolbarSet:编辑器工具按钮:default或者basic。
BasePath:编辑器所在目录,建议使用根目录形式。
其它的就可以设置默认的就可以了。

四、使用FCKeditor编辑器:

1、ASP程序语言载入编辑器:

包含文件fckeditor.asp文件,然后在相应的地方加入下面的代码:

<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "/"

oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "100%"
oFCKeditor.Height = "400"

oFCKeditor.Value = rs("Content")
oFCKeditor.Create "Content"
%>

2、JS程序语言载入编辑器:

引用脚本fckeditor.js文件,在相应的地方加入下面的代码:

<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'Content' ) ;
oFCKeditor.BasePath = '/' ;
oFCKeditor.ToolbarSet = 'Basic' ;
oFCKeditor.Width = '100%' ;
oFCKeditor.Height = '400' ;
oFCKeditor.Value = '' ;
oFCKeditor.Create() ;
</script>

JS语言版本的还有一种替换文本框加快页面显示的文件,在这里我选择的是点击编辑框才出现编辑器,引用fckeditor.js文件,加入如下代码:

<script type="text/javascript">
<!--
function ShowEditor() {
    var oFCKeditor = new FCKeditor( 'Content' ) ;
    oFCKeditor.BasePath    = "../FCKeditor/" ;
    oFCKeditor.Value    = '' ;
    oFCKeditor.ReplaceTextarea() ;
}
//-->
</script><div id="preContent"><textarea id="Content" onclick="javascript:ShowEditor();"></textarea></div>

3、PHP程序语言载入编辑器:

包含fckeditor.php文件,在相应的地方加入下面的代码:

<?php
$oFCKeditor = new FCKeditor('Content') ;
$oFCKeditor->BasePath    = "../FCKeditor/" ;
$oFCKeditor->Value        = '' ;
$oFCKeditor->Create() ;
?>

 

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com