Documentation

Undo and Redo

undo

Arguments
html String
offset Object

Triggered when the buffer module method undo is called.

$R('#content', {
    callbacks: {
        undo: function(html, offset)
        {
            // ...
        }
    }
});

Listen to the message in a plugin:

(function($R)
{
    $R.add('plugin', 'myplugin', {
        init: function(app)
        {
            // define app
            this.app = app;
        },

        // messages
        onundo: function(html, offset)
        {
            // ...
        }
    });
})(Redactor);

redo

Arguments
html String
offset Object

Triggered when the buffer module method redo is called.

$R('#content', {
    callbacks: {
        redo: function(html, offset)
        {
            // ...
        }
    }
});

Listen to the message in a plugin:

(function($R)
{
    $R.add('plugin', 'myplugin', {
        init: function(app)
        {
            // define app
            this.app = app;
        },

        // messages
        onredo: function(html, offset)
        {
            // ...
        }
    });
})(Redactor);