5. 配置CKEditor
修改ckeditor\config.js中的內容如下:
CKEDITOR.editorConfig = function (config) { var ckpath = '.'; //這裡為ckeditor檔案夾所在的路徑,用於下面6個ckfinder路徑的設定 config.filebrowserBrowseUrl = ckpath + '/ckfinder/ckfinder.html'; //上傳檔案的查看路徑 config.filebrowserImageBrowseUrl = ckpath + '/ckfinder/ckfinder.html?Type=Images'; //上傳圖片的查看路徑 config.filebrowserFlashBrowseUrl = ckpath + '/ckfinder/ckfinder.html?Type=Flash'; //上傳Flash的查看路徑 config.filebrowserUploadUrl = ckpath + '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files'; //上傳檔案的儲存路徑 config.filebrowserImageUploadUrl = ckpath + '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images'; //上傳圖片的儲存路徑 config.filebrowserFlashUploadUrl = ckpath + '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'; //上傳Flash的儲存路徑 // Define changes to default configuration here. For example: config.language = 'zh-cn'; //配置語言 // config.uiColor = '#FFF'; //背景顏色 // config.width = 400; //寬度 // config.height = 400; //高度 config.skin = 'v2'; //編輯器樣式 // 取消 “拖拽以改變尺寸”功能 config.resize_enabled = false; // 基礎工具列 // config.toolbar = "Basic"; // 全能工具列 // config.toolbar = "Full"; // 自訂工具列 config.toolbar = [ ['Source', '-', 'Preview'], ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'], ['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'], ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote', 'ShowBlocks'], '/', ['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['Link', 'Unlink', 'Anchor'], ['Image', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar'], '/', ['Styles', 'Format', 'Font', 'FontSize'], ['TextColor', 'BGColor'], ['Maximize', '-', 'About'] ]; //CKFinder.SetupCKEditor(null, '/ckfinder/');};
可以根據自己的需要對工具列等屬性進行修改。