CKEDITOR.editorConfig = function( config ) {
config.allowedContent = true;
};
CKEDITOR.editorConfig = function( config ) {
config.extraAllowedContent = 'script[*]{*}';
};
ClassicEditor
.create( document.querySelector( '#editor' ), {
plugins: [ SourceEditing, /* ... other plugins ... */ ],
htmlSupport: {
allow: [
{
name: 'script',
attributes: true,
classes: true,
styles: true
}
]
}
} )
CKEDITOR.replace('txtSummary', {
stylesSet: 'myKingStyle',
extraPlugins: 'codesnippet',
codeSnippet_theme: 'monokai_sublime',
// --- ADD THESE TWO LINES TO FIX THE SCRIPT STRIPPING ---
extraAllowedContent: 'script[*]{*}; div[id]',
protectedSource: [/<script[\s\S]*?<\/script>/gi],
// -----------------------------------------------------
toolbar: [
{ name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates'] }, { name: 'bidi', items: ['BidiLtr', 'BidiRtl'] },
'/', // Line break
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', '-', 'RemoveFormat'] },
{ name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv'] },
{ name: 'alignment', items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'] },
{ name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] },
{ name: 'colors', items: ['TextColor', 'BGColor'] },
{ name: 'insert', items: ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak'] },
'/', // Line break
{ name: 'editing', items: ['Find', 'Replace', '-', 'SelectAll', '-', 'SpellChecker', 'Scayt'] },
{ name: 'links', items: ['Link', 'Unlink', 'Anchor'] },
{ name: 'tools', items: ['Maximize', 'ShowBlocks', '-', 'About'] },
{ name: 'forms', items: ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'] },
'/', // Line break
{ name: 'coding', items: ['CodeSnippet'] },
],
filebrowserUploadUrl: '/admin/UploadNewsMiddlePost/',
filebrowserImageUploadUrl: '/admin/UploadNewsMiddlePost?type=Images',
filebrowserImageBrowseUrl: '/admin/AdminNewsImageBrower/',
});
0 نظر
هنوز نظری برای این مقاله ثبت نشده است.