Ticket #8466 (confirmed Bug)

Opened 3 years ago

Last modified 9 months ago

Customized filebrowser button is not open dialog for file selection

Reported by: atz Owned by:
Priority: Normal Milestone:
Component: File Browser Version: 3.2.1
Keywords: Cc:

Description

System configuration:

  • Mac OS X Lion (10.7.2)
  • Safari 5.1.1 (7534.51.22) OR Firefox 7.0.1 OR Google Schrome 14.0.835.202 (ALL AFFECTED)
  • CKEditor 3.6.2 OR CKEditor NightyBuild (BOTH AFFECTED)

1) Open _samples/fullpage.html

2) On line 64, after:

CKEDITOR.replace( 'editor1',
        {
                fullPage : true,
                extraPlugins : 'docprops'
        });

Add following code for customizing Insert Image dialog:

CKEDITOR.on('dialogDefinition', function(ev)
{
        var dialogName = ev.data.name;
        var dialogDefinition = ev.data.definition;
        var editor = ev.editor;

        if (dialogName == 'image') 
        {
                var linkTab = dialogDefinition.getContents('Link');
                var browse = linkTab.get('browse');
                var hbox = 
                {
                        id : 'hboxBrowseButtons',
                        type : 'hbox',
                        padding: 2,
                        children :
                        [
                                browse,
                                {
                                        type : 'button',
                                        label : 'Select from site documents',
                                        id : 'site_documents',
                                        filebrowser :
                                        {
                                                action : 'Browse',
                                                target : 'Link:txtUrl',
                                                url : '/some/documents/browser/url'
                                        }
                                }
                        ]
                };

                linkTab.remove('browse');
                linkTab.add(hbox, 'cmbTarget');
        }
});                                     

3) Save it and load _samples/fullpage.html in browser.

4) Click "Insert Image" button, click "Link" tab and then click "Select from site documents" button - and it DO NOTHING and no errors reporting by browser!

But if I then edit _samples/fullpage.html on line 10 and replace

	<script type="text/javascript" src="../ckeditor.js"></script>

with

	<script type="text/javascript" src="../ckeditor_source.js"></script>

and repeat steps 3 and 4, then ALL working fine!

What is the bug?

Change History

comment:1 Changed 3 years ago by j.swiderski

  • Status changed from new to confirmed
  • Version changed from 3.6.3 (SVN - trunk) to 3.2.1

Reproducible in all browsers in all Operating Systems from CKEditor 3.2.1

comment:2 Changed 9 months ago by tablatronix

This bug is a result of out of order dialogDefinition processing of config.js vs filebrowser plugin.

In cke source, config events are processed before the plugins. In compressed/compiled, plugins event handler is processed first.

Plugin code in question is.

	CKEDITOR.on( 'dialogDefinition', function( evt ) {
		var definition = evt.data.definition,
			element;
		// Associate filebrowser to elements with 'filebrowser' attribute.
		for ( var i = 0; i < definition.contents.length; ++i ) {
			if ( ( element = definition.contents[ i ] ) ) {
				attachFileBrowser( evt.editor, evt.data.name, definition, element.elements );
				if ( element.hidden && element.filebrowser ) {
					element.hidden = !isConfigured( definition, element[ 'id' ], element.filebrowser );
				}
			}
		}
	});

comment:3 Changed 9 months ago by j.swiderski

  • Component changed from UI : Dialogs to File Browser

Problem can be reproduced in CKE 4.x as well.

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy