Piotrek Koszuliński 9 anni fa
parent
commit
bbf8a569d6

+ 4 - 4
packages/ckeditor5-engine/src/collection.js

@@ -74,7 +74,7 @@ export default class Collection {
 	 * @param {Object} item
 	 * @param {Number} [index] The position of the item in the collection. The item
 	 * is pushed to the collection when `index` not specified.
-	 * @fires {@link core.Collection.add add}
+	 * @fires core.Collection#add
 	 */
 	add( item, index ) {
 		let itemId;
@@ -156,7 +156,7 @@ export default class Collection {
 	 *
 	 * @param {Object|Number|String} subject The item to remove, its id or index in the collection.
 	 * @returns {Object} The removed item.
-	 * @fires {@link core.Collection.remove remove}
+	 * @fires core.Collection#remove
 	 */
 	remove( subject ) {
 		let index, id, item;
@@ -270,13 +270,13 @@ utils.mix( Collection, EmitterMixin );
 /**
  * Fired when an item is added to the collection.
  *
- * @event core.Collection.add
+ * @event core.Collection#add
  * @param {Object} item The added item.
  */
 
 /**
  * Fired when an item is removed from the collection.
  *
- * @event core.Collection.remove
+ * @event core.Collection#remove
  * @param {Object} item The removed item.
  */

+ 8 - 8
packages/ckeditor5-engine/src/editor.js

@@ -24,9 +24,10 @@ export default class Editor {
 	 * Creates a new instance of the Editor class.
 	 *
 	 * This constructor should be rarely used. When creating new editor instance use instead the
-	 * {@link CKEDITOR#create CKEDITOR.create() method}.
+	 * {@link CKEDITOR#create `CKEDITOR.create()` method}.
 	 *
 	 * @param {HTMLElement} element The DOM element that will be the source for the created editor.
+	 * @param {Object} config The editor config.
 	 */
 	constructor( element, config ) {
 		/**
@@ -34,7 +35,7 @@ export default class Editor {
 		 * editor creation and is not subject to be modified.
 		 *
 		 * @readonly
-		 * @member {HTMLElement}
+		 * @member {HTMLElement} core.Editor#element
 		 */
 		this.element = element;
 
@@ -46,7 +47,7 @@ export default class Editor {
 		 * instance itself.
 		 *
 		 * @readonly
-		 * @member {Config}
+		 * @member {core.Config} core.Editor#config
 		 */
 		this.config = config = new EditorConfig( config );
 
@@ -54,7 +55,7 @@ export default class Editor {
 		 * The plugins loaded and in use by this editor instance.
 		 *
 		 * @readonly
-		 * @member {PluginCollection}
+		 * @member {core.PluginCollection} core.Editor#plugins
 		 */
 		this.plugins = new PluginCollection( this );
 
@@ -68,7 +69,7 @@ export default class Editor {
 		 * Shorthand for {@link core.Locale#t}.
 		 *
 		 * @see core.Locale#t
-		 * @method t
+		 * @method core.Editor#t
 		 */
 		this.t = this.locale.t;
 
@@ -146,7 +147,7 @@ export default class Editor {
 	 * Destroys the editor instance, releasing all resources used by it. If the editor replaced an element, the
 	 * element will be recovered.
 	 *
-	 * @fires {@link core.Editor.destroy destroy}
+	 * @fires core.Editor#destroy
 	 * @returns {Promise} A promise that resolves once the editor instance is fully destroyed.
 	 */
 	destroy() {
@@ -179,8 +180,7 @@ utils.mix( Editor, ObservableMixin );
  * Fired when this editor instance is destroyed. The editor at this point is not usable and this event should be used to
  * perform the clean-up in any plugin.
  *
- * @memberOf core.Editor
- * @event destroy
+ * @event core.Editor#destroy
  */
 
 /**

+ 1 - 1
packages/ckeditor5-engine/src/locale.js

@@ -40,7 +40,7 @@ export default class Locale {
 		 *		const t = this.t;
 		 *		t( 'Label' );
 		 *
-		 * @method t
+		 * @method core.Locale#t
 		 * @param {String} str The string to translate.
 		 * @param {String[]} values Values that should be used to interpolate the string.
 		 */

+ 10 - 8
packages/ckeditor5-engine/src/log.js

@@ -3,7 +3,7 @@
  * For licensing, see LICENSE.md.
  */
 
-/* globals console */
+/* global console */
 
 'use strict';
 
@@ -15,19 +15,21 @@
  * code size of a minified CKEditor package. During minification process the messages will be shortened and
  * links to their documentation will be logged to the console.
  *
- * All errors and warning should be documented in the following way (note that block comment should be used instead of `//`):
+ * All errors and warning should be documented in the following way:
  *
- *		// Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.
- *		//
- *		// @error plugin-load
- *		// @param pluginName The name of the plugin that could not be loaded.
- *		// @param moduleName The name of the module which tried to load this plugin.
+ *		/**
+ *		 * Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.
+ *		 *
+ *		 * @error plugin-load
+ *		 * @param pluginName The name of the plugin that could not be loaded.
+ *		 * @param moduleName The name of the module which tried to load this plugin.
+ *		 * /
  *		log.error( 'plugin-load: It was not possible to load the "{$pluginName}" plugin in module "{$moduleName}', {
  *			pluginName: 'foo',
  *			moduleName: 'bar'
  *		} );
  *
- * ## Warning vs Error vs Throw
+ * ### Warning vs Error vs Throw
  *
  * * Whenever a potentially incorrect situation occurs, which does not directly lead to an incorrect behavior,
  * log a warning.

+ 2 - 2
packages/ckeditor5-engine/src/observablemixin.js

@@ -638,7 +638,7 @@ extend( ObservableMixin, EmitterMixin );
 /**
  * Fired when an attribute changed value.
  *
- * @event change
+ * @event core.ObservableMixin#change
  * @param {String} name The attribute name.
  * @param {*} value The new attribute value.
  * @param {*} oldValue The previous attribute value.
@@ -647,7 +647,7 @@ extend( ObservableMixin, EmitterMixin );
 /**
  * Fired when an specific attribute changed value.
  *
- * @event change:{attribute}
+ * @event core.ObservableMixin#change:{attribute}
  * @param {*} value The new attribute value.
  * @param {*} oldValue The previous attribute value.
  */

+ 13 - 13
packages/ckeditor5-engine/src/treemodel/document.js

@@ -198,26 +198,26 @@ export default class Document {
 	 *
 	 * There are 5 types of change:
 	 *
-	 * * 'insert' when nodes are inserted,
-	 * * 'remove' when nodes are removed,
-	 * * 'reinsert' when remove is undone,
-	 * * 'move' when nodes are moved,
-	 * * 'attribute' when attributes change. TODO attribute
+	 * * `'insert'` when nodes are inserted,
+	 * * `'remove'` when nodes are removed,
+	 * * `'reinsert'` when remove is undone,
+	 * * `'move'` when nodes are moved,
+	 * * `'attribute'` when attributes change. TODO attribute
 	 *
 	 * Change event is fired after the change is done. This means that any ranges or positions passed in
 	 * `changeInfo` are referencing nodes and paths in updated tree model.
 	 *
-	 * @event core.treeModel.Document.change
-	 * @param {String} type Change type, possible option: 'insert', 'remove', 'reinsert', 'move', 'attribute'.
+	 * @event core.treeModel.Document#change
+	 * @param {String} type Change type, possible option: `'insert'`, `'remove'`, `'reinsert'`, `'move'`, `'attribute'`.
 	 * @param {Object} changeInfo Additional information about the change.
-	 * @param {core.treeModel.Range} changeInfo.range Range containing changed nodes. Note that for 'remove' the range will be in the
+	 * @param {core.treeModel.Range} changeInfo.range Range containing changed nodes. Note that for `'remove'` the range will be in the
 	 * {@link core.treeModel.Document#graveyard graveyard root}.
-	 * @param {core.treeModel.Position} [changeInfo.sourcePosition] Change source position. Exists for 'remove', 'reinsert' and 'move'.
+	 * @param {core.treeModel.Position} [changeInfo.sourcePosition] Change source position. Exists for `'remove'`, `'reinsert'` and `'move'`.
 	 * Note that for 'reinsert' the source position will be in the {@link core.treeModel.Document#graveyard graveyard root}.
-	 * @param {String} [changeInfo.key] Only for 'attribute' type. Key of changed / inserted / removed attribute.
-	 * @param {*} [changeInfo.oldValue] Only for 'attribute' type. If the type is 'attribute' and `oldValue`
+	 * @param {String} [changeInfo.key] Only for `'attribute'` type. Key of changed / inserted / removed attribute.
+	 * @param {*} [changeInfo.oldValue] Only for `'attribute'` type. If the type is `'attribute'` and `oldValue`
 	 * is `undefined` it means that new attribute was inserted. Otherwise it contains changed or removed attribute value.
-	 * @param {*} [changeInfo.newValue] Only for 'attribute' type. If the type is 'attribute' and `newValue`
+	 * @param {*} [changeInfo.newValue] Only for `'attribute'` type. If the type is `'attribute'` and `newValue`
 	 * is `undefined` it means that attribute was removed. Otherwise it contains changed or inserted attribute value.
 	 * @param {core.treeModel.Batch} batch A {@link core.treeModel.Batch batch} of changes which this change is a part of.
 	 */
@@ -225,7 +225,7 @@ export default class Document {
 	/**
 	 * Fired when all queued document changes are done. See {@link core.treeModel.Document#enqueueChanges}.
 	 *
-	 * @event core.treeModel.Document.changesDone
+	 * @event core.treeModel.Document#changesDone
 	 */
 }
 

+ 2 - 1
packages/ckeditor5-engine/src/treemodel/nodelist.js

@@ -16,6 +16,7 @@ import CKEditorError from '../ckeditorerror.js';
  *
  * @protected
  * @memberOf core.treeModel
+ * @extends core.treeModel.Text
  */
 class NodeListText extends Text {
 	/**
@@ -353,8 +354,8 @@ export default class NodeList {
 	 * to split text objects whenever there are some changes made on a part of text object (i.e. removing part of text,
 	 * inserting between text object, changing attributes of part of a text object).
 	 *
-	 * @param {Number} index Index in the node list at which node should be broken.
 	 * @protected
+	 * @param {Number} index Index in the node list at which node should be broken.
 	 */
 	_splitNodeAt( index ) {
 		if ( this._indexMap[ index ] != this._indexMap[ index - 1 ] || this._indexMap.length === 0 ) {

+ 1 - 1
packages/ckeditor5-engine/src/treemodel/textfragment.js

@@ -23,9 +23,9 @@ export default class TextFragment {
 	/**
 	 * Creates a text fragment.
 	 *
+	 * @protected
 	 * @param {core.treeModel.CharacterProxy} firstCharacter First character node contained in {@link core.treeModel.TextFragment}.
 	 * @param {Number} length Whole text contained in {@link core.treeModel.TextFragment}.
-	 * @protected
 	 * @constructor
 	 */
 	constructor( firstCharacter, length ) {

+ 8 - 11
packages/ckeditor5-engine/src/treeview/element.js

@@ -21,9 +21,9 @@ export default class Element extends Node {
 	 *
 	 * Attributes can be passes in various formats:
 	 *
-	 *        new Element( 'div', { 'class': 'editor', 'contentEditable': 'true' } ); // object
-	 *        new Element( 'div', [ [ 'class', 'editor' ], [ 'contentEditable', 'true' ] ] ); // map-like iterator
-	 *        new Element( 'div', mapOfAttributes ); // map
+	 *		new Element( 'div', { 'class': 'editor', 'contentEditable': 'true' } ); // object
+	 *		new Element( 'div', [ [ 'class', 'editor' ], [ 'contentEditable', 'true' ] ] ); // map-like iterator
+	 *		new Element( 'div', mapOfAttributes ); // map
 	 *
 	 * @param {String} name Node name.
 	 * @param {Object|Iterable} [attrs] Collection of attributes.
@@ -70,7 +70,7 @@ export default class Element extends Node {
 	 * the parent of these nodes to this element.
 	 *
 	 * @param {core.treeView.Node|Iterable.<core.treeView.Node>} nodes Node or the list of nodes to be inserted.
-	 * @fires {@link core.treeView.Node#change change event}
+	 * @fires core.treeView.Node#change
 	 */
 	appendChildren( nodes ) {
 		this.insertChildren( this.getChildCount(), nodes );
@@ -146,10 +146,9 @@ export default class Element extends Node {
 	/**
 	 * Adds or overwrite attribute with a specified key and value.
 	 *
-	 *
 	 * @param {String} key Attribute key.
 	 * @param {String} value Attribute value.
-	 * @fires {@link core.treeView.Node#change change event}
+	 * @fires core.treeView.Node#change
 	 */
 	setAttribute( key, value ) {
 		this._fireChange( 'ATTRIBUTES', this );
@@ -161,10 +160,9 @@ export default class Element extends Node {
 	 * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to
 	 * this element.
 	 *
-	 *
 	 * @param {Number} index Position where nodes should be inserted.
 	 * @param {core.treeView.Node|Iterable.<core.treeView.Node>} nodes Node or the list of nodes to be inserted.
-	 * @fires {@link core.treeView.Node#change change event}.
+	 * @fires core.treeView.Node#change
 	 */
 	insertChildren( index, nodes ) {
 		this._fireChange( 'CHILDREN', this );
@@ -186,7 +184,7 @@ export default class Element extends Node {
 	 *
 	 * @param {String} key Attribute key.
 	 * @returns {Boolean} Returns true if an attribute existed and has been removed.
-	 * @fires {@link core.treeView.Node#change change event}
+	 * @fires core.treeView.Node#change
 	 */
 	removeAttribute( key ) {
 		this._fireChange( 'ATTRIBUTES', this );
@@ -197,11 +195,10 @@ export default class Element extends Node {
 	/**
 	 * Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.
 	 *
-	 *
 	 * @param {Number} index Number of the first node to remove.
 	 * @param {Number} number Number of nodes to remove.
 	 * @returns {Array.<core.treeView.Node>} The array of removed nodes.
-	 * @fires {@link core.treeView.Node#change change event}
+	 * @fires core.treeView.Node#change
 	 */
 	removeChildren( index, number ) {
 		this._fireChange( 'CHILDREN', this );

+ 1 - 1
packages/ckeditor5-engine/src/treeview/node.js

@@ -118,7 +118,7 @@ export default class Node {
 	/**
 	 * @param {core.treeView.ChangeType} type Type of the change.
 	 * @param {core.treeView.Node} node Changed node.
-	 * @fires {@link core.treeView.Node#change change event}.
+	 * @fires core.treeView.Node#change
 	 */
 	_fireChange( type, node ) {
 		this.fire( 'change', type, node );

+ 2 - 4
packages/ckeditor5-engine/src/treeview/observer/mutationobserver.js

@@ -101,8 +101,8 @@ export default class MutationObserver extends Observer {
 	/**
 	 * Handles mutations. Deduplicates, mark view elements to sync, fire event and call render.
 	 *
-	 * @method core.treeView.observer.MutationObserver#_onMutations
 	 * @protected
+	 * @method core.treeView.observer.MutationObserver#_onMutations
 	 * @param {Array.<Object>} domMutations Array of native mutations.
 	 */
 	_onMutations( domMutations ) {
@@ -183,9 +183,7 @@ export default class MutationObserver extends Observer {
  * Fired when mutation occurred. If tree view is not changed on this event, DOM will be reverter to the state before
  * mutation, so all changes which should be applied, should be handled on this event.
  *
- * @event mutations
- * @memberOf core.treeView.TreeView
- *
+ * @event core.treeView.TreeView#mutations
  * @param {Array.<core.treeView.TreeView~MutatatedText|core.treeView.TreeView~MutatatedChildren>} viewMutations
  * Array of mutations.
  * For mutated texts it will be {@link core.treeView.TreeView~MutatatedText} and for mutated elements it will be

+ 4 - 4
packages/ckeditor5-engine/src/ui/controllercollection.js

@@ -11,8 +11,8 @@ import CKEditorError from '../ckeditorerror.js';
 /**
  * Manages UI Controllers.
  *
- * @class ControllerCollection
- * @extends Collection
+ * @memberOf core.ui
+ * @extends core.Collection
  */
 export default class ControllerCollection extends Collection {
 	/**
@@ -33,14 +33,14 @@ export default class ControllerCollection extends Collection {
 		/**
 		 * Name of this collection.
 		 *
-		 * @type {String}
+		 * @member {String} core.ui.ControllerCollection#name
 		 */
 		this.name = name;
 
 		/**
 		 * Parent controller of this collection.
 		 *
-		 * @type {core.ui.Controller}
+		 * @member {core.ui.Controller} core.ui.ControllerCollection#parent
 		 */
 		this.parent = null;
 	}

+ 1 - 1
packages/ckeditor5-engine/src/ui/view.js

@@ -49,7 +49,7 @@ export default class View {
 		 * Note: If locale instance hasn't been passed to the view this method may not be available.
 		 *
 		 * @see core.Locale#t
-		 * @method t
+		 * @method core.ui.View#t
 		 */
 		this.t = locale && locale.t;
 

+ 7 - 7
packages/ckeditor5-engine/src/utils.js

@@ -16,7 +16,7 @@ const utils = {
 	 *
 	 * The following are the present features:
 	 *
-	 *  * spy.called: property set to `true` if the function has been called at least once.
+	 * * spy.called: property set to `true` if the function has been called at least once.
 	 *
 	 * @memberOf core.utils
 	 * @returns {Function} The spy function.
@@ -60,11 +60,11 @@ const utils = {
 	 * a flag specifying the relation is returned. Flags are negative numbers, so whenever a number >= 0 is returned
 	 * it means that arrays differ.
 	 *
-	 *   compareArrays( [ 0, 2 ], [ 0, 2 ] ); // 'SAME'
-	 *   compareArrays( [ 0, 2 ], [ 0, 2, 1 ] ); // 'PREFIX'
-	 *   compareArrays( [ 0, 2 ], [ 0 ] ); // 'EXTENSION'
-	 *   compareArrays( [ 0, 2 ], [ 1, 2 ] ); // 0
-	 *   compareArrays( [ 0, 2 ], [ 0, 1 ] ); // 1
+	 *		compareArrays( [ 0, 2 ], [ 0, 2 ] );		// 'SAME'
+	 *		compareArrays( [ 0, 2 ], [ 0, 2, 1 ] );		// 'PREFIX'
+	 *		compareArrays( [ 0, 2 ], [ 0 ] );			// 'EXTENSION'
+	 *		compareArrays( [ 0, 2 ], [ 1, 2 ] );		// 0
+	 *		compareArrays( [ 0, 2 ], [ 0, 1 ] );		// 1
 	 *
 	 * @memberOf core.utils
 	 * @param {Array} a Array that is compared.
@@ -218,7 +218,7 @@ const utils = {
 
 /**
  * An index at which arrays differ. If arrays are same at all indexes, it represents how arrays are related.
- * In this case, possible values are: 'SAME', 'PREFIX' or 'EXTENSION'.
+ * In this case, possible values are: `'SAME'`, `'PREFIX'` or `'EXTENSION'`.
  *
  * @memberOf core.utils
  * @typedef {String|Number} ArrayRelation