<commit_before>var iframeWindow = null;
CKEDITOR.plugins.add('files',
    {
        requires: [ 'iframedialog' ],
        icons: 'images',
        init: function( editor )
        {
            var height = 480, width = 750;
            CKEDITOR.dialog.addIframe(
                'filesDialog',
                'files',
                '?option=com_ckeditor&container=files-files&view=files&type=file&layout=dialog&tmpl=dialog', width, height,
                function() {
                    var iframe = document.getElementById( this._.frameId );
                    iframeWindow = iframe.contentWindow;
                },

                { // userDefinition
                    onOk : function()
                    {

                        var iframedocument = iframeWindow.document;
                        var src = iframedocument.id('image-url').get('value');
                        var link = iframedocument.id('image-link').get('value');
                        var attrs = {};
                        ['alt', 'title','type'].each(function(id) {
                            var value = iframedocument.id('image-'+id).get('value');
                            if (value) {
                                attrs[id] = value;
                            }
                        });

                        var str = '<a href="'+src+'" ';
                        var parts = [];

                        $each(attrs, function(value, key) {
                            parts.push(key+'="'+value+'"');
                        });

                        str += parts.join(' ')+' >';
                        str += link+"</a>";

                        // puts the image in the editor
                        this._.editor.insertHtml(str);
                    },
                    onShow : function()
                    {
                        this.parts.dialog.addClass('image_dialog');
                    }
                }
            );

            editor.addCommand( 'filesDialog', new CKEDITOR.dialogCommand( 'filesDialog' ) );

            editor.ui.addButton( 'files',
                {
                    label: 'File Dialog',
                    command: 'filesDialog',
                    icon: this.path + 'images/image.png'
                } );

        }
    }
);

function showDialogPlugin(e){
    e.openDialog('files.dlg');
}<commit_msg>Right click on the link will give u the possibility to edit the link. Only if the type is from the type "application"<commit_after>var iframeWindow = null;
CKEDITOR.plugins.add('files',
    {
        requires: [ 'iframedialog' ],
        icons: 'images',
        init: function( editor )
        {
            var height = 480, width = 750;
            CKEDITOR.dialog.addIframe(
                'filesDialog',
                'files',
                '?option=com_ckeditor&container=files-files&view=files&type=file&layout=dialog&tmpl=dialog', width, height,
                function() {
                    var iframe = document.getElementById( this._.frameId );
                    iframeWindow = iframe.contentWindow;

                    var dialog = CKEDITOR.dialog.getCurrent();
                    var editor = dialog.getParentEditor();
                    var selected = CKEDITOR.plugins.link.getSelectedLink( editor );

                    if(editor.getSelection().getSelectedText()){
                        iframeWindow.document.id('image-text').set('value', editor.getSelection().getSelectedText());
                    }

                    if(selected){
                        iframeWindow.document.id('image-url').set('value',selected.getAttribute('href'));
                        iframeWindow.document.id('image-alt').set('value',selected.getAttribute('alt'));
                        iframeWindow.document.id('image-title').set('value',selected.getAttribute('title'));
                        iframeWindow.document.id('target').set('value',selected.getAttribute('target'));
                    }
                },

                { // userDefinition
                    onOk : function()
                    {

                        var iframedocument = iframeWindow.document;
                        var src = iframedocument.id('image-url').get('value');
                        var link = iframedocument.id('image-text').get('value');
                        var target = iframedocument.id('target').get('value');
                        var attrs = {};
                        ['alt', 'title','type'].each(function(id) {
                            var value = iframedocument.id('image-'+id).get('value');
                            if (value) {
                                attrs[id] = value;
                            }
                        });

                        var str = '<a href="'+src+'" ';
                        var parts = [];
                        parts.push('target='+target);
                        $each(attrs, function(value, key) {
                            parts.push(key+'="'+value+'"');
                        });

                        str += parts.join(' ')+' >';
                        str += link+"</a>";

                        // puts the image in the editor
                        this._.editor.insertHtml(str);
                    },
                    onShow : function()
                    {
                        this.parts.dialog.addClass('image_dialog');
                    }
                }
            );

            editor.addCommand( 'filesDialog', new CKEDITOR.dialogCommand( 'filesDialog' ) );

            editor.ui.addButton( 'files',
            {
                label: 'File Dialog',
                command: 'filesDialog',
                icon: this.path + 'images/image.png'
            });
            if ( editor.contextMenu ) {
                editor.addMenuGroup( 'fileGroup' );
                editor.addMenuItem( 'fileItem', {
                    label: 'Edit File Link',
                    icon: this.path + 'images/image.png',
                    command: 'filesDialog',
                    group: 'fileGroup'
                });

                editor.contextMenu.addListener( function( ) {

                    var element = CKEDITOR.plugins.link.getSelectedLink( editor );
                    //we only want to show this if the type = application

                    if ( element.getAttribute('type').search('application') != -1) {
                        return { fileItem: CKEDITOR.TRISTATE_OFF };
                    }
                });
            }

        }
    }
);

function showDialogPlugin(e){
    e.openDialog('files.dlg');
}
{'fraction_non_alphanumeric': 0.12241821197045077, 'fraction_numerical': 0.001959897482285542, 'mean_word_length': 1.1365539452495974, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5012215', 'n_tokens_mistral': 1658, 'n_tokens_neox': 1503, 'n_words': 271}