(function () {
    tinymce.create('tinymce.plugins.passport', {
        init: function (ed, url) {
            ed.addButton('dropcap', {
                title: 'DropCap',
                cmd: 'dropcap',
                image: url + '/dropcap.png'
            });

            ed.addCommand('dropcap', function () {
                var selected_text = ed.selection.getContent();
                var return_text = '';
                return_text = '<span class="dropcap">' + selected_text + '</span>';
                ed.execCommand('mceInsertContent', 0, return_text);
            });

            ed.addButton('typed', {
                title: 'Typed',
                cmd: 'typed',
                image: url + '/typed.png'
            });

            ed.addCommand('typed', function () {
                var selected_text = ed.selection.getContent();
                var return_text = '';
                return_text = '<span class="css-typing">' + selected_text + '</span>';
                ed.execCommand('mceInsertContent', 0, return_text);
            });
        }
        // ... Hidden code
    });
    // Register plugin
    tinymce.PluginManager.add('passport', tinymce.plugins.passport);
})();
