Hi comunidadmexi...,
Use below code.
config.js
CKEDITOR.editorConfig = function (config) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.toolbar = 'Full';
config.toolbar_Full =
[
{ name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'DocProps', 'Preview', 'Print', '-', 'Templates'] },
{ name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
{ name: 'editing', items: ['Find', 'Replace', '-', 'SelectAll', '-', 'SpellChecker', 'Scayt'] },
{
name: 'forms', items: ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton',
'HiddenField']
},
'/',
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'] },
{
name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv',
'-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl']
},
{ name: 'links', items: ['Link', 'Unlink', 'Anchor'] },
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe'] },
'/',
{ name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] },
{ name: 'colors', items: ['TextColor', 'BGColor'] },
{ name: 'tools', items: ['Maximize', 'ShowBlocks', '-', 'About'] }
];
config.extraPlugins = 'blockimagepaste';
};
CKEDITOR.plugins.add('blockimagepaste', {
init: function (editor) {
function replaceImgText(html) {
var ret = html.replace(/<img[^>]*src="data:image\/(bmp|dds|gif|jpg|jpeg|png|psd|pspimage|tga|thm|tif|tiff|yuv|ai|eps|ps|svg);base64,.*?"[^>]*>/gi,
function (img) {
return '';
});
return ret;
}
function chkImg() {
if (editor.readOnly) {
return;
}
setTimeout(function () {
editor.document.$.body.innerHTML = replaceImgText(editor.document.$.body.innerHTML);
}, 100);
}
editor.on('contentDom', function () {
editor.document.on('drop', chkImg);
editor.document.getBody().on('drop', chkImg);
editor.document.on('paste', function (e) { chkImg(editor); });
editor.document.getBody().on('paste', function (e) { chkImg(editor); });
});
} // Init
});
HTML
<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine"></asp:TextBox>
<script src="Scripts/ckeditor/ckeditor.js"></script>
<script type="text/javascript">
window.onload = function () {
CKEDITOR.replace('TextBox1');
}
</script>