Ticket #7991: 7991_4.patch
File 7991_4.patch, 10.9 KB (added by , 12 years ago) |
---|
-
_source/plugins/dialog/dialogDefinition.js
500 500 * @example 501 501 */ 502 502 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 * Specify the inline style of the input element. 520 * @name CKEDITOR.dialog.definition.labeledElement.prototype.inputStyle 521 * @type String 522 * @field 523 * @example 524 * { 525 * type : 'text', 526 * label : 'My Label ', 527 * <strong> inputStyle : 'width:3em',</strong> 528 * } 529 */ 530 531 503 532 // ----- button ------ 504 533 505 534 /** -
_source/plugins/table/dialogs/table.js
262 262 'default' : 3, 263 263 label : editor.lang.table.rows, 264 264 required : true, 265 style : 'width:5em',265 inputStyle : 'width:5em', 266 266 validate : function() 267 267 { 268 268 var pass = true, … … 288 288 'default' : 2, 289 289 label : editor.lang.table.columns, 290 290 required : true, 291 style : 'width:5em',291 inputStyle : 'width:5em', 292 292 validate : function() 293 293 { 294 294 var pass = true, … … 354 354 id : 'txtBorder', 355 355 'default' : 1, 356 356 label : editor.lang.table.border, 357 style : 'width:3em',357 inputStyle : 'width:3em', 358 358 validate : CKEDITOR.dialog.validate['number']( editor.lang.table.invalidBorder ), 359 359 setup : function( selectedTable ) 360 360 { … … 407 407 { 408 408 type : 'text', 409 409 id : 'txtWidth', 410 style : 'width:5em',410 inputStyle : 'width:5em', 411 411 label : editor.lang.common.width, 412 412 'default' : 500, 413 413 getValue : defaultToPixel, … … 434 434 { 435 435 type : 'text', 436 436 id : 'txtHeight', 437 style : 'width:5em',437 inputStyle : 'width:5em', 438 438 label : editor.lang.common.height, 439 439 'default' : '', 440 440 getValue : defaultToPixel, … … 461 461 { 462 462 type : 'text', 463 463 id : 'txtCellSpace', 464 style : 'width:3em',464 inputStyle : 'width:3em', 465 465 label : editor.lang.table.cellSpace, 466 466 'default' : 1, 467 467 validate : CKEDITOR.dialog.validate.number( editor.lang.table.invalidCellSpacing ), … … 480 480 { 481 481 type : 'text', 482 482 id : 'txtCellPad', 483 style : 'width:3em',483 inputStyle : 'width:3em', 484 484 label : editor.lang.table.cellPad, 485 485 'default' : 1, 486 486 validate : CKEDITOR.dialog.validate.number( editor.lang.table.invalidCellPadding ), -
_source/plugins/dialog/plugin.js
2702 2702 { 2703 2703 if ( !( match = i.match( regex ) ) ) 2704 2704 continue; 2705 if ( this.eventProcessors[i] ) 2706 this.eventProcessors[i].call( this, this._.dialog, definition[i] ); 2707 else 2708 registerDomEvent( this, this._.dialog, match[1].toLowerCase(), definition[i] ); 2705 ( function() 2706 { 2707 // Wrap the event handler in case it's of the same function. 2708 var eventHandler = function() { definition[ i ].apply( this, arguments ); } 2709 if ( this.eventProcessors[ i ] ) 2710 this.eventProcessors[ i ].call( this, this._.dialog, eventHandler ); 2711 else 2712 registerDomEvent( this, this._.dialog, match[1].toLowerCase(), eventHandler ); 2713 } ).call( this ); 2709 2714 } 2710 2715 2711 2716 return this; -
_source/plugins/dialogui/plugin.js
158 158 html.push( '<label class="cke_dialog_ui_labeled_label' + requiredClass + '" ', 159 159 ' id="'+ _.labelId + '"', 160 160 ' for="' + _.inputId + '"', 161 ' style="' + elementDefinition.labelStyle + '">',161 ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) +'>', 162 162 elementDefinition.label, 163 163 '</label>', 164 '<div class="cke_dialog_ui_labeled_content" role="presentation">',164 '<div class="cke_dialog_ui_labeled_content"' + ( elementDefinition.inputStyle ? ' style="' + elementDefinition.inputStyle + '"' : '' ) + ' role="presentation">', 165 165 contentHtml.call( this, dialog, elementDefinition ), 166 166 '</div>' ); 167 167 else … … 177 177 html : '<label class="cke_dialog_ui_labeled_label' + requiredClass + '"' + 178 178 ' id="' + _.labelId + '"' + 179 179 ' for="' + _.inputId + '"' + 180 ' style="' + elementDefinition.labelStyle + '">' +180 ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) +'>' + 181 181 CKEDITOR.tools.htmlEncode( elementDefinition.label ) + 182 182 '</span>' 183 183 }, 184 184 { 185 185 type : 'html', 186 html : '<span class="cke_dialog_ui_labeled_content" >' +186 html : '<span class="cke_dialog_ui_labeled_content"' + ( elementDefinition.inputStyle ? ' style="' + elementDefinition.inputStyle + '"' : '' ) + '>' + 187 187 contentHtml.call( this, dialog, elementDefinition ) + 188 188 '</span>' 189 189 } … … 237 237 if ( elementDefinition.size ) 238 238 attributes.size = elementDefinition.size; 239 239 240 if ( elementDefinition.controlStyle )241 attributes.style = elementDefinition.controlStyle;242 240 243 241 // If user presses Enter in a text box, it implies clicking OK for the dialog. 244 242 var me = this, keyPressedOnMe = false; … … 380 378 if ( elementDefinition[ 'default' ] ) 381 379 attributes.checked = 'checked'; 382 380 383 if ( typeof myDefinition.controlStyle != 'undefined' )384 myDefinition.style = myDefinition.controlStyle;385 386 381 _.checkbox = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'input', null, attributes ); 387 382 html.push( ' <label id="', labelId, '" for="', attributes.id, '">', 388 383 CKEDITOR.tools.htmlEncode( elementDefinition.label ), … … 462 457 cleanInnerDefinition( inputDefinition ); 463 458 cleanInnerDefinition( labelDefinition ); 464 459 465 if ( typeof inputDefinition.controlStyle != 'undefined' )466 inputDefinition.style = inputDefinition.controlStyle;467 468 460 children.push( new CKEDITOR.ui.dialog.uiElement( dialog, inputDefinition, inputHtml, 'input', null, inputAttributes ) ); 469 461 inputHtml.push( ' ' ); 470 462 new CKEDITOR.ui.dialog.uiElement( dialog, labelDefinition, inputHtml, 'label', null, { id : labelId, 'for' : inputAttributes.id }, … … 622 614 CKEDITOR.tools.htmlEncode( item[0] ) ); 623 615 } 624 616 625 if ( typeof myDefinition.controlStyle != 'undefined' )626 myDefinition.style = myDefinition.controlStyle;627 628 617 _.select = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'select', null, attributes, innerHTML.join( '' ) ); 629 618 return html.join( '' ); 630 619 }; -
_source/plugins/docprops/dialogs/docprops.js
177 177 ) + 178 178 '})())'; 179 179 180 function textCenterAlign() { this.getInputElement().setStyle( 'text-align', 'center' ); } 181 180 182 return { 181 183 title : lang.title, 182 184 minHeight: 330, … … 546 548 id : 'marginTop', 547 549 label : lang.marginTop, 548 550 style : 'width: 80px; text-align: center; margin: 0px auto', 549 controlStyle : 'text-align: center',550 551 setup : function( doc, html, head, body ) 551 552 { 552 553 this.setValue( body.getStyle( 'margin-top' ) || body.getAttribute( 'margintop' ) || '' ); 553 554 }, 554 555 commit : commitMargin( 'top' ), 555 onLoad : function() 556 { 557 this.getElement().getParent().setStyle( 'text-align', 'center' ); 558 } 556 onLoad : textCenterAlign 559 557 }, 560 558 { 561 559 type : 'hbox', … … 565 563 id : 'marginLeft', 566 564 label : lang.marginLeft, 567 565 style : 'width: 80px; text-align: center; margin: 0px auto', 568 controlStyle : 'text-align: center',569 566 setup : function( doc, html, head, body ) 570 567 { 571 568 this.setValue( body.getStyle( 'margin-left' ) || body.getAttribute( 'marginleft' ) || '' ); 572 569 }, 573 570 commit : commitMargin( 'left' ), 574 onLoad : function() 575 { 576 this.getElement().getParent().setStyle( 'text-align', 'center' ); 577 } 571 onLoad : textCenterAlign 578 572 }, 579 573 { 580 574 type : 'text', 581 575 id : 'marginRight', 582 576 label : lang.marginRight, 583 577 style : 'width: 80px; text-align: center; margin: 0px auto', 584 controlStyle : 'text-align: center',585 578 setup : function( doc, html, head, body ) 586 579 { 587 580 this.setValue( body.getStyle( 'margin-right' ) || body.getAttribute( 'marginright' ) || '' ); 588 581 }, 589 582 commit : commitMargin( 'right' ), 590 onLoad : function() 591 { 592 this.getElement().getParent().setStyle( 'text-align', 'center' ); 593 } 594 } 583 onLoad : textCenterAlign 584 } 595 585 ] 596 586 }, 597 587 { … … 599 589 id : 'marginBottom', 600 590 label : lang.marginBottom, 601 591 style : 'width: 80px; text-align: center; margin: 0px auto', 602 controlStyle : 'text-align: center',603 592 setup : function( doc, html, head, body ) 604 593 { 605 594 this.setValue( body.getStyle( 'margin-bottom' ) || body.getAttribute( 'marginbottom' ) || '' ); 606 595 }, 607 596 commit : commitMargin( 'bottom' ), 608 onLoad : function() 609 { 610 this.getElement().getParent().setStyle( 'text-align', 'center' ); 611 } 612 } 597 onLoad : textCenterAlign 598 } 613 599 ] 614 600 } 615 601 ]