六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 31|回复: 0

FCKeditor 使用

[复制链接]

升级  31.33%

25

主题

25

主题

25

主题

秀才

Rank: 2

积分
97
 楼主| 发表于 2013-2-7 16:32:33 | 显示全部楼层 |阅读模式
自定义工具条,修改fckconfig.js
原有FCKConfig.ToolbarSets["Default"] FCKConfig.ToolbarSets["Basic"]
可以重新在后面添加自定的。
 
工具条中template的使用:
fckconfig.js中的ToolbarSets中添加['Templates']
fcktemplates.xml中添加自定义的template
 
页面调用:
<html
<head>
 <title>FCKeditor - Sample</title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta name="robots" content="noindex, nofollow" />
 <link href="../sample.css" rel="stylesheet" type="text/css" />
 <script type="text/javascript" src="../../fckeditor.js"></script>
 <script type="text/javascript">

window.onload = function()
{
 var oFCKeditor = new FCKeditor( 'body' ) ;

 oFCKeditor.BasePath = "/fckeditor/" ;  //FCKeditor根目录
 oFCKeditor.Height = 300;
 oFCKeditor.Width = 600;
 oFCKeditor.ToolbarSet = "Custom" ;
 oFCKeditor.Value = "";
 oFCKeditor.ReplaceTextarea();
}
</script>
</head>
<body>
 <h1>
  FCKeditor - JavaScript - Sample My</h1>
 <div>
  This sample displays a normal HTML form with an FCKeditor with full features enabled.
  It uses the "ReplaceTextarea" command to create the editor.
 </div>
 <hr />
 <form action="" method="post" target="_blank">
  <div>
   <textarea name="body" rows="10" cols="80" style="width: 100%; height: 200px"></textarea>
  </div>
  <br />
  <input type="submit" value="Submit" />
 </form>
</body>
</html>
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表