Sfoglia il codice sorgente

Docs: release api review, batch 1. [skip ci]

godai78 5 anni fa
parent
commit
524d2556bc

+ 2 - 2
packages/ckeditor5-engine/src/view/observer/domeventobserver.js

@@ -36,8 +36,8 @@ import DomEventData from './domeventdata';
  */
 export default class DomEventObserver extends Observer {
 	/**
-	 * Type of the DOM event the observer should listen on. Array of types can be defined
-	 * if the obsever should listen to multiple DOM events.
+	 * Type of the DOM event the observer should listen to. Array of types can be defined
+	 * if the observer should listen to multiple DOM events.
 	 *
 	 * @readonly
 	 * @member {String|Array.<String>} #domEventType

+ 5 - 5
packages/ckeditor5-engine/src/view/observer/observer.js

@@ -14,7 +14,7 @@ import mix from '@ckeditor/ckeditor5-utils/src/mix';
  * Abstract base observer class. Observers are classes which listen to DOM events, do the preliminary
  * processing and fire events on the {@link module:engine/view/document~Document} objects.
  * Observers can also add features to the view, for instance by updating its status or marking elements
- * which need refresh on DOM events.
+ * which need a refresh on DOM events.
  *
  * @abstract
  */
@@ -26,7 +26,7 @@ export default class Observer {
 	 */
 	constructor( view ) {
 		/**
-		 * Instance of the view controller.
+		 * An instance of the view controller.
 		 *
 		 * @readonly
 		 * @member {module:engine/view/view~View}
@@ -34,7 +34,7 @@ export default class Observer {
 		this.view = view;
 
 		/**
-		 * Reference to the {@link module:engine/view/document~Document} object.
+		 * A reference to the {@link module:engine/view/document~Document} object.
 		 *
 		 * @readonly
 		 * @member {module:engine/view/document~Document}
@@ -42,7 +42,7 @@ export default class Observer {
 		this.document = view.document;
 
 		/**
-		 * State of the observer. If it is disabled events will not be fired.
+		 * State of the observer. If it is disabled no events will be fired.
 		 *
 		 * @readonly
 		 * @member {Boolean}
@@ -86,7 +86,7 @@ export default class Observer {
 	 * Checks whether the given DOM event should be ignored (should not be turned into a synthetic view document event).
 	 *
 	 * Currently, an event will be ignored only if its target or any of its ancestors has the `data-cke-ignore-events` attribute.
-	 * This attribute can be used inside structures generated by
+	 * This attribute can be used inside the structures generated by
 	 * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `DowncastWriter#createUIElement()`} to ignore events
 	 * fired within a UI that should be excluded from CKEditor 5's realms.
 	 *

+ 13 - 13
packages/ckeditor5-engine/src/view/observer/selectionobserver.js

@@ -14,11 +14,11 @@ import MutationObserver from './mutationobserver';
 import { debounce } from 'lodash-es';
 
 /**
- * Selection observer class observes selection changes in the document. If selection changes on the document this
- * observer checks if there are any mutations and if DOM selection is different than the
- * {@link module:engine/view/document~Document#selection view selection}. Selection observer fires
- * {@link module:engine/view/document~Document#event:selectionChange} event only if selection change was the only change in the document
- * and DOM selection is different then the view selection.
+ * Selection observer class observes selection changes in the document. If a selection changes on the document this
+ * observer checks if there are any mutations and if the DOM selection is different from the
+ * {@link module:engine/view/document~Document#selection view selection}. The selection observer fires
+ * {@link module:engine/view/document~Document#event:selectionChange} event only if a selection change was the only change in the document
+ * and the DOM selection is different then the view selection.
  *
  * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  *
@@ -61,7 +61,7 @@ export default class SelectionObserver extends Observer {
 		this.domConverter = view.domConverter;
 
 		/**
-		 * Set of documents which have added "selectionchange" listener to avoid adding listener twice to the same
+		 * A set of documents which have added `selectionchange` listener to avoid adding a listener twice to the same
 		 * document.
 		 *
 		 * @private
@@ -119,8 +119,8 @@ export default class SelectionObserver extends Observer {
 
 	/**
 	 * Selection change listener. {@link module:engine/view/observer/mutationobserver~MutationObserver#flush Flush} mutations, check if
-	 * selection changes and fires {@link module:engine/view/document~Document#event:selectionChange} event on every change
-	 * and {@link module:engine/view/document~Document#event:selectionChangeDone} when selection stop changing.
+	 * a selection changes and fires {@link module:engine/view/document~Document#event:selectionChange} event on every change
+	 * and {@link module:engine/view/document~Document#event:selectionChangeDone} when a selection stop changing.
 	 *
 	 * @private
 	 * @param {Event} domEvent DOM event.
@@ -140,8 +140,8 @@ export default class SelectionObserver extends Observer {
 		// Ensure the mutation event will be before selection event on all browsers.
 		this.mutationObserver.flush();
 
-		// If there were mutations then the view will be re-rendered by the mutation observer and selection
-		// will be updated, so selections will equal and event will not be fired, as expected.
+		// If there were mutations then the view will be re-rendered by the mutation observer and the selection
+		// will be updated, so the selections will equal and the event will not be fired, as expected.
 		const newViewSelection = this.domConverter.domSelectionToView( domSelection );
 
 		// Do not convert selection change if the new view selection has no ranges in it.
@@ -188,7 +188,7 @@ export default class SelectionObserver extends Observer {
 			// Prepare data for new selection and fire appropriate events.
 			this.document.fire( 'selectionChange', data );
 
-			// Call` #_fireSelectionChangeDoneDebounced` every time when `selectionChange` event is fired.
+			// Call `#_fireSelectionChangeDoneDebounced` every time when `selectionChange` event is fired.
 			// This function is debounced what means that `selectionChangeDone` event will be fired only when
 			// defined int the function time will elapse since the last time the function was called.
 			// So `selectionChangeDone` will be fired when selection will stop changing.
@@ -207,8 +207,8 @@ export default class SelectionObserver extends Observer {
 }
 
 /**
- * Fired when selection has changed. This event is fired only when the selection change was the only change that happened
- * in the document, and old selection is different then the new selection.
+ * Fired when a selection has changed. This event is fired only when the selection change was the only change that happened
+ * in the document, and the old selection is different then the new selection.
  *
  * Introduced by {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
  *

+ 3 - 3
packages/ckeditor5-link/src/autolink.js

@@ -14,7 +14,7 @@ import { addLinkProtocolIfApplicable } from './utils';
 
 const MIN_LINK_LENGTH_WITH_SPACE_AT_END = 4; // Ie: "t.co " (length 5).
 
-// This was tweak from https://gist.github.com/dperini/729294.
+// This was a tweak from https://gist.github.com/dperini/729294.
 const URL_REG_EXP = new RegExp(
 	// Group 1: Line start or after a space.
 	'(^|\\s)' +
@@ -95,12 +95,12 @@ export default class AutoLink extends Plugin {
 		const editor = this.editor;
 
 		const watcher = new TextWatcher( editor.model, text => {
-			// 1. Detect "Space" after a text with a potential link.
+			// 1. Detect <kbd>Space</kbd> after a text with a potential link.
 			if ( !isSingleSpaceAtTheEnd( text ) ) {
 				return;
 			}
 
-			// 2. Check text before last typed "Space".
+			// 2. Check text before last typed <kbd>Space</kbd>.
 			const url = getUrlAtTextEnd( text.substr( 0, text.length - 1 ) );
 
 			if ( url ) {