麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 開發(fā) > 綜合 > 正文

ckeditor4整合高亮插件syntaxhighlight實例

2024-07-21 02:53:21
字體:
來源:轉載
供稿:網友

第一步:下載ckeditor-syntaxhighlight插件,下載地址:
https://github.com/dbrain/ckeditor-syntaxhighlight,下載完成解壓,將plugins文件夾拷到ckeditor(當前版本是4.1.2)的目錄下,合并同名文件夾!

第二步:打開config.js
增加    config.extraPlugins = "syntaxhighlight";行
并在面板配置中增加syntaxhighlight,如下

CKEDITOR.editorConfig = function( config ){    config.extraPlugins = "syntaxhighlight";	config.toolbar = 'Index';	config.toolbar_Index =	[        ['Source','Preview','Maximize'],        ['Cut','Copy','Paste','PasteText'],        ['SelectAll','RemoveFormat'],        ['Bold','Italic','Underline','Strike'],        ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],        ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],        ['Link','Unlink','Image','Flash','Table','HorizontalRule','SpecialChar','PageBreak'],        ['Font', 'FontSize', 'TextColor', 'BGColor', 'syntaxhighlight']    ];};

第三步:打開ckeditor/plugins/syntaxhighlight/plugin.js,將

var pluginName = 'code';

改成

var pluginName = 'syntaxhighlight';

然后打開ckeditor/plugins/syntaxhighlight/lang/en.js,將

CKEDITOR.plugins.setLang('syntaxhighlight', 'en',{    syntaxhighlight:{        title: 'Add or update a code snippet',        sourceTab: 'Source code',        langLbl: 'Select language',        advancedTab: 'Advanced',        hideGutter: 'Hide gutter',        hideGutterLbl: 'Hide gutter & line numbers.',        hideControls: 'Hide controls',        hideControlsLbl: 'Hide code controls at the top of the code block.',        collapse: 'Collapse',        collapseLbl: 'Collapse the code block by default. (controls need to be turned on)',        showColumns: 'Show columns',        showColumnsLbl: 'Show row columns in the first line.',        lineWrap: 'Disable line wrapping',        lineWrapLbl: 'Switch off line wrapping.',        lineCount: 'Default line count',        highlight: 'Highlight lines',        highlightLbl: 'Enter a comma seperated lines of lines you want to highlight, eg <em>3,10,15</em>.'    }});

改成

CKEDITOR.plugins.setLang('syntaxhighlight', 'en',{    title: 'Add or update a code snippet',    sourceTab: 'Source code',    langLbl: 'Select language',    advancedTab: 'Advanced',    hideGutter: 'Hide gutter',    hideGutterLbl: 'Hide gutter & line numbers.',    hideControls: 'Hide controls',    hideControlsLbl: 'Hide code controls at the top of the code block.',    collapse: 'Collapse',    collapseLbl: 'Collapse the code block by default. (controls need to be turned on)',    showColumns: 'Show columns',    showColumnsLbl: 'Show row columns in the first line.',    lineWrap: 'Disable line wrapping',    lineWrapLbl: 'Switch off line wrapping.',    lineCount: 'Default line count',    highlight: 'Highlight lines',    highlightLbl: 'Enter a comma seperated lines of lines you want to highlight, eg <em>3,10,15</em>.'});

到此,插件配置完畢,已經可以正常使用了,但是前端記得要引用syntaxhighlighter相關的JS與css.


注:相關教程知識閱讀請移步到編輯器頻道。
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 草碰人人| 香蕉久久久久久 | 久久久久久久久久美女 | 在线高清中文字幕 | 一区二区三高清 | 在线成人免费av | 免费观看一区二区三区视频 | 久久久久久久免费看 | 免费观看一区二区三区视频 | jizzjizz中国人少妇中文 | 日韩黄色在线播放 | 久久久国产电影 | 亚洲一区二区三区四区精品 | xxx日本视频 | 蜜桃麻豆视频 | 羞羞漫画无遮挡观看 | av在线1| 九七在线视频 | av在线看网站 | 精品一区二区视频在线观看 | 综合日韩av| 日本网站一区 | 视频一区二区不卡 | av在线日韩 | 曰批全过程120分钟免费69 | av国产片| 欧美一级毛片特黄黄 | 91精品国产91久久久久久蜜臀 | 国产免费资源 | 欧美性生交xxxxx久久久缅北 | 国内精品久久久久久久久久 | 欧美日韩大片在线观看 | 国产精品久久久久久婷婷天堂 | 草b视频在线观看 | 毛片免费在线视频 | 日本s级毛片免费观看 | 黄色高清av | 亚洲成人在线免费观看 | 香蕉久久久久久 | 看免费的毛片 | 日本高清在线播放 |