Selaa lähdekoodia

Changed document.operations namespace to document.operation.

Piotrek Koszuliński 10 vuotta sitten
vanhempi
commit
5b42601b31

+ 3 - 3
packages/ckeditor5-utils/src/document/document.js

@@ -39,7 +39,7 @@ CKEDITOR.define( [
 
 			/**
 			 * Document version. It starts from `0` and every operation increases the version number. It is used to ensure that
-			 * operations are applied on the proper document version. If the {@link document.operations.Operation#baseVersion} will
+			 * operations are applied on the proper document version. If the {@link document.operation.Operation#baseVersion} will
 			 * not match document version the {@link document-applyOperation-wrong-version} error is thrown.
 			 *
 			 * @readonly
@@ -51,7 +51,7 @@ CKEDITOR.define( [
 		/**
 		 * This is the only entry point for all document changes.
 		 *
-		 * @param {document.operations.Operation} operation Operation to be applied.
+		 * @param {document.operation.Operation} operation Operation to be applied.
 		 */
 		applyOperation( operation ) {
 			if ( operation.baseVersion !== this.version ) {
@@ -59,7 +59,7 @@ CKEDITOR.define( [
 				 * Only operations with matching versions can be applied.
 				 *
 				 * @error document-applyOperation-wrong-version
-				 * @param {document.operations.Operation} op
+				 * @param {document.operation.Operation} op
 				 */
 				throw new CKEditorError(
 					'document-applyOperation-wrong-version: Only operations with matching versions can be applied.',

+ 2 - 2
packages/ckeditor5-utils/src/document/element.js

@@ -51,7 +51,7 @@ CKEDITOR.define( [ 'document/node', 'document/nodelist' ], function( Node, NodeL
 		 * Inserts a list of child nodes on the given index and sets the parent of these nodes to this element.
 		 *
 		 * Note that the list of children can be modified only in elements not yet attached to the document.
-		 * All attached nodes should be modified using the {@link document.operations.InsertOperation}.
+		 * All attached nodes should be modified using the {@link document.operation.InsertOperation}.
 		 *
 		 * @param {Number} index Position where nodes should be inserted.
 		 * @param {document.Node|document.Text|document.NodeList|String|Iterable} nodes The list of nodes to be inserted.
@@ -69,7 +69,7 @@ CKEDITOR.define( [ 'document/node', 'document/nodelist' ], function( Node, NodeL
 		 * Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.
 		 *
 		 * Note that the list of children can be modified only in elements not yet attached to the document.
-		 * All attached nodes should be modified using the {@link document.operations.RemoveOperation}.
+		 * All attached nodes should be modified using the {@link document.operation.RemoveOperation}.
 		 *
 		 * @param {Number} index Position of the first node to remove.
 		 * @param {Number} number Number of nodes to remove.

+ 1 - 1
packages/ckeditor5-utils/src/document/node.js

@@ -33,7 +33,7 @@ CKEDITOR.define( [ 'document/attribute', 'utils' ], function( Attribute, utils )
 			/**
 			 * Attributes set.
 			 *
-			 * Attributes of nodes attached to the document can be changed only be the {@link document.operations.ChangeOperation}.
+			 * Attributes of nodes attached to the document can be changed only be the {@link document.operation.ChangeOperation}.
 			 *
 			 * @private
 			 * @property {Set} _attrs

+ 1 - 1
packages/ckeditor5-utils/src/document/nodelist.js

@@ -13,7 +13,7 @@ CKEDITOR.define( [
 ], function( Character, Text, Node, utils ) {
 	/**
 	 * List of nodes. It is used to represent multiple nodes with a given order, for example children of
-	 * {@link document.Element} object or nodes inserted using {@link document.operations.InsertOperation}.
+	 * {@link document.Element} object or nodes inserted using {@link document.operation.InsertOperation}.
 	 *
 	 * Thanks to the constructor, which accepts various arguments, this class lets you easily create desired list of nodes.
 	 *

+ 2 - 2
packages/ckeditor5-utils/src/document/operations/changeoperation.js

@@ -5,11 +5,11 @@
 
 'use strict';
 
-CKEDITOR.define( [ 'document/operations/operation', 'ckeditorerror' ], function( Operation, CKEditorError ) {
+CKEDITOR.define( [ 'document/operation/operation', 'ckeditorerror' ], function( Operation, CKEditorError ) {
 	/**
 	 * Operation to change nodes' attribute. Using this class you can add, remove or change value of the attribute.
 	 *
-	 * @class document.operations.ChangeOperation
+	 * @class document.operation.ChangeOperation
 	 */
 	class ChangeOperation extends Operation {
 		/**

+ 4 - 4
packages/ckeditor5-utils/src/document/operations/insertoperation.js

@@ -6,14 +6,14 @@
 'use strict';
 
 CKEDITOR.define( [
-	'document/operations/operation',
+	'document/operation/operation',
 	'document/nodelist',
-	'document/operations/removeoperation'
+	'document/operation/removeoperation'
 ], function( Operation, NodeList ) {
 	/**
 	 * Operation to insert list of nodes on the given position in the tree data model.
 	 *
-	 * @class document.operations.InsertOperation
+	 * @class document.operation.InsertOperation
 	 */
 	class InsertOperation extends Operation {
 		/**
@@ -51,7 +51,7 @@ CKEDITOR.define( [
 
 		getReversed() {
 			// Because of circular dependencies we need to re-require remove operation here.
-			var RemoveOperation = CKEDITOR.require( 'document/operations/removeoperation' );
+			var RemoveOperation = CKEDITOR.require( 'document/operation/removeoperation' );
 
 			return new RemoveOperation( this.position, this.nodeList.length, this.baseVersion + 1 );
 		}

+ 2 - 2
packages/ckeditor5-utils/src/document/operations/moveoperation.js

@@ -6,7 +6,7 @@
 'use strict';
 
 CKEDITOR.define( [
-	'document/operations/operation',
+	'document/operation/operation',
 	'document/nodelist',
 	'ckeditorerror',
 	'utils'
@@ -14,7 +14,7 @@ CKEDITOR.define( [
 	/**
 	 * Operation to move list of subsequent nodes from one position in the document to another.
 	 *
-	 * @class document.operations.MoveOperation
+	 * @class document.operation.MoveOperation
 	 */
 	class MoveOperation extends Operation {
 		/**

+ 4 - 4
packages/ckeditor5-utils/src/document/operations/operation.js

@@ -10,7 +10,7 @@ CKEDITOR.define( [], function() {
 	 * Abstract base operation class.
 	 *
 	 * @abstract
-	 * @class document.operations.Operation
+	 * @class document.operation.Operation
 	 */
 	class Operation {
 		/**
@@ -48,7 +48,7 @@ CKEDITOR.define( [], function() {
 			 * {@link #getTransformedBy transform} it by all operations that were executed after the original operation.
 			 *
 			 * @method getReversed
-			 * @returns {document.operations.Operation} Reversed operation.
+			 * @returns {document.operation.Operation} Reversed operation.
 			 */
 
 			/**
@@ -69,8 +69,8 @@ CKEDITOR.define( [], function() {
 			 * operation. This needs to be clarified in this documentation.
 			 *
 			 * @method getTransformedBy
-			 * @param {document.operations.Operation} operation Operation by which this operation will be transformed.
-			 * @returns {document.operations.Operation[]} A result of transformation of this operation by the given operation.
+			 * @param {document.operation.Operation} operation Operation by which this operation will be transformed.
+			 * @returns {document.operation.Operation[]} A result of transformation of this operation by the given operation.
 			 */
 		}
 	}

+ 6 - 6
packages/ckeditor5-utils/src/document/operations/reinsertoperation.js

@@ -6,24 +6,24 @@
 'use strict';
 
 CKEDITOR.define( [
-	'document/operations/moveoperation',
-	'document/operations/removeoperation'
+	'document/operation/moveoperation',
+	'document/operation/removeoperation'
 ], function( MoveOperation ) {
 	/**
 	 * Operation to reinsert previously removed nodes back to the non-graveyard root.
-	 * This is basically {@link document.operations.MoveOperation} but it returns
-	 * {@link document.operations.RemoveOperation} when reversed.
+	 * This is basically {@link document.operation.MoveOperation} but it returns
+	 * {@link document.operation.RemoveOperation} when reversed.
 	 *
 	 * With this class, we achieve two goals: by having separate classes it's easier to distinguish whether move
 	 * operation is actually a remove/reinsert operation and fire proper events. Also it
 	 * will be easier to expand if we need to change operation's behavior if it is remove/reinsert.
 	 *
-	 * @class document.operations.ReinsertOperation
+	 * @class document.operation.ReinsertOperation
 	 */
 	class ReinsertOperation extends MoveOperation {
 		getReversed() {
 			// Because of circular dependencies we need to re-require reinsert operation here.
-			var RemoveOperation = CKEDITOR.require( 'document/operations/removeoperation' );
+			var RemoveOperation = CKEDITOR.require( 'document/operation/removeoperation' );
 
 			return new RemoveOperation( this.targetPosition, this.howMany, this.baseVersion + 1 );
 		}

+ 4 - 4
packages/ckeditor5-utils/src/document/operations/removeoperation.js

@@ -6,14 +6,14 @@
 'use strict';
 
 CKEDITOR.define( [
-	'document/operations/moveoperation',
+	'document/operation/moveoperation',
 	'document/position',
-	'document/operations/reinsertoperation'
+	'document/operation/reinsertoperation'
 ], function( MoveOperation, Position ) {
 	/**
 	 * Operation to remove a range of nodes.
 	 *
-	 * @class document.operations.RemoveOperation
+	 * @class document.operation.RemoveOperation
 	 */
 	class RemoveOperation extends MoveOperation {
 		/**
@@ -35,7 +35,7 @@ CKEDITOR.define( [
 
 		getReversed() {
 			// Because of circular dependencies we need to re-require reinsert operation here.
-			var ReinsertOperation = CKEDITOR.require( 'document/operations/reinsertoperation' );
+			var ReinsertOperation = CKEDITOR.require( 'document/operation/reinsertoperation' );
 
 			return new ReinsertOperation( this.targetPosition, this.sourcePosition, this.howMany, this.baseVersion + 1 );
 		}

+ 2 - 2
packages/ckeditor5-utils/tests/document/operations/changeoperation.js

@@ -9,7 +9,7 @@
 
 var modules = bender.amd.require(
 	'document/document',
-	'document/operations/changeoperation',
+	'document/operation/changeoperation',
 	'document/position',
 	'document/range',
 	'document/character',
@@ -24,7 +24,7 @@ describe( 'ChangeOperation', function() {
 
 	before( function() {
 		Document = modules[ 'document/document' ];
-		ChangeOperation = modules[ 'document/operations/changeoperation' ];
+		ChangeOperation = modules[ 'document/operation/changeoperation' ];
 		Position = modules[ 'document/position' ];
 		Range = modules[ 'document/range' ];
 		Character = modules[ 'document/character' ];

+ 4 - 4
packages/ckeditor5-utils/tests/document/operations/insertoperation.js

@@ -9,8 +9,8 @@
 
 var modules = bender.amd.require(
 	'document/document',
-	'document/operations/insertoperation',
-	'document/operations/removeoperation',
+	'document/operation/insertoperation',
+	'document/operation/removeoperation',
 	'document/position',
 	'document/character',
 	'document/nodelist'
@@ -21,8 +21,8 @@ describe( 'InsertOperation', function() {
 
 	before( function() {
 		Document = modules[ 'document/document' ];
-		InsertOperation = modules[ 'document/operations/insertoperation' ];
-		RemoveOperation = modules[ 'document/operations/removeoperation' ];
+		InsertOperation = modules[ 'document/operation/insertoperation' ];
+		RemoveOperation = modules[ 'document/operation/removeoperation' ];
 		Position = modules[ 'document/position' ];
 		Character = modules[ 'document/character' ];
 	} );

+ 2 - 2
packages/ckeditor5-utils/tests/document/operations/moveoperation.js

@@ -9,7 +9,7 @@
 
 var modules = bender.amd.require(
 	'document/document',
-	'document/operations/moveoperation',
+	'document/operation/moveoperation',
 	'document/position',
 	'document/element',
 	'document/nodelist',
@@ -21,7 +21,7 @@ describe( 'MoveOperation', function() {
 
 	before( function() {
 		Document = modules[ 'document/document' ];
-		MoveOperation = modules[ 'document/operations/moveoperation' ];
+		MoveOperation = modules[ 'document/operation/moveoperation' ];
 		Position = modules[ 'document/position' ];
 		Element = modules[ 'document/element' ];
 		NodeList = modules[ 'document/nodelist' ];

+ 6 - 6
packages/ckeditor5-utils/tests/document/operations/reinsertoperation.js

@@ -9,9 +9,9 @@
 
 var modules = bender.amd.require(
 	'document/document',
-	'document/operations/reinsertoperation',
-	'document/operations/removeoperation',
-	'document/operations/moveoperation',
+	'document/operation/reinsertoperation',
+	'document/operation/removeoperation',
+	'document/operation/moveoperation',
 	'document/position'
 );
 
@@ -20,9 +20,9 @@ describe( 'ReinsertOperation', function() {
 
 	before( function() {
 		Document = modules[ 'document/document' ];
-		ReinsertOperation = modules[ 'document/operations/reinsertoperation' ];
-		RemoveOperation = modules[ 'document/operations/removeoperation' ];
-		MoveOperation = modules[ 'document/operations/moveoperation' ];
+		ReinsertOperation = modules[ 'document/operation/reinsertoperation' ];
+		RemoveOperation = modules[ 'document/operation/removeoperation' ];
+		MoveOperation = modules[ 'document/operation/moveoperation' ];
 		Position = modules[ 'document/position' ];
 	} );
 

+ 6 - 6
packages/ckeditor5-utils/tests/document/operations/removeoperation.js

@@ -9,9 +9,9 @@
 
 var modules = bender.amd.require(
 	'document/document',
-	'document/operations/reinsertoperation',
-	'document/operations/removeoperation',
-	'document/operations/moveoperation',
+	'document/operation/reinsertoperation',
+	'document/operation/removeoperation',
+	'document/operation/moveoperation',
 	'document/position'
 );
 
@@ -20,9 +20,9 @@ describe( 'RemoveOperation', function() {
 
 	before( function() {
 		Document = modules[ 'document/document' ];
-		ReinsertOperation = modules[ 'document/operations/reinsertoperation' ];
-		RemoveOperation = modules[ 'document/operations/removeoperation' ];
-		MoveOperation = modules[ 'document/operations/removeoperation' ];
+		ReinsertOperation = modules[ 'document/operation/reinsertoperation' ];
+		RemoveOperation = modules[ 'document/operation/removeoperation' ];
+		MoveOperation = modules[ 'document/operation/removeoperation' ];
 		Position = modules[ 'document/position' ];
 	} );