Anomalie #792
closed
- Target version deleted (
2.1)
- Subject changed from handle better word copy-paste to handle better word copy-paste with no user action required
- Related to Evolution #794: ckeditor remove font-family when copying from word added
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
- Target version set to 2.1
- Status changed from Nouveau to Fermé
- % Done changed from 0 to 100
Also available in: Atom
PDF