ソースを参照

Improved docs, removed Paragraph translation that is moved to core.

Szymon Kupś 7 年 前
コミット
f733918615

+ 3 - 4
packages/ckeditor5-heading/lang/contexts.json

@@ -1,8 +1,7 @@
 {
-	"Paragraph": "Dropdown option label for the paragraph format.",
 	"Heading": "Tooltip for the heading dropdown.",
 	"Choose heading": "Default label for the heading dropdown.",
-	"Heading 1": "Dropdown option label for the heading level 1 format.",
-	"Heading 2": "Dropdown option label for the heading level 2 format.",
-	"Heading 3": "Dropdown option label for the heading level 3 format."
+	"Heading 1": "Dropdown option label for the heading level 1 format, also used as heading 1 button tooltip.",
+	"Heading 2": "Dropdown option label for the heading level 2 format, also used as heading 1 button tooltip.",
+	"Heading 3": "Dropdown option label for the heading level 3 format, also used as heading 1 button tooltip."
 }

+ 2 - 2
packages/ckeditor5-heading/src/heading.js

@@ -111,6 +111,6 @@ export default class Heading extends Plugin {
  * @property {module:engine/view/elementdefinition~ElementDefinition} view Definition of a view element to convert from/to.
  * @property {String} title The user-readable title of the option.
  * @property {String} class The class which will be added to the dropdown item representing this option.
- * @property {String} [icon] Icon used by {@link module:heading/headingbuttonsui~HeadingButtonUI}. It is optional when using
- * standard configuration and can be omitted.
+ * @property {String} [icon] Icon used by {@link module:heading/headingbuttonsui~HeadingButtonUI}. It can be omitted When using
+ * default configuration.
  */

+ 14 - 2
packages/ckeditor5-heading/src/headingbuttonsui.js

@@ -21,7 +21,7 @@ const defaultIcons = {
 };
 
 /**
- * HeadingButtonsUI class creates set of UI buttons that can be used instead of drop down component.
+ * HeadingButtonsUI class creates a set of UI buttons that can be used instead of drop down component.
  * It is not enabled by default when using {@link module:heading/heading~Heading heading plugin}, and needs to be
  * added manually to the editor configuration.
  *
@@ -38,17 +38,23 @@ const defaultIcons = {
  *						{ model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }
  *					]
  * 				},
- * 				toolbar: []
+ * 				toolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3' ]
  *			} )
  *			.then( ... )
  *			.catch( ... );
  *
+ * NOTE: Paragraph button is defined in {@link module:paragraph/paragraphbuttonui~ParagraphButtonUI} plugin that needs
+ * to be loaded manually as well.
+ *
  * It is possible to use custom icons by providing `icon` config option provided in {@link module:heading/heading~HeadingOption}.
  * For the default configuration standard icons are used.
  *
  * @extends module:core/plugin~Plugin
  */
 export default class HeadingButtonsUI extends Plugin {
+	/**
+	 * @inheritDoc
+	 */
 	init() {
 		const options = getLocalizedOptions( this.editor );
 
@@ -57,6 +63,12 @@ export default class HeadingButtonsUI extends Plugin {
 			.map( item => this._createButton( item ) );
 	}
 
+	/**
+	 * Creates single button view from provided configuration option.
+	 *
+	 * @private
+	 * @param {Object} option
+	 */
 	_createButton( option ) {
 		const editor = this.editor;