2017-08-08 56 views
0

我已修改文件styles.js用的样式的一个示例:CKEditor的新的样式不工作(laravel 5)

CKEDITOR.stylesSet.add('estilos', [ 
// Block-level styles 
{ name: 'Blue Title', element: 'h2', styles: { 'color': 'Blue' } }, 
{ name: 'Red Title' , element: 'h3', styles: { 'color': 'Red' } }, 

// Inline styles 
{ name: 'CSS Style', element: 'span', attributes: { 'class': 'my_style' } }, 
{ name: 'Marker: Yellow', element: 'span', styles: { 'background- 

color': 'Yellow' } } 
]); 

而在config.js我增加了行:config.stylesSet =“estilos “;

CKEDITOR.editorConfig = function(config) { 

config.stylesSet = 'estilos'; 

config.toolbarGroups = [ 
    { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, 
    { name: 'editing',  groups: [ 'find', 'selection', 'spellchecker' ] }, 
    { name: 'links' }, 
    { name: 'insert' }, 
    { name: 'forms' }, 
    { name: 'tools' }, 
    { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, 
    { name: 'others' }, 
    '/', 
    { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, 
    { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] }, 
    { name: 'styles' }, 
    { name: 'colors' }, 
    { name: 'about' } 
]; 

config.removeButtons = 'Underline,Subscript,Superscript'; 
config.format_tags = 'p;h1;h2;h3;pre'; 
config.removeDialogTabs = 'image:advanced;link:advanced'; 
}; 

但是,这是行不通的。视图中的样式选项已禁用: Styles option view

任何想法?谢谢。

+0

你可以做一个工作演示吗?包括ckedit的init函数等。 –

+0

谢谢,Thomas Moors,我已经解决了它。我把答案写在下面;) – nature

回答

0

好了,我已经解决了吧:) 你必须放线config.stylesSet =“estilos” config.toolbarGroups

我希望这将是有用的人后