Ticket #7991: 7991_5.patch

File 7991_5.patch, 11.1 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/dialog/dialogDefinition.js

     
    500500 * @example
    501501 */
    502502
     503// ----- labeled element ------
     504
     505/**
     506 *  Specify the inline style of the uiElement label.
     507 * @name CKEDITOR.dialog.definition.labeledElement.prototype.labelStyle
     508 * @type String
     509 * @field
     510 * @example
     511 * {
     512 *              type : 'text',
     513 *              label : 'My Label ',
     514 *      <strong>        labelStyle : 'color: red',</strong>
     515 * }
     516 */
     517
     518
     519/**
     520 *  Specify the inline style of the input element.
     521 * @name CKEDITOR.dialog.definition.labeledElement.prototype.inputStyle
     522 * @type String
     523 * @field
     524 * @example
     525 * {
     526 *              type : 'text',
     527 *              label : 'My Label ',
     528 *      <strong>        inputStyle : 'text-align:center',</strong>
     529 * }
     530 */
     531
     532/**
     533 *  Specify the inline style of the input element container .
     534 * @name CKEDITOR.dialog.definition.labeledElement.prototype.controlStyle
     535 * @type String
     536 * @field
     537 * @example
     538 * {
     539 *              type : 'text',
     540 *              label : 'My Label ',
     541 *      <strong>        controlStyle : 'width:3em',</strong>
     542 * }
     543 */
     544
     545
    503546// ----- button ------
    504547
    505548/**
  • _source/plugins/table/dialogs/table.js

     
    262262                                                                                        'default' : 3,
    263263                                                                                        label : editor.lang.table.rows,
    264264                                                                                        required : true,
    265                                                                                         style : 'width:5em',
     265                                                                                        controlStyle : 'width:5em',
    266266                                                                                        validate : function()
    267267                                                                                        {
    268268                                                                                                var pass = true,
     
    288288                                                                                        'default' : 2,
    289289                                                                                        label : editor.lang.table.columns,
    290290                                                                                        required : true,
    291                                                                                         style : 'width:5em',
     291                                                                                        controlStyle : 'width:5em',
    292292                                                                                        validate : function()
    293293                                                                                        {
    294294                                                                                                var pass = true,
     
    354354                                                                                        id : 'txtBorder',
    355355                                                                                        'default' : 1,
    356356                                                                                        label : editor.lang.table.border,
    357                                                                                         style : 'width:3em',
     357                                                                                        controlStyle : 'width:3em',
    358358                                                                                        validate : CKEDITOR.dialog.validate['number']( editor.lang.table.invalidBorder ),
    359359                                                                                        setup : function( selectedTable )
    360360                                                                                        {
     
    407407                                                                                                {
    408408                                                                                                        type : 'text',
    409409                                                                                                        id : 'txtWidth',
    410                                                                                                         style : 'width:5em',
     410                                                                                                        controlStyle : 'width:5em',
    411411                                                                                                        label : editor.lang.common.width,
    412412                                                                                                        'default' : 500,
    413413                                                                                                        getValue : defaultToPixel,
     
    434434                                                                                                {
    435435                                                                                                        type : 'text',
    436436                                                                                                        id : 'txtHeight',
    437                                                                                                         style : 'width:5em',
     437                                                                                                        controlStyle : 'width:5em',
    438438                                                                                                        label : editor.lang.common.height,
    439439                                                                                                        'default' : '',
    440440                                                                                                        getValue : defaultToPixel,
     
    461461                                                                                {
    462462                                                                                        type : 'text',
    463463                                                                                        id : 'txtCellSpace',
    464                                                                                         style : 'width:3em',
     464                                                                                        controlStyle : 'width:3em',
    465465                                                                                        label : editor.lang.table.cellSpace,
    466466                                                                                        'default' : 1,
    467467                                                                                        validate : CKEDITOR.dialog.validate.number( editor.lang.table.invalidCellSpacing ),
     
    480480                                                                                {
    481481                                                                                        type : 'text',
    482482                                                                                        id : 'txtCellPad',
    483                                                                                         style : 'width:3em',
     483                                                                                        controlStyle : 'width:3em',
    484484                                                                                        label : editor.lang.table.cellPad,
    485485                                                                                        'default' : 1,
    486486                                                                                        validate : CKEDITOR.dialog.validate.number( editor.lang.table.invalidCellPadding ),
  • _source/plugins/dialogui/plugin.js

     
    158158                                                html.push( '<label class="cke_dialog_ui_labeled_label' + requiredClass + '" ',
    159159                                                                ' id="'+  _.labelId + '"',
    160160                                                                ' for="' + _.inputId + '"',
    161                                                                 ' style="' + elementDefinition.labelStyle + '">',
     161                                                                ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) +'>',
    162162                                                                elementDefinition.label,
    163163                                                                '</label>',
    164                                                                 '<div class="cke_dialog_ui_labeled_content" role="presentation">',
     164                                                                '<div class="cke_dialog_ui_labeled_content"' + ( elementDefinition.controlStyle ? ' style="' + elementDefinition.controlStyle + '"' : '' ) + ' role="presentation">',
    165165                                                                contentHtml.call( this, dialog, elementDefinition ),
    166166                                                                '</div>' );
    167167                                        else
     
    177177                                                                        html : '<label class="cke_dialog_ui_labeled_label' + requiredClass + '"' +
    178178                                                                                ' id="' + _.labelId + '"' +
    179179                                                                                ' for="' + _.inputId + '"' +
    180                                                                                 ' style="' + elementDefinition.labelStyle + '">' +
     180                                                                                ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) +'>' +
    181181                                                                                   CKEDITOR.tools.htmlEncode( elementDefinition.label ) +
    182182                                                                                '</span>'
    183183                                                                },
    184184                                                                {
    185185                                                                        type : 'html',
    186                                                                         html : '<span class="cke_dialog_ui_labeled_content">' +
     186                                                                        html : '<span class="cke_dialog_ui_labeled_content"' + ( elementDefinition.controlStyle ? ' style="' + elementDefinition.controlStyle + '"' : '' ) + '>' +
    187187                                                                                contentHtml.call( this, dialog, elementDefinition ) +
    188188                                                                                '</span>'
    189189                                                                }
     
    237237                                if ( elementDefinition.size )
    238238                                        attributes.size = elementDefinition.size;
    239239
    240                                 if ( elementDefinition.controlStyle )
    241                                         attributes.style = elementDefinition.controlStyle;
     240                                if ( elementDefinition.inputStyle )
     241                                        attributes.style = elementDefinition.inputStyle;
    242242
    243243                                // If user presses Enter in a text box, it implies clicking OK for the dialog.
    244244                                var me = this, keyPressedOnMe = false;
     
    323323                                attributes.rows = elementDefinition.rows || 5;
    324324                                attributes.cols = elementDefinition.cols || 20;
    325325
     326                                if ( typeof elementDefinition.inputStyle != 'undefined' )
     327                                        attributes.style = elementDefinition.inputStyle;
     328
     329
    326330                                /** @ignore */
    327331                                var innerHTML = function()
    328332                                {
     
    380384                                        if ( elementDefinition[ 'default' ] )
    381385                                                attributes.checked = 'checked';
    382386
    383                                         if ( typeof myDefinition.controlStyle != 'undefined' )
    384                                                 myDefinition.style = myDefinition.controlStyle;
     387                                        if ( typeof myDefinition.inputStyle != 'undefined' )
     388                                                myDefinition.style = myDefinition.inputStyle;
    385389
    386390                                        _.checkbox = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'input', null, attributes );
    387                                         html.push( ' <label id="', labelId, '" for="', attributes.id, '">',
     391                                        html.push( ' <label id="', labelId, '" for="', attributes.id, '"' + ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) + '>',
    388392                                                        CKEDITOR.tools.htmlEncode( elementDefinition.label ),
    389393                                                        '</label>' );
    390394                                        return html.join( '' );
     
    462466                                                cleanInnerDefinition( inputDefinition );
    463467                                                cleanInnerDefinition( labelDefinition );
    464468
    465                                                 if ( typeof inputDefinition.controlStyle != 'undefined' )
    466                                                         inputDefinition.style = inputDefinition.controlStyle;
     469                                                if ( typeof inputDefinition.inputStyle != 'undefined' )
     470                                                        inputDefinition.style = inputDefinition.inputStyle;
    467471
    468472                                                children.push( new CKEDITOR.ui.dialog.uiElement( dialog, inputDefinition, inputHtml, 'input', null, inputAttributes ) );
    469473                                                inputHtml.push( ' ' );
     
    622626                                                        CKEDITOR.tools.htmlEncode( item[0] ) );
    623627                                        }
    624628
    625                                         if ( typeof myDefinition.controlStyle != 'undefined' )
    626                                                 myDefinition.style = myDefinition.controlStyle;
     629                                        if ( typeof myDefinition.inputStyle != 'undefined' )
     630                                                myDefinition.style = myDefinition.inputStyle;
    627631
    628632                                        _.select = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'select', null, attributes, innerHTML.join( '' ) );
    629633                                        return html.join( '' );
  • _source/plugins/docprops/dialogs/docprops.js

     
    546546                                                                                id : 'marginTop',
    547547                                                                                label : lang.marginTop,
    548548                                                                                style : 'width: 80px; text-align: center; margin: 0px auto',
    549                                                                                 controlStyle : 'text-align: center',
     549                                                                                inputStyle : 'text-align: center',
    550550                                                                                setup : function( doc, html, head, body )
    551551                                                                                {
    552552                                                                                        this.setValue( body.getStyle( 'margin-top' ) || body.getAttribute( 'margintop' ) || '' );
    553553                                                                                },
    554                                                                                 commit : commitMargin( 'top' ),
    555                                                                                 onLoad : function()
    556                                                                                 {
    557                                                                                         this.getElement().getParent().setStyle( 'text-align', 'center' );
    558                                                                                 }
     554                                                                                commit : commitMargin( 'top' )
    559555                                                                        },
    560556                                                                        {
    561557                                                                                type : 'hbox',
     
    565561                                                                                                id : 'marginLeft',
    566562                                                                                                label : lang.marginLeft,
    567563                                                                                                style : 'width: 80px; text-align: center; margin: 0px auto',
    568                                                                                                 controlStyle : 'text-align: center',
     564                                                                                                inputStyle : 'text-align: center',
    569565                                                                                                setup : function( doc, html, head, body )
    570566                                                                                                {
    571567                                                                                                        this.setValue( body.getStyle( 'margin-left' ) || body.getAttribute( 'marginleft' ) || '' );
    572568                                                                                                },
    573                                                                                                 commit : commitMargin( 'left' ),
    574                                                                                                 onLoad : function()
    575                                                                                                 {
    576                                                                                                         this.getElement().getParent().setStyle( 'text-align', 'center' );
    577                                                                                                 }
     569                                                                                                commit : commitMargin( 'left' )
    578570                                                                                        },
    579571                                                                                        {
    580572                                                                                                type : 'text',
    581573                                                                                                id : 'marginRight',
    582574                                                                                                label : lang.marginRight,
    583575                                                                                                style : 'width: 80px; text-align: center; margin: 0px auto',
    584                                                                                                 controlStyle : 'text-align: center',
     576                                                                                                inputStyle : 'text-align: center',
    585577                                                                                                setup : function( doc, html, head, body )
    586578                                                                                                {
    587579                                                                                                        this.setValue( body.getStyle( 'margin-right' ) || body.getAttribute( 'marginright' ) || '' );
    588580                                                                                                },
    589                                                                                                 commit : commitMargin( 'right' ),
    590                                                                                                 onLoad : function()
    591                                                                                                 {
    592                                                                                                         this.getElement().getParent().setStyle( 'text-align', 'center' );
    593                                                                                                 }
    594                                                                                         }
     581                                                                                                commit : commitMargin( 'right' )
     582                                                                                        }
    595583                                                                                ]
    596584                                                                        },
    597585                                                                        {
     
    599587                                                                                id : 'marginBottom',
    600588                                                                                label : lang.marginBottom,
    601589                                                                                style : 'width: 80px; text-align: center; margin: 0px auto',
    602                                                                                 controlStyle : 'text-align: center',
     590                                                                                inputStyle : 'text-align: center',
    603591                                                                                setup : function( doc, html, head, body )
    604592                                                                                {
    605593                                                                                        this.setValue( body.getStyle( 'margin-bottom' ) || body.getAttribute( 'marginbottom' ) || '' );
    606594                                                                                },
    607                                                                                 commit : commitMargin( 'bottom' ),
    608                                                                                 onLoad : function()
    609                                                                                 {
    610                                                                                         this.getElement().getParent().setStyle( 'text-align', 'center' );
    611                                                                                 }
    612                                                                         }
     595                                                                                commit : commitMargin( 'bottom' )
     596                                                                        }
    613597                                                                ]
    614598                                                        }
    615599                                                ]
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy