Browse Source

API docs fixes.

Maciek 9 years ago
parent
commit
e74a74060d

+ 9 - 5
packages/ckeditor5-link/src/findlinkrange.js

@@ -3,16 +3,20 @@
  * For licensing, see LICENSE.md.
  */
 
+/**
+ * @module link/findlinkrange
+ */
+
 import Range from '../engine/model/range.js';
 import Position from '../engine/model/position.js';
 
 /**
  * Walk backward and forward from start position, node by node as long as they have the same `linkHref` attribute value and return
- * {@link engine.model.Range Range} with found link.
+ * {@link module:engine/model/range~Range Range} with found link.
  *
- * @param {engine.model.Position} position Start position.
+ * @param {module:engine/model/position~Position} position Start position.
  * @param {String} value `linkHref` attribute value.
- * @returns {engine.model.Range} Link range.
+ * @returns {module:engine/model/range~Range} Link range.
  */
 export default function findLinkRange( position, value ) {
 	return new Range( _findBound( position, value, true ), _findBound( position, value, false ) );
@@ -21,10 +25,10 @@ export default function findLinkRange( position, value ) {
 // 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.
 //
-// @param {engine.model.Position} position Start position.
+// @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 {engine.model.Position} Position just before last matched node.
+// @returns {module:engine/model/position~Position} Position just before 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.

+ 19 - 16
packages/ckeditor5-link/src/link.js

@@ -3,6 +3,10 @@
  * For licensing, see LICENSE.md.
  */
 
+/**
+ * @module link/link
+ */
+
 import Plugin from '../core/plugin.js';
 import ClickObserver from '../engine/view/observer/clickobserver.js';
 import LinkEngine from './linkengine.js';
@@ -19,10 +23,9 @@ import LinkFormView from './ui/linkformview.js';
 /**
  * The link feature. It introduces the Link and Unlink buttons and the <kbd>Ctrl+K</kbd> keystroke.
  *
- * It uses the {@link link.LinkEngine link engine feature}.
+ * It uses the {@link module:link/linkengine~LinkEngine link engine feature}.
  *
- * @memberOf link
- * @extends core.Plugin
+ * @extends module:core/plugin~Plugin
  */
 export default class Link extends Plugin {
 	/**
@@ -41,14 +44,14 @@ export default class Link extends Plugin {
 		/**
 		 * Balloon panel view to display the main UI.
 		 *
-		 * @member {link.ui.LinkBalloonPanelView} link.Link#balloonPanelView
+		 * @member {module:link/ui/balloonpanel~BalloonPanelView}
 		 */
 		this.balloonPanelView = this._createBalloonPanel();
 
 		/**
-		 * The form view inside {@link link.Link#balloonPanelView}.
+		 * The form view inside {@link #balloonPanelView}.
 		 *
-		 * @member {link.ui.LinkFormView} link.Link#formView
+		 * @member {module:link/ui/linkformview~LinkFormView}
 		 */
 		this.formView = this._createForm();
 
@@ -59,7 +62,7 @@ export default class Link extends Plugin {
 
 	/**
 	 * Creates a toolbar link button. Clicking this button will show
-	 * {@link link.Link#balloonPanelView} attached to the selection.
+	 * {@link #balloonPanelView} attached to the selection.
 	 *
 	 * @private
 	 */
@@ -118,10 +121,10 @@ export default class Link extends Plugin {
 	}
 
 	/**
-	 * Creates the {@link link.ui.LinkBalloonPanel} instance.
+	 * Creates the {@link module:ui/balloonpanel/balloonpanelview~BalloonPanelView} instance.
 	 *
 	 * @private
-	 * @returns {link.ui.LinkBalloonPanel} Link balloon panel instance.
+	 * @returns {module:ui/balloonpanel/balloonpanelview~BalloonPanelView} Link balloon panel instance.
 	 */
 	_createBalloonPanel() {
 		const editor = this.editor;
@@ -180,10 +183,10 @@ export default class Link extends Plugin {
 	}
 
 	/**
-	 * Creates the {@link link.ui.LinkForm} instance.
+	 * Creates the {@link module:link/ui/linkformview~LinkFormView} instance.
 	 *
 	 * @private
-	 * @returns {link.ui.LinkForm} Link form instance.
+	 * @returns {module:link/ui/linkformview~LinkFormView} Link form instance.
 	 */
 	_createForm() {
 		const editor = this.editor;
@@ -212,12 +215,12 @@ export default class Link extends Plugin {
 	}
 
 	/**
-	 * Shows {@link link.Link#balloonPanel LinkBalloonPanel} and attach to target element.
+	 * Shows {@link #balloonPanelView link balloon panel} and attach to target element.
 	 * If selection is collapsed and is placed inside link element, then panel will be attached
 	 * to whole link element, otherwise will be attached to the selection.
 	 *
 	 * @private
-	 * @param {link.LinkElement} [parentLink] Target element.
+	 * @param {module:link/linkelement~LinkElement} [parentLink] Target element.
 	 */
 	_attachPanelToElement( parentLink ) {
 		const viewDocument = this.editor.editing.view;
@@ -241,7 +244,7 @@ export default class Link extends Plugin {
 	}
 
 	/**
-	 * Hides {@link link.Link#balloonPanel LinkBalloonPanel}.
+	 * Hides {@link #balloonPanelView balloon panel view}.
 	 *
 	 * @private
 	 * @param {Boolean} [focusEditable=false] When `true` then editable focus will be restored on panel hide.
@@ -255,7 +258,7 @@ export default class Link extends Plugin {
 	}
 
 	/**
-	 * Shows {@link link.Link#balloonPanel LinkBalloonPanel}.
+	 * Shows {@link #balloonPanelView balloon panel view}.
 	 *
 	 * @private
 	 */
@@ -270,7 +273,7 @@ export default class Link extends Plugin {
 //
 // @private
 // @param {engine.view.Position} position
-// @returns {link.LinkElement|null}
+// @returns {module:link/linkelement~LinkElement|null}
 function getPositionParentLink( position ) {
 	return position.parent.getAncestors().find( ( ancestor ) => ancestor instanceof LinkElement );
 }

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

@@ -3,6 +3,10 @@
  * For licensing, see LICENSE.md.
  */
 
+/**
+ * @module link/linkcommand
+ */
+
 import Command from '../core/command/command.js';
 import Text from '../engine/model/text.js';
 import Range from '../engine/model/range.js';
@@ -11,15 +15,14 @@ import isAttributeAllowedInSelection from '../core/command/helpers/isattributeal
 import findLinkRange from './findlinkrange.js';
 
 /**
- * The link command. It is used by the {@link Link.Link link feature}.
+ * The link command. It is used by the {@link module:link/link~Link link feature}.
  *
- * @memberOf link
- * @extends core.command.Command
+ * @extends module:core/command/command~Command
  */
 export default class LinkCommand extends Command {
 	/**
-	 * @see core.command.Command
-	 * @param {core.editor.Editor} editor
+	 * @see module:core/command/command~Command
+	 * @param {module:core/editor/editor~Editor} editor
 	 */
 	constructor( editor ) {
 		super( editor );
@@ -28,7 +31,7 @@ export default class LinkCommand extends Command {
 		 * Currently selected `linkHref` attribute value.
 		 *
 		 * @observable
-		 * @member {Boolean} core.command.ToggleAttributeCommand#value
+		 * @member {Boolean} module:core/command/toggleattributecommand~ToggleAttributeCommand#value
 		 */
 		this.set( 'value', undefined );
 
@@ -38,7 +41,8 @@ export default class LinkCommand extends Command {
 	}
 
 	/**
-	 * Checks if {@link engine.model.Document#schema} allows to create attribute in {@link engine.model.Document#selection}
+	 * Checks if {@link module:engine/model/document~Document#schema} allows to create attribute in {@link
+	 * module:engine/model/document~Document#selection}
 	 *
 	 * @protected
 	 * @returns {Boolean}
@@ -55,7 +59,8 @@ export default class LinkCommand extends 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 selection is collapsed and is not inside text with `linkHref` attribute, then new {@link engine.model.Text Text node} with
+	 * 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.
 	 *

+ 6 - 3
packages/ckeditor5-link/src/linkelement.js

@@ -3,15 +3,18 @@
  * For licensing, see LICENSE.md.
  */
 
+/**
+ * @module link/linkelement
+ */
+
 import AttributeElement from '../engine/view/attributeelement.js';
 
 /**
- * This class is to mark specific {@link engine.view.Node} as {@link link.LinkElement}.
+ * 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,
  * and hence they must be identified somehow.
  *
- * @memberOf link
- * @extends engine.view.AttributeElement
+ * @extends module:engine/view/attributelement~AttributeElement
  */
 export default class LinkElement extends AttributeElement {
 }

+ 5 - 2
packages/ckeditor5-link/src/linkengine.js

@@ -3,6 +3,10 @@
  * For licensing, see LICENSE.md.
  */
 
+/**
+ * @module link/linkengine
+ */
+
 import Plugin from '../core/plugin.js';
 import buildModelConverter from '../engine/conversion/buildmodelconverter.js';
 import buildViewConverter from '../engine/conversion/buildviewconverter.js';
@@ -15,8 +19,7 @@ import UnlinkCommand from './unlinkcommand.js';
  *
  * It introduces the `linkHref="url"` attribute in the model which renders to the view as a `<a href="url">` element.
  *
- * @memberOf link
- * @extends core.Plugin
+ * @extends module:core/plugin~Plugin
  */
 export default class LinkEngine extends Plugin {
 	/**

+ 18 - 15
packages/ckeditor5-link/src/ui/linkformview.js

@@ -3,6 +3,10 @@
  * For licensing, see LICENSE.md.
  */
 
+/**
+ * @module link/ui/linkformview
+ */
+
 import View from '../../ui/view.js';
 import Template from '../../ui/template.js';
 
@@ -15,10 +19,9 @@ import submitHandler from '../../ui/bindings/submithandler.js';
 /**
  * The link form view controller class.
  *
- * See {@link link.ui.LinkForm}.
+ * See {@link module:link/ui/linkformview~LinkFormView}.
  *
- * @memberOf link.ui
- * @extends ui.View
+ * @extends module:ui/view~View
  */
 export default class LinkFormView extends View {
 	/**
@@ -30,14 +33,14 @@ export default class LinkFormView extends View {
 		/**
 		 * The url input view.
 		 *
-		 * @member {ui.input.labeled.LabeledInputView} link.ui.LinkFormView#urlInputView
+		 * @member {ui.input.labeled.LabeledInputView}
 		 */
 		this.urlInputView = this._createUrlInput();
 
 		/**
 		 * The save button view.
 		 *
-		 * @member {ui.button.ButtonView} link.ui.LinkFormView#saveButtonView
+		 * @member {module:ui/button/buttonview~ButtonView}
 		 */
 		this.saveButtonView = this._createButton( 'Save' );
 		this.saveButtonView.type = 'submit';
@@ -45,14 +48,14 @@ export default class LinkFormView extends View {
 		/**
 		 * The cancel button view.
 		 *
-		 * @member {ui.button.ButtonView} link.ui.LinkFormView#cancelButtonView
+		 * @member {module:ui/button/buttonview~ButtonView}
 		 */
 		this.cancelButtonView = this._createButton( 'Cancel', 'cancel' );
 
 		/**
 		 * The unlink button view.
 		 *
-		 * @member {ui.button.ButtonView} link.ui.LinkFormView#unlinkButtonView
+		 * @member {module:ui/button/buttonview~ButtonView}
 		 */
 		this.unlinkButtonView = this._createButton( 'Unlink', 'unlink' );
 
@@ -105,7 +108,7 @@ export default class LinkFormView extends View {
 	 * Create labeled input view.
 	 *
 	 * @private
-	 * @returns {ui.labeled.LabeledInputView} Labeled input view instance.
+	 * @returns {module:ui/labeled/labeledinputview~LabeledInputView} Labeled input view instance.
 	 */
 	_createUrlInput() {
 		const t = this.locale.t;
@@ -123,7 +126,7 @@ export default class LinkFormView extends View {
 	 * @private
 	 * @param {String} label Button label
 	 * @param {String} [eventName] Event name which ButtonView#execute event will be delegated to.
-	 * @returns {ui.button.ButtonView} Button view instance.
+	 * @returns {module:ui/button/buttonview~ButtonView} Button view instance.
 	 */
 	_createButton( label, eventName ) {
 		const t = this.locale.t;
@@ -142,19 +145,19 @@ 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 link.ui.LinkFormView#saveButtonView}.
+ * E.g. click on {@link #saveButtonView}.
  *
- * @event link.ui.LinkFormView#submit
+ * @event submit
  */
 
 /**
- * Fired when the form view is canceled, e.g. click on {@link link.ui.LinkFormView#cancelButtonView}.
+ * Fired when the form view is canceled, e.g. click on {@link #cancelButtonView}.
  *
- * @event link.ui.LinkFormView#cancel
+ * @event cancel
  */
 
 /**
- * Fired when the {@link link.ui.LinkFormView#unlinkButtonView} is clicked.
+ * Fired when the {@link #unlinkButtonView} is clicked.
  *
- * @event link.ui.LinkFormView#unlink
+ * @event unlink
  */

+ 8 - 5
packages/ckeditor5-link/src/unlinkcommand.js

@@ -3,19 +3,22 @@
  * For licensing, see LICENSE.md.
  */
 
+/**
+ * @module link/unlinkcommand
+ */
+
 import Command from '../core/command/command.js';
 import findLinkRange from './findlinkrange.js';
 
 /**
- * The unlink command. It is used by the {@link Link.Link link plugin}.
+ * The unlink command. It is used by the {@link module:link/link~Link link plugin}.
  *
- * @memberOf link
- * @extends core.command.Command
+ * @extends module:core/command/command~Command
  */
 export default class UnlinkCommand extends Command {
 	/**
-	 * @see core.command.Command
-	 * @param {core.editor.Editor} editor
+	 * @see module:core/command/command~Command
+	 * @param {module:core/editor/editor~Editor} editor
 	 */
 	constructor( editor ) {
 		super( editor );