为CommunityServer升级代码加亮功能!

1、下载和引用新的组件:
        ActiproSoftware.CodeHighlighter.dll    v3.0.14.0
        ActiproSoftware.Shared.dll                  v1.0.73.0
2、更新Languages和OutliningIndicators文件夹的内容。
3、更新或添加以下文件:
         SemanticCSharpParser.cs
         SemanticCssParser.cs
         SemanticHtmlParser.cs
         SemanticJavaParser.cs
         SemanticJScriptParser.cs
         SemanticSqlParser.cs
         SemanticVBDotNetParser.cs
4、更新InsertCode.aspx文件,添加是否折叠和是否显示行号的选项,更新其中的HighlightButton_Click事件为:
        Codehighlighter.LanguageKey = LanguageDropDownList.SelectedItem.Text; 
        Codehighlighter.OutliningEnabled = EnableCollapse.Checked; //是否开启折叠 
        Codehighlighter.LineNumberMarginVisible = EnableRowNumber.Checked; //是否显示行号 
        Codehighlighter.Text = CodeText.Text;
5、编辑communityserver.config文件,为<img>标签添加onclick事件。如:
 <MarkUp>
 <globalAttributes>
  <class enable = "true" />
  <align enable = "true" />
  <id enable = "true" />
  <style enable = "true" />
 </globalAttributes>
 <html>
  ..............
  <img src = "true" alt = "true" title = "true" border = "true" width = "true" height = "true" onclick = "true" />
 ...................
  <xmp />
 </html>
</MarkUp>

源码下载:http://files.cnblogs.com/BillChen/代码加亮.rar
解压密码:www.ruiya.com

你可能感兴趣的:(server)