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

Docs: Pending actions and Plugin API docs corrected. [skip ci]

Anna Tomanek 7 лет назад
Родитель
Сommit
72d3d09711
2 измененных файлов с 26 добавлено и 26 удалено
  1. 4 4
      packages/ckeditor5-core/src/pendingactions.js
  2. 22 22
      packages/ckeditor5-core/src/plugin.js

+ 4 - 4
packages/ckeditor5-core/src/pendingactions.js

@@ -17,7 +17,7 @@ import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
  *
  * This plugin should be used to synchronise plugins that execute long-lasting actions
  * (e.g. file upload) with the editor integration. It gives the developer who integrates the editor
- * an easy way to check if there are any pending actions whenever such information is needed.
+ * an easy way to check if there are any actions pending whenever such information is needed.
  * All plugins that register a pending action also provide a message about the action that is ongoing
  * which can be displayed to the user. This lets them decide if they want to interrupt the action or wait.
  *
@@ -47,7 +47,7 @@ import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
  * 		Array.from( pendingActions ); // Returns [ action1, action2 ]
  *
  * This plugin is used by features like {@link module:upload/filerepository~FileRepository} to register their ongoing actions
- * and by features like {@link module:autosave/autosave~Autosave} to detect whether there are no ongoing actions.
+ * and by features like {@link module:autosave/autosave~Autosave} to detect whether there are any ongoing actions.
  * Read more about saving the data in the {@glink builds/guides/integration/saving-data Saving and getting data} guide.
  *
  * @extends module:core/plugin~Plugin
@@ -89,8 +89,8 @@ export default class PendingActions extends Plugin {
 	 * This method returns an action object with an observable message property.
 	 * The action object can be later used in the {@link #remove} method. It also allows you to change the message.
 	 *
-	 * @param {String} message Action message.
-	 * @returns {Object} Observable object that represents a pending action.
+	 * @param {String} message The action message.
+	 * @returns {Object} An observable object that represents a pending action.
 	 */
 	add( message ) {
 		if ( typeof message !== 'string' ) {

+ 22 - 22
packages/ckeditor5-core/src/plugin.js

@@ -24,15 +24,15 @@ export default class Plugin {
 		/**
 		 * The editor instance.
 		 *
-		 * Note that most editors implements {@link module:core/editor/editorwithui~EditorWithUI} interface in addition
-		 * to the base {@link module:core/editor/editor~Editor} interface. However, editors with external UI
-		 * (i.e. Bootstrap based) or headless editor may not implement {@link module:core/editor/editorwithui~EditorWithUI}
+		 * Note that most editors implement the {@link module:core/editor/editorwithui~EditorWithUI} interface in addition
+		 * to the base {@link module:core/editor/editor~Editor} interface. However, editors with an external UI
+		 * (i.e. Bootstrap-based) or a headless editor may not implement the {@link module:core/editor/editorwithui~EditorWithUI}
 		 * interface.
 		 *
 		 * Because of above, to make plugins more universal, it is recommended to split features into:
-		 *  - "Editing" part which use only {@link module:core/editor/editor~Editor} interface,
-		 *  - "UI" part which use both {@link module:core/editor/editor~Editor} interface and
-		 *  {@link module:core/editor/editorwithui~EditorWithUI} interface.
+		 *  - The "editing" part that only uses the {@link module:core/editor/editor~Editor} interface.
+		 *  - The "UI" part that uses both the {@link module:core/editor/editor~Editor} interface and
+		 *  the {@link module:core/editor/editorwithui~EditorWithUI} interface.
 		 *
 		 * @readonly
 		 * @member {module:core/editor/editor~Editor} #editor
@@ -53,25 +53,25 @@ mix( Plugin, ObservableMixin );
 /**
  * The base interface for CKEditor plugins.
  *
- * In its minimal form it can be a simple function (it will be used as a constructor) which accepts
- * {@link module:core/editor/editor~Editor the editor} as a parm.
+ * In its minimal form it can be a simple function (it will be used as a constructor) that accepts
+ * {@link module:core/editor/editor~Editor the editor} as a parameter.
  * It can also implement a few methods which, when present, will be used to properly initialize and destroy the plugin.
  *
- *		// A simple plugin which enables a data processor.
+ *		// A simple plugin that enables a data processor.
  *		function MyPlugin( editor ) {
  *			editor.data.processor = new MyDataProcessor();
  *		}
  *
- * In most cases, however, you'll want to inherit from the {@link module:core/plugin~Plugin} class which implements the
+ * In most cases, however, you will want to inherit from the {@link module:core/plugin~Plugin} class which implements the
  * {@link module:utils/observablemixin~ObservableMixin} and is, therefore, more convenient:
  *
  *		class MyPlugin extends Plugin {
  *			init() {
  *				// `listenTo()` and `editor` are available thanks to `Plugin`.
- *				// By using `listenTo()` you'll ensure that the listener will be removed when
+ *				// By using `listenTo()` you will ensure that the listener is removed when
  *				// the plugin is destroyed.
  *				this.listenTo( this.editor, 'dataReady', () => {
- *					// Do something when data is ready.
+ *					// Do something when the data is ready.
  *				} );
  *			}
  *		}
@@ -80,16 +80,16 @@ mix( Plugin, ObservableMixin );
  */
 
 /**
- * Creates a new plugin instance. This is the first step of a plugin initialization.
+ * Creates a new plugin instance. This is the first step of the plugin initialization.
  * See also {@link #init} and {@link #afterInit}.
  *
  * A plugin is always instantiated after its {@link module:core/plugin~PluginInterface.requires dependencies} and the
  * {@link #init} and {@link #afterInit} methods are called in the same order.
  *
- * Usually, you'll want to put your plugin's initialization code in the {@link #init} method.
+ * Usually, you will want to put your plugin's initialization code in the {@link #init} method.
  * The constructor can be understood as "before init" and used in special cases, just like
- * {@link #afterInit} servers for the special "after init" scenarios (e.g. code which depends on other
- * plugins, but which doesn't {@link module:core/plugin~PluginInterface.requires explicitly require} them).
+ * {@link #afterInit} serves the special "after init" scenarios (e.g.the code which depends on other
+ * plugins, but which does not {@link module:core/plugin~PluginInterface.requires explicitly require} them).
  *
  * @method #constructor
  * @param {module:core/editor/editor~Editor} editor
@@ -98,7 +98,7 @@ mix( Plugin, ObservableMixin );
 /**
  * An array of plugins required by this plugin.
  *
- * To keep a plugin class definition tight it's recommended to define this property as a static getter:
+ * To keep the plugin class definition tight it is recommended to define this property as a static getter:
  *
  *		import Image from './image.js';
  *
@@ -114,13 +114,13 @@ mix( Plugin, ObservableMixin );
  */
 
 /**
- * Optional name of the plugin. If set, the plugin will be available in
+ * An optional name of the plugin. If set, the plugin will be available in
  * {@link module:core/plugincollection~PluginCollection#get} by its
  * name and its constructor. If not, then only by its constructor.
  *
  * The name should reflect the constructor name.
  *
- * To keep a plugin class definition tight it's recommended to define this property as a static getter:
+ * To keep the plugin class definition tight it is recommended to define this property as a static getter:
  *
  *		export default class ImageCaption {
  *			static get pluginName() {
@@ -146,7 +146,7 @@ mix( Plugin, ObservableMixin );
  * A plugin's `init()` method is called after its {@link module:core/plugin~PluginInterface.requires dependencies} are initialized,
  * so in the same order as constructors of these plugins.
  *
- * **Note:** This method is optional. A plugin instance does not need to have to have it defined.
+ * **Note:** This method is optional. A plugin instance does not need to have it defined.
  *
  * @method #init
  * @returns {null|Promise}
@@ -155,7 +155,7 @@ mix( Plugin, ObservableMixin );
 /**
  * The third (and last) stage of plugin initialization. See also {@link #constructor} and {@link #init}.
  *
- * **Note:** This method is optional. A plugin instance does not need to have to have it defined.
+ * **Note:** This method is optional. A plugin instance does not need to have it defined.
  *
  * @method #afterInit
  * @returns {null|Promise}
@@ -164,7 +164,7 @@ mix( Plugin, ObservableMixin );
 /**
  * Destroys the plugin.
  *
- * **Note:** This method is optional. A plugin instance does not need to have to have it defined.
+ * **Note:** This method is optional. A plugin instance does not need to have it defined.
  *
  * @method #destroy
  * @returns {null|Promise}