Actions
Anomalie #792
closedhandle better word copy-paste with no user action required
Start date:
10/20/2017
Due date:
% Done:
100%
Estimated time:
2.00 h
Resolution:
Description
Try to make copy from word and removing font family attribute.
https://ckeditor.com/old/forums/Support/FIXED-How-to-disable-the-use-of-font-family
Updated by Simon about 8 years ago
- Subject changed from handle better word copy-paste to handle better word copy-paste with no user action required
Updated by Simon about 8 years ago
- Related to Evolution #788: handle better word copy-paste added
Updated by Simon about 8 years ago
- Related to Evolution #794: ckeditor remove font-family when copying from word added
Updated by Simon about 8 years ago
see : https://codepen.io/mlewand/pen/oeaZrV
CKEDITOR.replace( 'editor1', {
extraPlugins: 'colorbutton,font',
on: {
afterPasteFromWord: function( evt ) {
// Clone the filter, so that it's based on current editor filter settings.
// Note that this function is added in CKE 4.7.3.
var filter = evt.editor.filter.clone(),
fragment = CKEDITOR.htmlParser.fragment.fromHtml( evt.data.dataValue ),
writer = new CKEDITOR.htmlParser.basicWriter();
// Disallow certain styles.
filter.disallow( 'span{font-family,color,font-size}' );
// Process, and overwrite evt.data.dataValue.
filter.applyTo( fragment );
fragment.writeHtml( writer );
evt.data.dataValue = writer.getHtml();
}
}
} );
And this code, to handle event :
CKEDITOR.on("instanceReady", function(ev) {
var editor = ev.editor;
editor.on("focus", function(ev) {
alert("focused!");
});
});
https://stackoverflow.com/questions/19805338/adding-event-handlers-globally-to-all-ckeditor-instances
Updated by Simon about 8 years ago
- Status changed from Nouveau to Fermé
- % Done changed from 0 to 100
Applied in changeset linea21|r3284.
Actions