|
|
@@ -16,7 +16,7 @@ import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
|
* The list of pending editor actions.
|
|
|
*
|
|
|
* This plugin should be used to synchronise plugins that execute long-lasting actions
|
|
|
- * (i.e. file upload) with the editor integration. It gives the developer who integrates the editor
|
|
|
+ * (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.
|
|
|
* 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.
|
|
|
@@ -24,9 +24,10 @@ import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
|
* Adding and updating a pending action:
|
|
|
*
|
|
|
* const pendingActions = editor.plugins.get( 'PendingActions' );
|
|
|
- * const action = pendingActions.add( 'Upload in progress 0%' );
|
|
|
+ * const action = pendingActions.add( 'Upload in progress: 0%.' );
|
|
|
*
|
|
|
- * action.message = 'Upload in progress 10%';
|
|
|
+ * // You can update the message:
|
|
|
+ * action.message = 'Upload in progress: 10%.';
|
|
|
*
|
|
|
* Removing a pending action:
|
|
|
*
|
|
|
@@ -42,8 +43,12 @@ import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
|
* const action1 = pendingActions.add( 'Action 1' );
|
|
|
* const action2 = pendingActions.add( 'Action 2' );
|
|
|
*
|
|
|
- * pendingActions.first // Returns action1
|
|
|
- * Array.from( pendingActions ) // Returns [ action1, action2 ]
|
|
|
+ * pendingActions.first; // Returns action1
|
|
|
+ * 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.
|
|
|
+ * Read more about saving the data in the {@glink builds/guides/integration/saving-data Saving and getting data} guide.
|
|
|
*
|
|
|
* @extends module:core/plugin~Plugin
|
|
|
*/
|