Я использую CKEditor для проекта, и я новичок в нем. По некоторым причинам я не могу использовать панель инструментов. поэтому я должен сделать серию кнопок, чтобы сделать работу по стилю. например, к жирным выделенному тексту я использую:CKEditor: программно изменить выравнивание пункта
CKEDITOR.instances['id-pic-info-edit'].execCommand('bold');
, но я не могу найти команду для выравнивания (обосновывать, слева, справа, в центре).
Я также установил плагин «justify».
вот мой config.js
:
config.toolbar = 'Custom'; //makes all editors use this toolbar
config.toolbar_Custom = []; //define an empty array or whatever buttons you want.
// The toolbar groups arrangement, optimized for a single toolbar row.
config.toolbarGroups = [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'forms' },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
{ name: 'links' },
{ name: 'insert' },
{ name: 'styles' },
{ name: 'colors' },
{ name: 'alignment', groups : [ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ] },
{ name: 'tools' },
{ name: 'others' },
{ name: 'about' }
];
// The default plugins included in the basic setup define some buttons that
// are not needed in a basic editor. They are removed here.
config.removeButtons = 'Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,Subscript,Superscript';
// Dialog windows are also simplified.
config.removeDialogTabs = 'link:advanced';
config.allowedContent = 'u em strong ul li;a[href,target,title];span[class];h1 h2 h3 h4';
config.extraPlugins = 'justify';
большое спасибо. это спасет меня так много времени. –
Это тоже помогло. Спасибо! – Eugene