国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > 帝國Empire > 正文

帝國ECMS7.5默認(rèn)編輯器添加代碼高亮

2024-08-28 12:25:06
字體:
供稿:網(wǎng)友
因為發(fā)的技術(shù)文章多半含有代碼,如果沒有代碼插件,那代碼就顯的太難看了,恰好ckeditor官方提供了高亮插件,這里記錄一下如何實現(xiàn)。

一、下載插件及依賴工具
Code Snippet
widget
lineutils
widgetselection

二、將下載的插件解壓,并復(fù)制到帝國的ckeditor目錄下,注意是后臺的那個
默認(rèn)后臺目錄:e/admin/ecmseditor/infoeditor/plugins

三、修改配置文件
配置文件路徑:e/admin/ecmseditor/infoeditor/config.js
配置文件中共有兩個工具條,一個是全功能的,一個是精簡的
在兩個工具條中添加代碼工具CodeSnippet
然后在工具條下方添加代碼工具的配置
這里我把我的發(fā)上來供大家參考
CKEDITOR.editorConfig = function( config ) {	// Define changes to default configuration here. For example:	// config.language = 'fr';	// config.uiColor = '#AADC6E';		config.filebrowserImageUploadUrl = '';	config.filebrowserFlashUploadUrl = arraycs[0];	config.filebrowserImageBrowseUrl = arraycs[1];	config.filebrowserFlashBrowseUrl = arraycs[1];		config.enterMode = CKEDITOR.ENTER_BR;	config.shiftEnterMode = CKEDITOR.ENTER_P;	config.allowedContent= true;		config.font_names='宋體/宋體;黑體/黑體;仿宋/仿宋_GB2312;楷體/楷體_GB2312;隸書/隸書;幼圓/幼圓;微軟雅黑/微軟雅黑;'+ config.font_names;		// Toolbar	config.toolbar_full = [	{ name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source', '-', 'Preview', 'Print' ] },	{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },		{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl' ] },	'/',	{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat', 'ecleanalltext', 'autoformat' ] },		{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },	{ name: 'insert', items: [ 'Image', 'etranmore', 'Flash', 'etranmedia', 'etranfile', '-', 'Table', 'HorizontalRule', 'SpecialChar','CodeSnippet', 'equotetext', 'einserttime', 'einsertpage', 'einsertbr' ] },	'/',	{ name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },	{ name: 'colors', items: [ 'TextColor', 'BGColor' ] },	{ name: 'tools', items: [ 'ShowBlocks', 'NewPage', 'Templates' ] },	{ name: 'others', items: [ '-' ] },	{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', 'Maximize' ] }];	// Toolbar	config.toolbar_basic = [	{ name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source' ] },	{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },	{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },	{ name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar','CodeSnippet' ] },	{ name: 'tools', items: [ 'Maximize' ] },	{ name: 'others', items: [ '-' ] },	'/',	{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Strike', '-', 'RemoveFormat' ] },	{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote' ] },	{ name: 'styles', items: [ 'Styles', 'Format' ] },];	config.extraPlugins = 'etranfile,etranmedia,etranmore,autoformat,ecleanalltext,einsertbr,einsertpage,einserttime,equotetext';	config.extraPlugins ='codesnippet';	config.codeSnippet_theme = 'monokai_sublime';	config.toolbar = 'full';};


效果截圖:
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 栖霞市| 阳春市| 辰溪县| 四川省| 阳西县| 岳西县| 尼木县| 吴堡县| 鲁山县| 高安市| 定结县| 镇远县| 疏附县| 察雅县| 通海县| 吴川市| 桐柏县| 溧水县| 冕宁县| 秦安县| 贵定县| 英吉沙县| 墨玉县| 若羌县| 苗栗市| 同仁县| 红桥区| 右玉县| 延寿县| 廊坊市| 临沧市| 新野县| 阿勒泰市| 楚雄市| 大丰市| 商丘市| 将乐县| 望江县| 库车县| 忻城县| 正安县|