我创建了自定义按钮,用于从数据库上传文件。我已经在我的ckeditor / plugins / plugin.js中为我的按钮下载了图像,但是在运行网站时它没有显示出来。这是我的plugin.js的样子:
CKEDITOR.plugins.add('testimage', { requires: ['iframedialog'], init: function (editor) { editor.addCommand('testimage', new CKEDITOR.dialogCommand('testimage')); // associating the executable code with the button editor.ui.addButton('testimage', { label: 'Upload Image', command: 'testimage', icon: this.path + 'Expanding-image-mouse-out.png' }); CKEDITOR.dialog.addIframe('testimage', 'upload image', '/Upload/UploadImage', 500, 400); } });
function closedialog(url) {
CKEDITOR.dialog.getCurrent().hide();
}
function setText(image_path, id, toolNum) {
CKEDITOR.instances.CKE.insertHtml('<img src=\x22' + image_path + '\x22 border=0 id=image' + id + '>');
var element = CKEDITOR.instances.CKE.document.getById('image' + id);
CKEDITOR.instances.CKE.getSelection().selectElement(element);
getToolbar(toolNum);
}
function getToolbar(num) {
CKEDITOR.tools.callFunction(num, this); return false;
}
我没有看到按钮上的图像,但是按钮正在执行所有指定的功能。请告诉我我做错了什么