Ticket #5755: 5755.patch

File 5755.patch, 2.3 KB (added by Sa'ar Zac Elias, 12 years ago)
  • _source/plugins/dialog/plugin.js

     
    104104        CKEDITOR.dialog = function( editor, dialogName )
    105105        {
    106106                // Load the dialog definition.
    107                 var definition = CKEDITOR.dialog._.dialogDefinitions[ dialogName ];
     107                var definition = CKEDITOR.dialog._.dialogDefinitions[ dialogName ],
     108                        defaultDefinition = CKEDITOR.tools.clone( defaultDialogDefinition ),
     109                        buttonsOrder = editor.config.dialog_buttonsOrder || 'OS',
     110                        dir = editor.lang.dir;
    108111
     112                if ( ( buttonsOrder == 'OS' && CKEDITOR.env.mac ) ||    // The buttons in MacOS Apps are in reverse order (#4750)
     113                        ( buttonsOrder == 'rtl' && dir == 'ltr' ) ||
     114                        ( buttonsOrder == 'ltr' && dir == 'rtl' ) )
     115                                defaultDefinition.buttons.reverse();
     116
    109117                // Completes the definition with the default values.
    110                 definition = CKEDITOR.tools.extend( definition( editor ), defaultDialogDefinition );
     118                definition = CKEDITOR.tools.extend( definition( editor ), defaultDefinition );
    111119
    112120                // Clone a functionally independent copy for this dialog.
    113121                definition = CKEDITOR.tools.clone( definition );
     
    13441352                buttons : [ CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton ]
    13451353        };
    13461354
    1347         // The buttons in MacOS Apps are in reverse order #4750
    1348         CKEDITOR.env.mac && defaultDialogDefinition.buttons.reverse();
    1349 
    13501355        // Tool function used to return an item from an array based on its id
    13511356        // property.
    13521357        var getById = function( array, id, recurse )
     
    29932998 */
    29942999
    29953000/**
     3001 * The guildeline to follow when generating the dialog buttons. There are 3 possible options:
     3002 * <ul>
     3003 *     <li>'OS' - the buttons will be displayed in the default order of the user's OS;</li>
     3004 *     <li>'ltr' - for Left-To-Right order;</li>
     3005 *     <li>'rtl' - for Right-To-Left order.</li>
     3006 * </ul>
     3007 * @name CKEDITOR.config.dialog_buttonsOrder
     3008 * @type String
     3009 * @default 'OS'
     3010 * @since 3.5
     3011 * @example
     3012 * config.dialog_buttonsOrder = 'rtl';
     3013 */
     3014
     3015/**
    29963016 * Fired when a dialog definition is about to be used to create a dialog into
    29973017 * an editor instance. This event makes it possible to customize the definition
    29983018 * before creating it.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy