Anna Tomanek пре 8 година
родитељ
комит
e142ed8d93

+ 1 - 1
packages/ckeditor5-link/README.md

@@ -8,7 +8,7 @@ CKEditor 5 link feature
 [![Dependency Status](https://david-dm.org/ckeditor/ckeditor5-link/status.svg)](https://david-dm.org/ckeditor/ckeditor5-link)
 [![devDependency Status](https://david-dm.org/ckeditor/ckeditor5-link/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5-link?type=dev)
 
-Link feature for CKEditor 5. More information about the project can be found at the following URL: <https://github.com/ckeditor/ckeditor5-link>.
+The link feature for CKEditor 5. More information about the project can be found at the following URL: <https://github.com/ckeditor/ckeditor5-link>.
 
 ## License
 

+ 1 - 1
packages/ckeditor5-link/lang/contexts.json

@@ -1,5 +1,5 @@
 {
 	"Unlink": "Toolbar button tooltip for the Unlink feature.",
 	"Link": "Toolbar button tooltip for the Link feature.",
-	"Link URL": "Label for the url input in the Link dialog."
+	"Link URL": "Label for the URL input in the Link dialog."
 }

+ 11 - 11
packages/ckeditor5-link/src/findlinkrange.js

@@ -11,24 +11,24 @@ import Range from '@ckeditor/ckeditor5-engine/src/model/range';
 import Position from '@ckeditor/ckeditor5-engine/src/model/position';
 
 /**
- * Walk backward and forward from start position, node by node as long as they have the same `linkHref` attribute value and return
- * {@link module:engine/model/range~Range Range} with found link.
+ * Walks backward and forward from the start position, node by node, as long as they have the same `linkHref` attribute value and return
+ * a {@link module:engine/model/range~Range Range} with the found link.
  *
- * @param {module:engine/model/position~Position} position Start position.
- * @param {String} value `linkHref` attribute value.
- * @returns {module:engine/model/range~Range} Link range.
+ * @param {module:engine/model/position~Position} position The start position.
+ * @param {String} value The `linkHref` attribute value.
+ * @returns {module:engine/model/range~Range} The link range.
  */
 export default function findLinkRange( position, value ) {
 	return new Range( _findBound( position, value, true ), _findBound( position, value, false ) );
 }
 
-// Walk forward or backward (depends on `lookBack` flag), node by node as long as they have the same `linkHref` attribute value
-// and return position just before or after (depends on `lookBack` flag) last matched node.
+// Walks forward or backward (depends on the `lookBack` flag), node by node, as long as they have the same `linkHref` attribute value
+// and returns a position just before or after (depends on the `lookBack` flag) the last matched node.
 //
-// @param {module:engine/model/position~Position} position Start position.
-// @param {String} value `linkHref` attribute value.
-// @param {Boolean} lookBack Whether walk direction is forward `false` or backward `true`.
-// @returns {module:engine/model/position~Position} Position just before last matched node.
+// @param {module:engine/model/position~Position} position The start position.
+// @param {String} value The `linkHref` attribute value.
+// @param {Boolean} lookBack Whether the walk direction is forward (`false`) or backward (`true`).
+// @returns {module:engine/model/position~Position} The position just before the last matched node.
 function _findBound( position, value, lookBack ) {
 	// Get node before or after position (depends on `lookBack` flag).
 	// When position is inside text node then start searching from text node.

+ 13 - 14
packages/ckeditor5-link/src/link.js

@@ -56,7 +56,7 @@ export default class Link extends Plugin {
 		this.editor.editing.view.addObserver( ClickObserver );
 
 		/**
-		 * The form view displayed inside of the balloon.
+		 * The form view displayed inside the balloon.
 		 *
 		 * @member {module:link/ui/linkformview~LinkFormView}
 		 */
@@ -82,7 +82,7 @@ export default class Link extends Plugin {
 	 * Creates the {@link module:link/ui/linkformview~LinkFormView} instance.
 	 *
 	 * @private
-	 * @returns {module:link/ui/linkformview~LinkFormView} Link form instance.
+	 * @returns {module:link/ui/linkformview~LinkFormView} The link form instance.
 	 */
 	_createForm() {
 		const editor = this.editor;
@@ -122,8 +122,8 @@ export default class Link extends Plugin {
 	}
 
 	/**
-	 * Creates a toolbar link button. Clicking this button will show
-	 * {@link #_balloon} attached to the selection.
+	 * Creates a toolbar Link button. Clicking this button will show
+	 * a {@link #_balloon} attached to the selection.
 	 *
 	 * @private
 	 */
@@ -132,7 +132,7 @@ export default class Link extends Plugin {
 		const linkCommand = editor.commands.get( 'link' );
 		const t = editor.t;
 
-		// Handle `Ctrl+K` keystroke and show the panel.
+		// Handle the `Ctrl+K` keystroke and show the panel.
 		editor.keystrokes.set( linkKeystroke, () => {
 			if ( linkCommand.isEnabled ) {
 				this._showPanel( true );
@@ -159,7 +159,7 @@ export default class Link extends Plugin {
 	}
 
 	/**
-	 * Creates a toolbar unlink button. Clicking this button will unlink
+	 * Creates a toolbar Unlink button. Clicking this button will unlink
 	 * the selected link.
 	 *
 	 * @private
@@ -188,7 +188,7 @@ export default class Link extends Plugin {
 	}
 
 	/**
-	 * Attaches actions which control whether the balloon panel containing the
+	 * Attaches actions that control whether the balloon panel containing the
 	 * {@link #formView} is visible or not.
 	 *
 	 * @private
@@ -234,10 +234,9 @@ export default class Link extends Plugin {
 
 	/**
 	 * Adds the {@link #formView} to the {@link #_balloon}.
-	 * When view is already added then try to focus it `focusInput` parameter is set as true.
 	 *
 	 * @protected
-	 * @param {Boolean} [focusInput=false] When `true`, link form will be focused on panel show.
+	 * @param {Boolean} [focusInput=false] When `true`, the link form will be focused on panel show.
 	 */
 	_showPanel( focusInput ) {
 		const editor = this.editor;
@@ -329,10 +328,10 @@ export default class Link extends Plugin {
 	}
 
 	/**
-	 * Returns positioning options for the {@link #_balloon}. They control the way balloon is attached
+	 * Returns positioning options for the {@link #_balloon}. They control the way the balloon is attached
 	 * to the target element or selection.
 	 *
-	 * If the selection is collapsed and inside a link element, then the panel will be attached to the
+	 * If the selection is collapsed and inside a link element, the panel will be attached to the
 	 * entire link element. Otherwise, it will be attached to the selection.
 	 *
 	 * @private
@@ -356,10 +355,10 @@ export default class Link extends Plugin {
 
 	/**
 	 * Returns the {@link module:link/linkelement~LinkElement} under
-	 * {@link module:engine/view/document~Document editing view's} selection or `null`
-	 * if there's none.
+	 * the {@link module:engine/view/document~Document editing view's} selection or `null`
+	 * if there is none.
 	 *
-	 * **Note**: For non–collapsed selection the `LinkElement` is only returned when **fully**
+	 * **Note**: For a non–collapsed selection the `LinkElement` is only returned when **fully**
 	 * selected and the **only** element within the selection boundaries.
 	 *
 	 * @private

+ 8 - 8
packages/ckeditor5-link/src/linkcommand.js

@@ -19,7 +19,7 @@ import findLinkRange from './findlinkrange';
  */
 export default class LinkCommand extends Command {
 	/**
-	 * The value of `'linkHref'` attribute if the start of a selection is located in a node with this attribute.
+	 * The value of the `'linkHref'` attribute if the start of the selection is located in a node with this attribute.
 	 *
 	 * @observable
 	 * @readonly
@@ -39,15 +39,15 @@ export default class LinkCommand extends Command {
 	/**
 	 * Executes the command.
 	 *
-	 * When selection is non-collapsed, then `linkHref` attribute will be applied to nodes inside selection, but only to
-	 * those nodes where `linkHref` attribute is allowed (disallowed nodes will be omitted).
+	 * When the selection is non-collapsed, the `linkHref` attribute will be applied to nodes inside the selection, but only to
+	 * those nodes where the `linkHref` attribute is allowed (disallowed nodes will be omitted).
 	 *
-	 * When selection is collapsed and is not inside text with `linkHref` attribute, then
-	 * new {@link module:engine/model/text~Text Text node} with `linkHref` attribute will be inserted in place of caret, but only if such
-	 * an element is allowed in this place. `_data` of the inserted text will equal `href` parameter. Selection will be updated to
-	 * wrap just inserted text node.
+	 * When the selection is collapsed and is not inside the text with the `linkHref` attribute, the
+	 * new {@link module:engine/model/text~Text Text node} with the `linkHref` attribute will be inserted in place of caret, but
+	 * only if such element is allowed in this place. The `_data` of the inserted text will equal the `href` parameter.
+	 * The selection will be updated to wrap the just inserted text node.
 	 *
-	 * When selection is collapsed and inside text with `linkHref` attribute, the attribute value will be updated.
+	 * When the selection is collapsed and inside the text with the `linkHref` attribute, the attribute value will be updated.
 	 *
 	 * @fires execute
 	 * @param {String} href Link destination.

+ 2 - 2
packages/ckeditor5-link/src/linkelement.js

@@ -10,8 +10,8 @@
 import AttributeElement from '@ckeditor/ckeditor5-engine/src/view/attributeelement';
 
 /**
- * This class is to mark specific {@link module:engine/view/node~Node} as {@link module:link/linkelement~LinkElement}.
- * E.g. There could be a situation when different features will create nodes with the same names,
+ * This class is to mark a specific {@link module:engine/view/node~Node} as a {@link module:link/linkelement~LinkElement}.
+ * For example, there could be a situation when different features will create nodes with the same names,
  * and hence they must be identified somehow.
  *
  * @extends module:engine/view/attributelement~AttributeElement

+ 14 - 14
packages/ckeditor5-link/src/ui/linkformview.js

@@ -45,7 +45,7 @@ export default class LinkFormView extends View {
 		this.focusTracker = new FocusTracker();
 
 		/**
-		 * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
+		 * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
 		 *
 		 * @readonly
 		 * @member {module:utils/keystrokehandler~KeystrokeHandler}
@@ -53,14 +53,14 @@ export default class LinkFormView extends View {
 		this.keystrokes = new KeystrokeHandler();
 
 		/**
-		 * The url input view.
+		 * The URL input view.
 		 *
 		 * @member {module:ui/labeledinput/labeledinputview~LabeledInputView}
 		 */
 		this.urlInputView = this._createUrlInput();
 
 		/**
-		 * The save button view.
+		 * The Save button view.
 		 *
 		 * @member {module:ui/button/buttonview~ButtonView}
 		 */
@@ -68,14 +68,14 @@ export default class LinkFormView extends View {
 		this.saveButtonView.type = 'submit';
 
 		/**
-		 * The cancel button view.
+		 * The Cancel button view.
 		 *
 		 * @member {module:ui/button/buttonview~ButtonView}
 		 */
 		this.cancelButtonView = this._createButton( t( 'Cancel' ), 'cancel' );
 
 		/**
-		 * The unlink button view.
+		 * The Unlink button view.
 		 *
 		 * @member {module:ui/button/buttonview~ButtonView}
 		 */
@@ -102,10 +102,10 @@ export default class LinkFormView extends View {
 			focusTracker: this.focusTracker,
 			keystrokeHandler: this.keystrokes,
 			actions: {
-				// Navigate form fields backwards using the shift + tab keystroke.
+				// Navigate form fields backwards using the Shift + Tab keystroke.
 				focusPrevious: 'shift + tab',
 
-				// Navigate form fields forwards using the tab key.
+				// Navigate form fields forwards using the Tab key.
 				focusNext: 'tab'
 			}
 		} );
@@ -188,7 +188,7 @@ export default class LinkFormView extends View {
 	}
 
 	/**
-	 * Create labeled input view.
+	 * Creates a labeled input view.
 	 *
 	 * @private
 	 * @returns {module:ui/labeledinput/labeledinputview~LabeledInputView} Labeled input view instance.
@@ -205,12 +205,12 @@ export default class LinkFormView extends View {
 	}
 
 	/**
-	 * Creates button View.
+	 * Creates a button view.
 	 *
 	 * @private
-	 * @param {String} label Button label
-	 * @param {String} [eventName] Event name which ButtonView#execute event will be delegated to.
-	 * @returns {module:ui/button/buttonview~ButtonView} Button view instance.
+	 * @param {String} label The button label
+	 * @param {String} [eventName] An event name that the `ButtonView#execute` event will be delegated to.
+	 * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
 	 */
 	_createButton( label, eventName ) {
 		const button = new ButtonView( this.locale );
@@ -227,8 +227,8 @@ export default class LinkFormView extends View {
 }
 
 /**
- * Fired when the form view is submitted (when one of the child triggered submit event).
- * E.g. click on {@link #saveButtonView}.
+ * Fired when the form view is submitted (when one of the children triggered the submit event),
+ * e.g. click on {@link #saveButtonView}.
  *
  * @event submit
  */

+ 2 - 2
packages/ckeditor5-link/src/unlinkcommand.js

@@ -26,8 +26,8 @@ export default class UnlinkCommand extends Command {
 	/**
 	 * Executes the command.
 	 *
-	 * When the selection is collapsed, removes `linkHref` attribute from each node with the same `linkHref` attribute value.
-	 * When the selection is non-collapsed, removes `linkHref` from each node in selected ranges.
+	 * When the selection is collapsed, removes the `linkHref` attribute from each node with the same `linkHref` attribute value.
+	 * When the selection is non-collapsed, removes the `linkHref` attribute from each node in selected ranges.
 	 *
 	 * @fires execute
 	 */