link.inserted

Arguments
link Object link object

Triggered when the link is inserted to Redactor.

$R('#content', {
    callbacks: {
        link: {
            inserted: function(link)
            {
                // ...
            }
        }
    }
});

Listen to the message in a plugin:

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

        // messages
        onlink: {
            inserted: function(link)
            {
                // ...
            }
        }
    });
})(Redactor);

link.deleted

Arguments
links Arrayarray of unlinked links

Triggered when the link is deleted from content with unlink command.

$R('#content', {
    callbacks: {
        link: {
            deleted: function(links)
            {
                // ...
            }
        }
    }
});

Listen to the message in a plugin:

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

        // messages
        onlink: {
            deleted: function(links)
            {
                // ...
            }
        }
    });
})(Redactor);

link.changed

Arguments
links Arrayarray of changed links

Triggered when the link is changed in the edit link modal.

$R('#content', {
    callbacks: {
        link: {
            changed: function(links)
            {
                // ...
            }
        }
    }
});

Listen to the message in a plugin:

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

        // messages
        onlink: {
            changed: function(links)
            {
                // ...
            }
        }
    });
})(Redactor);