TinyMCE:API/tinymce.Editor/onPaste

From Moxiecode Documentation Wiki

Jump to: navigation, search

Contents

Event: onPaste

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.

Syntax

event_callback(<tinymce.Editor> ed, <Event> e, <Object> o)

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.

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();
Personal tools