FCKeditor毫无疑问已经是WEB编辑器的龙头老大,功能强,使用广,为广大程序员所喜欢。
dp.syntaxhighlighter是完全用javascript编写,用来实现语法高亮的工具。以其方便易用,功能强大,赢了广大开发的青睐。
很多人都很喜欢WORDPRESS的语法亮亮,可以以WORDPRESS的语法高亮插件是赢得如此之多程序员喜欢的重要理由。
想把syntaxhighlighter做成FCKeditor的插件的想法由来已久。这周经过仔细研究,终于成功完成了一大步。第一时间推出了,让大家一起感觉FCKeditor与syntaxhighlighter双剑合壁的简单方便与巨大威力。
具体的开发需要熟悉开发FCKeditor插件,了解syntaxhighlighter的用法。在这里就不多说了,有兴趣的可以自己研究一下。
这里只简单的讲一下使用方法。到http://www.lamper.cn/html/2007/10-26/82.html下载结合了syntaxhighlighter的FCKeditor,并带有示例页面。
解压到适应目录后,修改sample.html页面里的sBasePath变量。
    1. <script type="text/javascript">    
   2.     //注意这里,根据实际环境修改  
   3.         var sBasePath = "http://localhost/my_works/FCKeditor_with_syntaxhighlighter/FCKeditor/";    
   4.         var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;    
   5.         oFCKeditor.BasePath = sBasePath ;    
   6.         // Set the custom configurations file path (in this way the original file is mantained).    
   7.         oFCKeditor.Config['CustomConfigurationsPath'] = sBasePath + 'custom.config.js' ;    
   8.         // Let's use a custom toolbar for this sample.    
   9.         oFCKeditor.ToolbarSet   = 'custom' ;    
  10.         oFCKeditor.Value        = '' ;    
  11.         oFCKeditor.Create() ;    
  12. </script>   
这里面不太好写,我在lamper上写了完整的文章,有兴趣的可以看一下,地址是http://www.lamper.cn/html/2007/10-26/82.html