.net環境下ckeditor與ckfinder學習筆記

而立大叔發表於2012-07-19
一.ckeditor 3.0.1精簡

精簡前:4.52M   精簡後:853K

1.刪除_samples和_source資料夾,分別為示例檔案和未壓縮源程式

2.刪除lang資料夾下除zh-cn.js,en.js下的所有語言檔案.根據需要刪除

3.刪除根目錄下的changes.html(更新列表),install.html(安裝指向),license.html(使用許可).

4.刪除skins目錄下不需要的皮膚.我一般用V2(簡單.樸素) //如果只保留V2則必須在config.js中指定皮膚

二.ckeditor 3.0.1相關檔案配置路徑

1./ckeditor.js   核心檔案,呼叫需載入

2./config.js     配置檔案,引數配置均在此完成

3./plugins/smiley/images 表情符號.

三.ckeditor應用(.net環境)

   1.引用js指令碼

   <script type="text/javascript" src="ckeditor/ckeditor.js"></script>

   2.將相應的控制元件替換成編輯器程式碼

   <asp:TextBox ID="TextBox1" runat="server" Rows="10" TextMode="MultiLine"></asp:TextBox>

   <script type="text/javascript">CKEDITOR.replace('TextBox1')</script>

四.ckeditor配置(config.js配置檔案)

   詳細api引數見:http://docs.cksource.com/ckeditor_api/,我的預設配置

   CKEDITOR.editorConfig = function(config) {

config.language = "zh-cn";

config.skin = "v2";

config.width = "80%";

config.height = "400px";

config.resize_enabled = false;

config.toolbar =

[

['Source', 'Preview', '-'],

['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', ],

['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'],

['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak'],

'/',

['Bold', 'Italic', 'Underline', '-', 'Subscript', 'Superscript'],

['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'],

['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],

['Link', 'Unlink', 'Anchor'],

'/',

['Format', 'Font', 'FontSize'],

['TextColor', 'BGColor'],

['Maximize', 'ShowBlocks', '-', 'About']

];

ckfinder學習筆記

一.ckfinder精簡

   精簡前:1.10M 精簡後:947K

   1.刪除_samples和_source資料夾,分別為示例檔案和未壓縮源程式

   2.刪除根目錄下changelog.txt,install.txt,license.txt檔案

   3.刪除core/lang目錄下除en.js,zh-cn.js的所有語言檔案(根據條件刪除)

二.ckfinder配置

   1.複製/bin目錄下的ckfinder.dll檔案至站點bin目錄

   2.複製ckfinder目錄至站點根目錄下(可另選擇路徑)

三.ckfinder應用

1.與ckeditor整合,詳情見官方文件,官方文件是載入修改,我用的方法是全域性修改.

具體操作方法如下:修改ckeditor目錄下的config.js檔案,新增:

config.filebrowserBrowseUrl = '/ckfinder/ckfinder.html';

    config.filebrowserImageBrowseUrl = '/ckfinder/ckfinder.html?Type=Images';

    config.filebrowserFlashBrowseUrl = '/ckfinder/ckfinder.html?Type=Flash';

    config.filebrowserUploadUrl = '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files';

    config.filebrowserImageUploadUrl = '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images';

    config.filebrowserFlashUploadUrl = '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash';

    config.filebrowserWindowWidth = '800';

    config.filebrowserWindowHeight = '500';

以上URL值需要根據你ckfinder路徑的不同而不同,

2.單獨應用

3.破解:

開啟core/js下的兩個ckfinder_ie.js和ckfinder_gecko.js檔案.查詢字串"en.call(window,qo);"將其註釋即可

原文連結:http://hua7073.blog.163.com/blog/static/600177372009103101655429/

相關文章