FiercePanda 发表于 2013-2-7 16:32:33

FCKeditor 使用

自定义工具条,修改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>
页: [1]
查看完整版本: FCKeditor 使用