TinyMCE:API/tinymce.Editor/onPaste
From Moxiecode Documentation Wiki
Contents |
[edit]
Event: onPaste
[edit]
Summary
This event gets executed when a user pastes contents into the editor. This event only works on browsers that currently support the onPaste event like FF or Safari.
[edit]
Syntax
event_callback(<tinymce.Editor> ed, <Event> e, <Object> o)
[edit]
Parameters
- ed
- Sender object/Editor instance that the event occurred in.
- e
- DOM Event object, includes things like target for the event.
- o
- Object containing paste data like the plain text.
[edit]
Examples
// Adds an observer to the onPaste event using tinyMCE.init
tinyMCE.init({
...
setup : function(ed) {
ed.onPaste.add(function(ed, e) {
console.debug('Pasted plain text');
});
}
});
// Adds an observer to the onPaste event using the render method
var ed = new tinymce.Editor('someid', {
.. Some settings
});
ed.onPaste.add(function(ed, e) {
console.debug('Pasted plain text');
});
ed.render();
