Ticket #5418: 5418_5.patch
File 5418_5.patch, 6.5 KB (added by , 14 years ago) |
---|
-
_source/lang/en.js
105 105 targetTop : 'Topmost Window (_top)', 106 106 targetSelf : 'Same Window (_self)', 107 107 targetParent : 'Parent Window (_parent)', 108 advanced : 'Advanced', 109 langDirLTR : 'Left to Right (LTR)', 110 langDirRTL : 'Right to Left (RTL)', 111 styles : 'Style', 112 cssClasses : 'Stylesheet Classes', 108 113 109 114 // Put the voice-only part of the label in the span. 110 115 unavailable : '%1<span class="cke_accessibility">, unavailable</span>' -
_source/plugins/showborders/plugin.js
161 161 selectedTable[ ( !value || value <= 0 ) ? 'addClass' : 'removeClass' ]( showBorderClassName ); 162 162 }; 163 163 } ); 164 165 var advTab = dialogDefinition.getContents( 'advanced' ), 166 classField = advTab && advTab.get( 'advCSSClasses' ); 167 168 if ( classField ) 169 { 170 classField.setup = CKEDITOR.tools.override( classField.setup, function( originalSetup ) 171 { 172 return function() 173 { 174 originalSetup.apply( this, arguments ); 175 this.setValue( this.getValue().replace( /cke_show_border/, '' ) ); 176 }; 177 }); 178 179 classField.commit = CKEDITOR.tools.override( classField.commit, function( originalCommit ) 180 { 181 return function( data, element ) 182 { 183 originalCommit.apply( this, arguments ); 184 185 if ( !parseInt( element.getAttribute( 'border' ) ) ) 186 element.addClass( 'cke_show_border' ); 187 }; 188 }); 189 } 164 190 } 165 191 }); 166 192 -
_source/plugins/table/dialogs/table.js
18 18 19 19 function tableDialog( editor, command ) 20 20 { 21 var makeElement = function( name ){ return new CKEDITOR.dom.element( name, editor.document ); }; 21 var makeElement = function( name ) 22 { 23 return new CKEDITOR.dom.element( name, editor.document ); 24 }; 25 26 var dialogadvtab = editor.plugins.dialogadvtab; 22 27 23 28 return { 24 29 title : editor.lang.table.title, 25 30 minWidth : 310, 26 31 minHeight : CKEDITOR.env.ie ? 310 : 280, 32 33 onLoad : function() 34 { 35 var dialog = this, 36 isUpdating; 37 38 dialog.getContentElement( 'advanced', 'advStyles' ).on( 'change', function( evt ) 39 { 40 if ( isUpdating ) 41 return; 42 43 // Flag to avoid recursion. 44 isUpdating = 1; 45 46 // Synchronize width value. 47 var width = this.getStyle( 'width', '' ), 48 isPx = 1; 49 50 if ( width ) 51 { 52 isPx = ( width.length < 3 || width.substr( width.length - 1 ) != '%' ); 53 width = parseInt( width ); 54 } 55 56 dialog.getContentElement( 'info', 'txtWidth' ).setValue( width ); 57 dialog.getContentElement( 'info', 'cmbWidthType' ).setValue( isPx ? 'pixels' : 'percents' ); 58 59 // Synchronize height value. 60 var height = this.getStyle( 'height', '' ); 61 height && ( height = parseInt( height, 10 ) ); 62 dialog.getContentElement( 'info', 'txtHeight' ).setValue( height ); 63 64 isUpdating = 0; 65 }); 66 }, 67 27 68 onShow : function() 28 69 { 29 70 // Detect if there's a selected table. … … 70 111 colsInput && colsInput.enable(); 71 112 rowsInput && rowsInput.select(); 72 113 } 114 115 // Call the onChange method for the widht and height fields so 116 // they get reflected into the Advanced tab. 117 widthInput.onChange(); 118 this.getContentElement( 'info', 'txtHeight' ).onChange(); 73 119 }, 74 120 onOk : function() 75 121 { … … 380 426 id : 'txtWidth', 381 427 style : 'width:5em', 382 428 label : editor.lang.table.width, 383 'default' : 200,429 'default' : 500, 384 430 validate : CKEDITOR.dialog.validate['number']( editor.lang.table.invalidWidth ), 385 431 386 432 // Extra labelling of width unit type. … … 394 440 inputElement.setAttribute( 'aria-labelledby', [ ariaLabelledByAttr, labelElement.$.id ].join( ' ' ) ); 395 441 }, 396 442 443 onChange : function() 444 { 445 var value = this.getValue(); 446 447 if ( value ) 448 value += this.getDialog().getContentElement( 'info', 'cmbWidthType' ).getValue() == 'percents' ? '%' : 'px'; 449 450 this.getDialog() 451 .getContentElement( 'advanced', 'advStyles' ) 452 .updateStyle( 'width', value ); 453 }, 454 397 455 setup : function( selectedTable ) 398 456 { 399 457 var widthMatch = widthPattern.exec( selectedTable.$.style.width ); … … 421 479 if ( widthMatch ) 422 480 this.setValue( widthMatch[2] == 'px' ? 'pixels' : 'percents' ); 423 481 }, 482 onChange : function() 483 { 484 this.getDialog().getContentElement( 'info', 'txtWidth' ).onChange(); 485 }, 424 486 commit : commitValue 425 487 } 426 488 ] … … 449 511 inputElement.setAttribute( 'aria-labelledby', [ ariaLabelledByAttr, labelElement.$.id ].join( ' ' ) ); 450 512 }, 451 513 514 onChange : function() 515 { 516 var value = this.getValue(); 517 518 this.getDialog() 519 .getContentElement( 'advanced', 'advStyles' ) 520 .updateStyle( 'height', value && ( value + 'px' ) ); 521 }, 522 452 523 setup : function( selectedTable ) 453 524 { 454 525 var heightMatch = heightPattern.exec( selectedTable.$.style.height ); … … 582 653 ] 583 654 } 584 655 ] 585 } 656 }, 657 dialogadvtab.createAdvancedTab( editor ) 586 658 ] 587 659 }; 588 660 } -
_source/plugins/table/plugin.js
5 5 6 6 CKEDITOR.plugins.add( 'table', 7 7 { 8 requires : [ 'dialog', 'dialogadvtab' ], 9 8 10 init : function( editor ) 9 11 { 10 12 var table = CKEDITOR.plugins.table,