我正在与 CKEditor 打交道,为 liststyle 插件添加自定义列表样式。
我使用 CSS 类添加了一种新样式(如果您愿意,可以添加更多)。
方法如下:在liststyle.js(去混淆之后)我插入我的.logo 类:
..........
function e(c,e){
c.lang.liststyle.logo="My bullet"; // BBoyanov - adding 'My bullet' as title in dropdown list (in current language), otherwise it stay "empty" title
var b=c.lang.liststyle;
........
style:"width:150px",
items:[[b.notset,""],[b.circle,"circle"],[b.disc,"disc"],[b.square,"square"],
[b.logo,"logo"]],//BBoyanov - css class 'logo' as Bullet \,[b.logo,"logo"]\
........
commit:function(a){
var b=this.getValue();b?a.setStyle("list-style-type",b):a.removeStyle("list-style-type");
"logo"==b?a.setAttribute("class",'logo'):a.removeAttribute("class");//BBoyanv set 'logo' as CSS class
........
h={a:"lower-alpha",A:"upper-alpha",i:"lower-roman",I:"upper-roman",
1:"decimal", disc:"disc", circle:"circle", square:"square",logo:"logo"};//BBoyanov \,logo:"logo"\
........
您在 ckeditor.css(将在 CKEditor 中可视化)和您自己的 CSS 文件中定义 CSS 类。
如果你喜欢不同语言的不同标题,你必须把translation放在CKEditor对应语言的.js文件中。
它对我有用。
但是,这可能是注入,因为它接管了allowedContent - 需要测试和确认。