CKEditor 4.x로 업그레이드하고 첨부 소스를 찾을 수없는 경우에도 동일한 문제가있었습니다. 필자는 첨부 파일 플러그인을 다시 작성하여 작동되게했습니다. embed plugin을 사용하지 않았으므로 다시 작성하지는 않았지만 잘하면 첨부 파일에 도움이됩니다. 첨부 파일/plugin.js에 대한
사용이 :
CKEDITOR.plugins.add('attachment', {
icons: 'attachment',
init: function(editor) {
editor.addCommand('attachmentDialog', new CKEDITOR.dialogCommand('attachmentDialog'));
editor.ui.addButton('attachment', {
label: 'Document',
command: 'attachmentDialog',
toolbar: 'insert'
});
CKEDITOR.dialog.add('attachmentDialog', this.path + 'dialogs/attachment.js');
}
}
를 사용하여 첨부 파일/대화 상자/attachment.js이 :
CKEDITOR.dialog.add('attachmentDialog', function(editor) {
return {
title: 'Upload Document',
minWidth: 400,
minHeight: 200,
contents: [
{
id: 'general',
label: 'Document Info',
elements: [
{
type: 'text',
id: 'txtUrl',
label: 'URL',
validate: CKEDITOR.dialog.validate.notEmpty("URL cannot be empty")
},
{
type: 'button',
hidden: true,
id: 'browse',
filebrowser: 'general:txtUrl',
label: "Use Existing Document",
style: 'float:right',
},
]
},
{
id: 'Upload',
hidden: true,
filebrowser: 'uploadButton',
label: editor.lang.image.upload,
elements: [
{
type: 'file',
id: 'upload',
label: editor.lang.image.btnUpload,
style: 'height:40px',
size: 38
},
{
type: 'fileButton',
id: 'uploadButton',
filebrowser: 'general:txtUrl',
label: "Upload the Document",
'for': [ 'Upload', 'upload' ]
}
]
},
],
onOk: function() {
var dialog = this;
//Get the value selected in the editor.
var selectedText = editor.getSelection().getSelectedText();
var attachment = editor.document.createElement('a');
attachment.setAttribute('href', dialog.getValueOf('general', 'txtUrl'));
//If there isn't anything selected in the editor, default the text to the document url.
if (selectedText == "") {
attachment.setText(dialog.getValueOf('general', 'txtUrl'));
} else {
attachment.setText(selectedText);
}
editor.insertElement(attachment);
}
};
});
스 니펫을 공유해 주셔서 감사합니다. 우리는 고객이 링크 팝업에서 업로드 옵션을 사용할 것을 권장했습니다. 삽입은 현재 iframe 플러그인을 사용하고 있습니다. – mintuhouse