これは、同様のシナリオのための私のアプローチです。
デフォルトの画像アイコンやその他の不要なアイコンを無効にしました。
私は自分のボタンを追加し、アイコンのために、デフォルトのpngの代わりにフォントのすばらしいアイコンを使用しました。
//In the config.js
var editor;
var plgnIconSize = "16px";
var plgnIcons = ["fa-file-image-o", ...];
var plgnNames = 'img,... Other plugins';
var plgnDefault = 'fa-plug';
CKEDITOR.editorConfig = function (config) {
config.toolbar = [
{ name: 'uploader', items: ['img'] },
// Your other plugins as per your need goes here
];
config.extraPlugins = plgnNames;
});
CKEDITOR.on("instanceReady", function (event) {
editor = event.editor;
var this_instance = document.getElementById(event.editor.id + '_toolbox');
var plugins = plgnNames.split(',');
for (var i = 0; i < plugins.length; i++) {
var this_button = this_instance.querySelector('.cke_button__' + plugins[i] + '_icon');
if (typeof this_button !== null) {
var icon;
if (typeof plgnIcons[i] === 'undefined')
icon = plgnDefault
else
icon = plgnIcons[i];
if (typeof this_button !== notdefined) {
this_button.innerHTML = '<i class=" ' + plgnClass[i] + ' fa ' + icon + '" style="font: normal normal normal ' + plgnIconSize + '/1 FontAwesome !important;cursor: default;"></i>';
}
}
}
});
TL; DRの場合、アイコンはDOM単位で置き換えられましたか?しかし、私はそれがインスピレーションのために行くだろうと思う! –
うわー!私は解決策を見いだすことができなかったので、しばらくしてこのトリックを思いついた。しかし、この方法では、周りに遊ぶ素晴らしいフォントアイコンがたくさんあるので、アイコンを探す必要はありません。どういたしまして。 – Ozesh