ckeditor/_source/core/dom/range.js

(开头部分) 63KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/

/**
 * Creates a CKEDITOR.dom.range instance that can be used inside a specific
 * DOM Document.
 * @class Represents a delimited piece of content in a DOM Document.
 * It is contiguous in the sense that it can be characterized as selecting all
 * of the content between a pair of boundary-points.<br>
 * <br>
 * This class shares much of the W3C
 * <a href="http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html">Document Object Model Range</a>
 * ideas and features, adding several range manipulation tools to it, but it's
 * not intended to be compatible with it.
 * @param {CKEDITOR.dom.document} document The document into which the range
 *		features will be available.
 * @example
 * // Create a range for the entire contents of the editor document body.
 * var range = new CKEDITOR.dom.range( editor.document );
 * range.selectNodeContents( editor.document.getBody() );
 * // Delete the contents.
 * range.deleteContents();
 */
CKEDITOR.dom.range = function( document )
{
	/**
	 * Node within which the range begins.
	 * @type {CKEDITOR.NODE_ELEMENT|CKEDITOR.NODE_TEXT}
	 * @example
	 * var range = new CKEDITOR.dom.range( editor.document );
	 * range.selectNodeContents( editor.document.getBody() );
	 * alert( range.startContainer.getName() );  // "body"
	 */
	this.startContainer	= null;

	/**
	 * Offset within the starting node of the range.
	 * @type {Number}
	 * @example
	 * var range = new CKEDITOR.dom.range( editor.document );
	 * range.selectNodeContents( editor.document.getBody() );
	 * alert( range.startOffset );  // "0"
	 */
	this.startOffset	= null;

	/**
	 * Node within which the range ends.
	 * @type {CKEDITOR.NODE_ELEMENT|CKEDITOR.NODE_TEXT}
	 * @example
	 * var range = new CKEDITOR.dom.range( editor.document );
	 * range.selectNodeContents( editor.document.getBody() );
	 * alert( range.endContainer.getName() );  // "body"
	 */
	this.endContainer	= null;

	/**
	 * Offset within the ending node of the range.
	 * @type {Number}
后面还有 1994 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。