8
0
Просмотр исходного кода

Docs: Alignment docs corrected. [skip ci]

Anna Tomanek 8 лет назад
Родитель
Сommit
f4dde2eb25

+ 5 - 5
packages/ckeditor5-alignment/docs/features/text-alignment.md

@@ -5,7 +5,7 @@ category: features
 
 {@snippet features/build-text-alignment-source}
 
-The {@link module:alignment/alignment~Alignment} feature enables support for text alignment.
+The {@link module:alignment/alignment~Alignment} feature enables support for text alignment. You can use it to align your content to left, right and center or justify it. 
 
 ## Demo
 
@@ -13,9 +13,9 @@ The {@link module:alignment/alignment~Alignment} feature enables support for tex
 
 ## Configuring alignment options
 
-It is, of course, possible to configure which alignment options the editor should support. Use the {@link module:alignment/alignment~AlignmentConfig#options `alignment.options`} configuration option to do so (you can choose from `'left'`, `'right'`, `'center'` and `'justify'`,  but `'left'` should be always included).
+It is possible to configure which alignment options are available in the editor by setting the {@link module:alignment/alignment~AlignmentConfig#options `alignment.options`} configuration option. You can choose from `'left'`, `'right'`, `'center'` and `'justify'`;  note that `'left'` should always be included).
 
-For example, the following editor will support only two alignment to the left and to the right:
+For example, the following editor will support only two alignment options: to the left and to the right:
 
 ```js
 ClassicEditor
@@ -35,7 +35,7 @@ ClassicEditor
 
 ## Configuring the toolbar
 
-You can choose to use the alignment dropdown (`'alignmentDropdown'`) or configure the toolbar to use separate buttons for each of the options:
+You can choose to use the alignment drop-down (`'alignmentDropdown'`) or configure the toolbar to use separate buttons for each of the options:
 
 ```js
 ClassicEditor
@@ -80,7 +80,7 @@ ClassicEditor
 
 The {@link module:alignment/alignment~Alignment} plugin registers:
 
-* Dropdown: `'alignmentDropdown'`.
+* Drop-down: `'alignmentDropdown'`.
 * Buttons and commands: `'alignLeft'`, `'alignRight'`, `'alignCenter'`, `'alignJustify'`.
 
 	The number of options and their names are based on the {@link module:alignment/alignment~AlignmentConfig#options `alignment.options`} configuration option).

+ 3 - 3
packages/ckeditor5-alignment/src/alignment.js

@@ -39,7 +39,7 @@ export default class Alignment extends Plugin {
 }
 
 /**
- * The configuration of the {@link module:alignment/alignment~Alignment Alignment feature}.
+ * The configuration of the {@link module:alignment/alignment~Alignment alignment feature}.
  *
  * Read more in {@link module:alignment/alignment~AlignmentConfig}.
  *
@@ -47,7 +47,7 @@ export default class Alignment extends Plugin {
  */
 
 /**
- * The configuration of the {@link module:alignment/alignment~Alignment Alignment feature}.
+ * The configuration of the {@link module:alignment/alignment~Alignment alignment feature}.
  *
  *		ClassicEditor
  *			.create( editorElement, {
@@ -58,7 +58,7 @@ export default class Alignment extends Plugin {
  *			.then( ... )
  *			.catch( ... );
  *
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
  *
  * @interface AlignmentConfig
  */

+ 5 - 5
packages/ckeditor5-alignment/src/alignmentcommand.js

@@ -19,7 +19,7 @@ import upperFirst from '@ckeditor/ckeditor5-utils/src/lib/lodash/upperFirst';
  */
 export default class AlignmentCommand extends Command {
 	/**
-	 * Creates an instance of the command.
+	 * Creates an instance of the alignment command.
 	 *
 	 * @param {module:core/editor/editor~Editor} editor The editor instance.
 	 * @param {'left'|'right'|'center'|'justify'} alignment Alignment value to be handled by this command.
@@ -61,7 +61,7 @@ export default class AlignmentCommand extends Command {
 	refresh() {
 		const firstBlock = first( this.editor.model.document.selection.getSelectedBlocks() );
 
-		// As first check whether to enable or disable command as value will be always false if command cannot be enabled.
+		// As first check whether to enable or disable the command as the value will always be false if the command cannot be enabled.
 		this.isEnabled = !!firstBlock && this._canBeAligned( firstBlock );
 		this.value = this._getValue( firstBlock );
 	}
@@ -91,7 +91,7 @@ export default class AlignmentCommand extends Command {
 	}
 
 	/**
-	 * Checks whether block can have alignment set.
+	 * Checks whether a block can have alignment set.
 	 *
 	 * @private
 	 * @param {module:engine/model/element~Element} block A block to be checked.
@@ -105,7 +105,7 @@ export default class AlignmentCommand extends Command {
 	 * Checks the command's {@link #value}.
 	 *
 	 * @private
-	 * @param {module:engine/model/element~Element} firstBlock A first block in selection to be checked.
+	 * @param {module:engine/model/element~Element} firstBlock The first block in the selection to be checked.
 	 * @returns {Boolean} The current value.
 	 */
 	_getValue( firstBlock ) {
@@ -123,7 +123,7 @@ export default class AlignmentCommand extends Command {
 }
 
 /**
- * Helper function that returns command name for alignment option.
+ * Helper function that returns the command name for the alignment option.
  *
  * @param {String} option
  * @returns {String}

+ 5 - 5
packages/ckeditor5-alignment/src/alignmentediting.js

@@ -28,7 +28,7 @@ export default class AlignmentEditing extends Plugin {
 	}
 
 	/**
-	 * List of supported alignment options:
+	 * The list of supported alignment options:
 	 *
 	 * * `'left'`,
 	 * * `'right'`,
@@ -85,16 +85,16 @@ export default class AlignmentEditing extends Plugin {
 }
 
 /**
- * Checks whether passed option is supported by {@link module:alignment/alignmentediting~AlignmentEditing}.
+ * Checks whether the passed option is supported by {@link module:alignment/alignmentediting~AlignmentEditing}.
  *
- * @param {String} option Option value to check.
+ * @param {String} option The option value to check.
  * @returns {Boolean}
  */
 export function isSupported( option ) {
 	return AlignmentEditing.supportedOptions.includes( option );
 }
 
-// Dispatcher handler responsible for setting style to a view element.
+// Dispatcher handler responsible for setting the style to a view element.
 // @private
 function convertStyle() {
 	return ( evt, data, consumable, conversionApi ) => {
@@ -110,7 +110,7 @@ function convertStyle() {
 	};
 }
 
-// Check whether alignment is default one.
+// Check whether alignment is the default one.
 // @private
 function isDefault( textAlign ) {
 	// Right now only LTR is supported so 'left' value is always the default one.

+ 3 - 3
packages/ckeditor5-alignment/src/alignmentui.js

@@ -32,7 +32,7 @@ const icons = new Map( [
  * The default Alignment UI plugin.
  *
  * It introduces the `'alignLeft'`, `'alignRight'`, `'alignCenter'` and `'alignJustify'` buttons
- * and the `'alignmentDropdown'` dropdown.
+ * and the `'alignmentDropdown'` drop-down.
  *
  * @extends module:core/plugin~Plugin
  */
@@ -102,10 +102,10 @@ export default class AlignmentUI extends Plugin {
 	}
 
 	/**
-	 * Helper method for initializing a button and linking it with an appropriate command.
+	 * Helper method for initializing the button and linking it with an appropriate command.
 	 *
 	 * @private
-	 * @param {String} option The name of the alignment option for which to add a button.
+	 * @param {String} option The name of the alignment option for which the button is added.
 	 */
 	_addButton( option ) {
 		const editor = this.editor;