CKEDITOR-在工具栏中创建新按钮
我正在尝试在编辑器工具栏中创建一个新按钮,并用它做一些事情,但没有办法 我的控制台中没有任何错误,工具栏中也没有显示任何内容 我的代码:CKEDITOR-在工具栏中创建新按钮,ckeditor,Ckeditor,我正在尝试在编辑器工具栏中创建一个新按钮,并用它做一些事情,但没有办法 我的控制台中没有任何错误,工具栏中也没有显示任何内容 我的代码: var textarea = $('#tiny_mce_block').find('textarea'); var textareaId; $(document).ready(function () { textareaId = textarea.attr('id'); // Récupère l'ID du textarea pour être t
var textarea = $('#tiny_mce_block').find('textarea');
var textareaId;
$(document).ready(function () {
textareaId = textarea.attr('id'); // Récupère l'ID du textarea pour être transformé par CKEDITOR
ckeditor_init(); // Initialisation de CKEDITOR
});
/*************************
CKEDITOR
************************/
function ckeditor_init() {
CKEDITOR.replace(textareaId, {
removePlugins: 'autosave, elementspath', //, liststyle, tabletools, contextmenu <= à ajouter pour supprimer click droit
language: 'fr',
entities: false,
entities_latin: false,
contentsCss: [
'/css/ckeditor_audio_transcription_v1.css',
'/plugins/bower_components/ckeditor/contents.css'
],
allowedContent: true,
extraAllowedContent: 'show, word',
disallowedContent: 'script, script; *[on*]',
enterMode: CKEDITOR.ENTER_P,
autoParagraph: false,
ignoreEmptyParagraph: true,
toolbar: [
['Bold', 'Italic', 'Underline', '-', 'TextColor'],
['Undo', 'Redo'],
['Find', 'Replace', 'SelectAll'],
['Maximize']
],
on: {
// Register command and button along with other plugins.
pluginsLoaded: function () {
var editor = this;
// Registers a command that applies the style.
// Note: it automatically adds Advanced Content Filter rules.
this.addCommand("alignementCommand", { // create named command
exec: function (edt) {
alert(edt.getData());
}
});
// Add toolbar button for this command.
this.ui.addButton && this.ui.addButton('alignementBoutton', {
label: 'Alignement',
command: 'alignementCommand',
toolbar: 'insert'
});
}
}
});
}
问题在哪里
谢谢大家!也许你应该考虑在CONFIG.工具栏中定义AlnutyButton?我是哑巴…谢谢@oleq最后一个问题,是否可以使用我的引导字体将图标添加到我的新按钮,而不是图像或其他什么?like:icon:'像html中的那样?