X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fjustify%2Fplugin.js;h=82c1fccff5e1cf80b40d3879646a181fd80f0ec2;hb=4e70ea24db840898be8cc21c950363a52a2a6aba;hp=2de9b0b77f37393e5530b2b0f6b7cebf893fe8bc;hpb=614511639979907ceb0da3614122a4d8eb963ad4;p=ckeditor.git diff --git a/_source/plugins/justify/plugin.js b/_source/plugins/justify/plugin.js index 2de9b0b..82c1fcc 100644 --- a/_source/plugins/justify/plugin.js +++ b/_source/plugins/justify/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -49,6 +49,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license function onSelectionChange( evt ) { + if ( evt.editor.readOnly ) + return; + var command = evt.editor.getCommand( this.name ); command.state = getState.call( this, evt.editor, evt.data.path ); command.fire( 'state' ); @@ -159,7 +162,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license iterator = ranges[ i ].createIterator(); iterator.enlargeBr = enterMode != CKEDITOR.ENTER_BR; - while ( ( block = iterator.getNextParagraph() ) ) + while ( ( block = iterator.getNextParagraph( enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' ) ) ) { block.removeAttribute( 'align' ); block.removeStyle( 'text-align' ); @@ -237,3 +240,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license requires : [ 'domiterator' ] }); })(); + + /** + * List of classes to use for aligning the contents. If it's null, no classes will be used + * and instead the corresponding CSS values will be used. The array should contain 4 members, in the following order: left, center, right, justify. + * @name CKEDITOR.config.justifyClasses + * @type Array + * @default null + * @example + * // Use the classes 'AlignLeft', 'AlignCenter', 'AlignRight', 'AlignJustify' + * config.justifyClasses = [ 'AlignLeft', 'AlignCenter', 'AlignRight', 'AlignJustify' ]; + */