Browse Source

Renamed document to doc.

Piotr Jasiun 10 years ago
parent
commit
60086945ae

+ 13 - 13
packages/ckeditor5-utils/src/document/position.js

@@ -17,9 +17,9 @@ CKEDITOR.define( [ 'utils' ], function( utils ) {
 		 * Creates a position.
 		 * Creates a position.
 		 *
 		 *
 		 * @param {Array} path Position path. See {@link #path} property for more information.
 		 * @param {Array} path Position path. See {@link #path} property for more information.
-		 * @param {document.Document} document Document which position refers to.
+		 * @param {document.Document} doc Document which position refers to.
 		 */
 		 */
-		constructor( path, document ) {
+		constructor( path, doc ) {
 			/**
 			/**
 			 * Position of the node it the tree. For example:
 			 * Position of the node it the tree. For example:
 			 *
 			 *
@@ -44,7 +44,7 @@ CKEDITOR.define( [ 'utils' ], function( utils ) {
 			 *
 			 *
 			 * @type {document.Document}
 			 * @type {document.Document}
 			 */
 			 */
-			this.document = document;
+			this.doc = doc;
 		}
 		}
 
 
 		/**
 		/**
@@ -52,42 +52,42 @@ CKEDITOR.define( [ 'utils' ], function( utils ) {
 		 *
 		 *
 		 * @param {document.Element} parent Position parent element.
 		 * @param {document.Element} parent Position parent element.
 		 * @param {Number} offset Position offset.
 		 * @param {Number} offset Position offset.
-		 * @param {document.Document} document Document which position refers to.
+		 * @param {document.Document} doc Document which position refers to.
 		 */
 		 */
-		static makePositionFromParentAndOffset( parent, offset, document ) {
+		static makePositionFromParentAndOffset( parent, offset, doc ) {
 			var path = parent.getPath();
 			var path = parent.getPath();
 
 
 			path.push( offset );
 			path.push( offset );
 
 
-			return new Position( path, document );
+			return new Position( path, doc );
 		}
 		}
 
 
 		/**
 		/**
 		 * Set the position before given node.
 		 * Set the position before given node.
 		 *
 		 *
 		 * @param {document.node} node Node the position should be directly before.
 		 * @param {document.node} node Node the position should be directly before.
-		 * @param {document.Document} document Document which position refers to.
+		 * @param {document.Document} doc Document which position refers to.
 		 */
 		 */
-		static makePositionBefore( node, document ) {
+		static makePositionBefore( node, doc ) {
 			if ( !node.parent ) {
 			if ( !node.parent ) {
 				throw 'You can not make position before root.';
 				throw 'You can not make position before root.';
 			}
 			}
 
 
-			return Position.makePositionFromParentAndOffset( node.parent, node.positionInParent, document );
+			return Position.makePositionFromParentAndOffset( node.parent, node.positionInParent, doc );
 		}
 		}
 
 
 		/**
 		/**
 		 * Set the position after given node.
 		 * Set the position after given node.
 		 *
 		 *
 		 * @param {document.node} node Node the position should be directly after.
 		 * @param {document.node} node Node the position should be directly after.
-		 * @param {document.Document} document Document which position refers to.
+		 * @param {document.Document} doc Document which position refers to.
 		 */
 		 */
-		static makePositionAfter( node, document ) {
+		static makePositionAfter( node, doc ) {
 			if ( !node.parent ) {
 			if ( !node.parent ) {
 				throw 'You can not make position after root.';
 				throw 'You can not make position after root.';
 			}
 			}
 
 
-			return Position.makePositionFromParentAndOffset( node.parent, node.positionInParent + 1, document );
+			return Position.makePositionFromParentAndOffset( node.parent, node.positionInParent + 1, doc );
 		}
 		}
 
 
 		/**
 		/**
@@ -97,7 +97,7 @@ CKEDITOR.define( [ 'utils' ], function( utils ) {
 		 * @property {document.Element} parent
 		 * @property {document.Element} parent
 		 */
 		 */
 		get parent() {
 		get parent() {
-			var parent = this.document.root;
+			var parent = this.doc.root;
 
 
 			var i, len;
 			var i, len;
 
 

+ 6 - 6
packages/ckeditor5-utils/src/document/positioniterator.js

@@ -75,15 +75,15 @@ CKEDITOR.define( [
 			var nodeAfter = position.nodeAfter;
 			var nodeAfter = position.nodeAfter;
 
 
 			if ( nodeAfter instanceof Element ) {
 			if ( nodeAfter instanceof Element ) {
-				this.position = Position.makePositionFromParentAndOffset( nodeAfter, 0, position.document );
+				this.position = Position.makePositionFromParentAndOffset( nodeAfter, 0, position.doc );
 
 
 				return formatReturnValue( OPENING_TAG, nodeAfter );
 				return formatReturnValue( OPENING_TAG, nodeAfter );
 			} else if ( nodeAfter instanceof Character ) {
 			} else if ( nodeAfter instanceof Character ) {
-				this.position = Position.makePositionFromParentAndOffset( parent, position.offset + 1, position.document );
+				this.position = Position.makePositionFromParentAndOffset( parent, position.offset + 1, position.doc );
 
 
 				return formatReturnValue( CHARACTER, nodeAfter );
 				return formatReturnValue( CHARACTER, nodeAfter );
 			} else {
 			} else {
-				this.position = Position.makePositionFromParentAndOffset( parent.parent, parent.positionInParent + 1, position.document );
+				this.position = Position.makePositionFromParentAndOffset( parent.parent, parent.positionInParent + 1, position.doc );
 
 
 				return formatReturnValue( CLOSING_TAG, this.position.nodeBefore );
 				return formatReturnValue( CLOSING_TAG, this.position.nodeBefore );
 			}
 			}
@@ -115,15 +115,15 @@ CKEDITOR.define( [
 			var nodeBefore = position.nodeBefore;
 			var nodeBefore = position.nodeBefore;
 
 
 			if ( nodeBefore instanceof Element ) {
 			if ( nodeBefore instanceof Element ) {
-				this.position = Position.makePositionFromParentAndOffset( nodeBefore, nodeBefore.children.length, position.document );
+				this.position = Position.makePositionFromParentAndOffset( nodeBefore, nodeBefore.children.length, position.doc );
 
 
 				return formatReturnValue( CLOSING_TAG, nodeBefore );
 				return formatReturnValue( CLOSING_TAG, nodeBefore );
 			} else if ( nodeBefore instanceof Character ) {
 			} else if ( nodeBefore instanceof Character ) {
-				this.position = Position.makePositionFromParentAndOffset( parent, position.offset - 1, position.document );
+				this.position = Position.makePositionFromParentAndOffset( parent, position.offset - 1, position.doc );
 
 
 				return formatReturnValue( CHARACTER, nodeBefore );
 				return formatReturnValue( CHARACTER, nodeBefore );
 			} else {
 			} else {
-				this.position = Position.makePositionFromParentAndOffset( parent.parent, parent.positionInParent, position.document );
+				this.position = Position.makePositionFromParentAndOffset( parent.parent, parent.positionInParent, position.doc );
 
 
 				return formatReturnValue( OPENING_TAG, this.position.nodeAfter );
 				return formatReturnValue( OPENING_TAG, this.position.nodeAfter );
 			}
 			}