8
0
فهرست منبع

Docs: Block toolbar features guide and API docs corrected. [skip ci]

Anna Tomanek 7 سال پیش
والد
کامیت
27416f1efc
2فایلهای تغییر یافته به همراه16 افزوده شده و 16 حذف شده
  1. 5 5
      packages/ckeditor5-ui/docs/features/blocktoolbar.md
  2. 11 11
      packages/ckeditor5-ui/src/toolbar/block/blocktoolbar.js

+ 5 - 5
packages/ckeditor5-ui/docs/features/blocktoolbar.md

@@ -3,9 +3,9 @@ title: Block toolbar
 category: features
 ---
 
-The {@link module:ui/toolbar/block/blocktoolbar~BlockToolbar} plugin provides an additional [configurable](#configuration) toolbar on the left-hand side of the content area (the gutter). The toolbar is represented by a button with a pilcrow (¶) and positioned next to the block element that the selection is anchored to (e.g. a paragraph), following the caret as the user edits the content and navigates the document.
+The {@link module:ui/toolbar/block/blocktoolbar~BlockToolbar} plugin provides an additional [configurable](#configuration) toolbar on the left-hand side of the content area (the gutter). The toolbar is represented by a button with a pilcrow, or a paragraph mark, ¶. It is positioned next to the block element that the selection is anchored to (e.g. a paragraph), following the caret as the user edits the content and navigates the document.
 
-Because the toolbar is always connected to the block of content, it naturally gives accommodation to the features which modify entire blocks (e.g. create headers, paragraphs) rather than inline styles (e.g. bold, italic, etc.).
+Since the toolbar is always connected to the block of content, it naturally accomodates the features that modify entire blocks (e.g. create headers or paragraphs) rather than inline styles (e.g. bold, italic, etc.).
 
 ## Example
 
@@ -17,7 +17,7 @@ Because the toolbar is always connected to the block of content, it naturally gi
 
 ## Configuration
 
-The content of toolbar can be defined using the {@link module:core/editor/editorconfig~EditorConfig#blockToolbar} configuration. See the [installation instruction](#installation) to learn more.
+The content of the toolbar can be defined using the {@link module:core/editor/editorconfig~EditorConfig#blockToolbar} configuration. See the [installation instructions](#installation) to learn more.
 
 To adjust the position of the block toolbar button to match the styles of your website, use the CSS `transform` property:
 
@@ -30,12 +30,12 @@ To adjust the position of the block toolbar button to match the styles of your w
 ## Installation
 
 <info-box hint>
-	Remember to add proper features to the editor configuration first. The block toolbar provides a space for the buttons, it does not bring the actual features. For example: the `heading1` button will not work if there is no {@link features/headings Headings} feature in the editor.
+	Remember to add relevant features to the editor configuration first. The block toolbar provides a space for the buttons, it does not bring the actual features. For example, the `heading1` button will not work if there is no {@link features/headings Headings} feature in the editor.
 </info-box>
 
 To add this feature to your editor install the [`@ckeditor/ckeditor5-ui`](https://www.npmjs.com/package/@ckeditor/ckeditor5-ui) package:
 
-```
+```bash
 npm install --save @ckeditor/ckeditor5-ui
 ```
 

+ 11 - 11
packages/ckeditor5-ui/src/toolbar/block/blocktoolbar.js

@@ -24,8 +24,8 @@ import iconPilcrow from '@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg';
 /**
  * The block toolbar plugin.
  *
- * This plugin provides the button positioned next to the block of content where the selection is anchored.
- * Upon clicking the button, a dropdown providing editor features shows up, as configured in
+ * This plugin provides a button positioned next to the block of content where the selection is anchored.
+ * Upon clicking the button, a dropdown providing access to editor features shows up, as configured in
  * {@link module:core/editor/editorconfig~EditorConfig#blockToolbar}.
  *
  * By default, the button is displayed next to all elements marked in {@link module:engine/model/schema~Schema}
@@ -35,21 +35,21 @@ import iconPilcrow from '@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg';
  * {@link module:engine/view/editableelement~EditableElement}:
  *
  * 		 __ |
- * 		|  ||  This is a block of content that
+ * 		|  ||  This is a block of content that the
  * 		 ¯¯ |  button is attached to. This is a
- * 		    |  block of content that button is
+ * 		    |  block of content that the button is
  * 		    |  attached to.
  *
- * The position of the button can be adjusted using the CSS `transform`:
+ * The position of the button can be adjusted using the CSS `transform` property:
  *
  * 		.ck-block-toolbar-button {
  * 			transform: translateX( -10px );
  * 		}
  *
  * 		 __   |
- * 		|  |  |  This is a block of content that
+ * 		|  |  |  This is a block of content that the
  * 		 ¯¯   |  button is attached to. This is a
- * 		      |  block of content that button is
+ * 		      |  block of content that the button is
  * 		      |  attached to.
  *
  * @extends module:core/plugin~Plugin
@@ -83,7 +83,7 @@ export default class BlockToolbar extends Plugin {
 		this.panelView = this._createPanelView();
 
 		/**
-		 * The button view, that opens the {@link #toolbarView}.
+		 * The button view that opens the {@link #toolbarView}.
 		 *
 		 * @type {module:ui/toolbar/block/blockbuttonview~BlockButtonView}
 		 */
@@ -132,7 +132,7 @@ export default class BlockToolbar extends Plugin {
 	}
 
 	/**
-	 * Fill the toolbar with its items based on the configuration.
+	 * Fills the toolbar with its items based on the configuration.
 	 *
 	 * **Note:** This needs to be done after all plugins are ready.
 	 *
@@ -237,7 +237,7 @@ export default class BlockToolbar extends Plugin {
 
 	/**
 	 * Shows or hides the button.
-	 * When the all conditions for displaying button are matched then shows the button. Hides otherwise.
+	 * When all the conditions for displaying the button are matched, it shows the button. Hides otherwise.
 	 *
 	 * @private
 	 */
@@ -317,7 +317,7 @@ export default class BlockToolbar extends Plugin {
 	 * Hides the {@link #toolbarView}.
 	 *
 	 * @private
-	 * @param {Boolean} [focusEditable=false] When `true` then editable will be focused after hiding panel.
+	 * @param {Boolean} [focusEditable=false] When `true`, the editable will be focused after hiding the panel.
 	 */
 	_hidePanel( focusEditable ) {
 		this.panelView.isVisible = false;