亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fckdomrangeiterator.js

?? 強大的個人日志系統,界面華麗
?? JS
字號:
?/*
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
 *
 * == BEGIN LICENSE ==
 *
 * Licensed under the terms of any of the following licenses at your
 * choice:
 *
 *  - GNU General Public License Version 2 or later (the "GPL")
 *    http://www.gnu.org/licenses/gpl.html
 *
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 *    http://www.gnu.org/licenses/lgpl.html
 *
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
 *    http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * == END LICENSE ==
 *
 * This class can be used to interate through nodes inside a range.
 *
 * During interation, the provided range can become invalid, due to document
 * mutations, so CreateBookmark() used to restore it after processing, if
 * needed.
 */

var FCKDomRangeIterator = function( range )
{
	/**
	 * The FCKDomRange object that marks the interation boundaries.
	 */
	this.Range = range ;

	/**
	 * Indicates that <br> elements must be used as paragraph boundaries.
	 */
	this.ForceBrBreak = false ;

	/**
	 * Guarantees that the iterator will always return "real" block elements.
	 * If "false", elements like <li>, <th> and <td> are returned. If "true", a
	 * dedicated block element block element will be created inside those
	 * elements to hold the selected content.
	 */
	this.EnforceRealBlocks = false ;
}

FCKDomRangeIterator.CreateFromSelection = function( targetWindow )
{
	var range = new FCKDomRange( targetWindow ) ;
	range.MoveToSelection() ;
	return new FCKDomRangeIterator( range ) ;
}

FCKDomRangeIterator.prototype =
{
	/**
	 * Get the next paragraph element. It automatically breaks the document
	 * when necessary to generate block elements for the paragraphs.
	 */
	GetNextParagraph : function()
	{
		// The block element to be returned.
		var block ;

		// The range object used to identify the paragraph contents.
		var range ;

		// Indicated that the current element in the loop is the last one.
		var isLast ;

		// Instructs to cleanup remaining BRs.
		var removePreviousBr ;
		var removeLastBr ;

		var boundarySet = this.ForceBrBreak ? FCKListsLib.ListBoundaries : FCKListsLib.BlockBoundaries ;

		// This is the first iteration. Let's initialize it.
		if ( !this._LastNode )
		{
			var range = this.Range.Clone() ;
			range.Expand( this.ForceBrBreak ? 'list_contents' : 'block_contents' ) ;

			this._NextNode = range.GetTouchedStartNode() ;
			this._LastNode = range.GetTouchedEndNode() ;

			// Let's reuse this variable.
			range = null ;
		}

		var currentNode = this._NextNode ;
		var lastNode = this._LastNode ;

		this._NextNode = null ;

		while ( currentNode )
		{
			// closeRange indicates that a paragraph boundary has been found,
			// so the range can be closed.
			var closeRange = false ;

			// includeNode indicates that the current node is good to be part
			// of the range. By default, any non-element node is ok for it.
			var includeNode = ( currentNode.nodeType != 1 ) ;

			var continueFromSibling = false ;

			// If it is an element node, let's check if it can be part of the
			// range.
			if ( !includeNode )
			{
				var nodeName = currentNode.nodeName.toLowerCase() ;

				if ( boundarySet[ nodeName ] && ( !FCKBrowserInfo.IsIE || currentNode.scopeName == 'HTML' ) )
				{
					// <br> boundaries must be part of the range. It will
					// happen only if ForceBrBreak.
					if ( nodeName == 'br' )
						includeNode = true ;
					else if ( !range && currentNode.childNodes.length == 0 && nodeName != 'hr' )
					{
						// If we have found an empty block, and haven't started
						// the range yet, it means we must return this block.
						block = currentNode ;
						isLast = currentNode == lastNode ;
						break ;
					}

					// The range must finish right before the boundary,
					// including possibly skipped empty spaces. (#1603)
					if ( range )
					{
						range.SetEnd( currentNode, 3, true ) ;

						// The found boundary must be set as the next one at this
						// point. (#1717)
						if ( nodeName != 'br' )
							this._NextNode = FCKDomTools.GetNextSourceNode( currentNode, true, null, lastNode ) ;
					}

					closeRange = true ;
				}
				else
				{
					// If we have child nodes, let's check them.
					if ( currentNode.firstChild )
					{
						// If we don't have a range yet, let's start it.
						if ( !range )
						{
							range = new FCKDomRange( this.Range.Window ) ;
							range.SetStart( currentNode, 3, true ) ;
						}

						currentNode = currentNode.firstChild ;
						continue ;
					}
					includeNode = true ;
				}
			}
			else if ( currentNode.nodeType == 3 )
			{
				// Ignore normal whitespaces (i.e. not including &nbsp; or
				// other unicode whitespaces) before/after a block node.
				if ( /^[\r\n\t ]+$/.test( currentNode.nodeValue ) )
					includeNode = false ;
			}

			// The current node is good to be part of the range and we are
			// starting a new range, initialize it first.
			if ( includeNode && !range )
			{
				range = new FCKDomRange( this.Range.Window ) ;
				range.SetStart( currentNode, 3, true ) ;
			}

			// The last node has been found.
			isLast = ( ( !closeRange || includeNode ) && currentNode == lastNode ) ;
//			isLast = ( currentNode == lastNode && ( currentNode.nodeType != 1 || currentNode.childNodes.length == 0 ) ) ;

			// If we are in an element boundary, let's check if it is time
			// to close the range, otherwise we include the parent within it.
			if ( range && !closeRange )
			{
				while ( !currentNode.nextSibling && !isLast )
				{
					var parentNode = currentNode.parentNode ;

					if ( boundarySet[ parentNode.nodeName.toLowerCase() ] )
					{
						closeRange = true ;
						isLast = isLast || ( parentNode == lastNode ) ;
						break ;
					}

					currentNode = parentNode ;
					includeNode = true ;
					isLast = ( currentNode == lastNode ) ;
					continueFromSibling = true ;
				}
			}

			// Now finally include the node.
			if ( includeNode )
				range.SetEnd( currentNode, 4, true ) ;

			// We have found a block boundary. Let's close the range and move out of the
			// loop.
			if ( ( closeRange || isLast ) && range )
			{
				range._UpdateElementInfo() ;

				if ( range.StartNode == range.EndNode
						&& range.StartNode.parentNode == range.StartBlockLimit
						&& range.StartNode.getAttribute && range.StartNode.getAttribute( '_fck_bookmark' ) )
					range = null ;
				else
					break ;
			}

			if ( isLast )
				break ;

			currentNode = FCKDomTools.GetNextSourceNode( currentNode, continueFromSibling, null, lastNode ) ;
		}

		// Now, based on the processed range, look for (or create) the block to be returned.
		if ( !block )
		{
			// If no range has been found, this is the end.
			if ( !range )
			{
				this._NextNode = null ;
				return null ;
			}

			block = range.StartBlock ;

			if ( !block
				&& !this.EnforceRealBlocks
				&& range.StartBlockLimit.nodeName.IEquals( 'DIV', 'TH', 'TD' )
				&& range.CheckStartOfBlock()
				&& range.CheckEndOfBlock() )
			{
				block = range.StartBlockLimit ;
			}
			else if ( !block || ( this.EnforceRealBlocks && block.nodeName.toLowerCase() == 'li' ) )
			{
				// Create the fixed block.
				block = this.Range.Window.document.createElement( FCKConfig.EnterMode == 'p' ? 'p' : 'div' ) ;

				// Move the contents of the temporary range to the fixed block.
				range.ExtractContents().AppendTo( block ) ;
				FCKDomTools.TrimNode( block ) ;

				// Insert the fixed block into the DOM.
				range.InsertNode( block ) ;

				removePreviousBr = true ;
				removeLastBr = true ;
			}
			else if ( block.nodeName.toLowerCase() != 'li' )
			{
				// If the range doesn't includes the entire contents of the
				// block, we must split it, isolating the range in a dedicated
				// block.
				if ( !range.CheckStartOfBlock() || !range.CheckEndOfBlock() )
				{
					// The resulting block will be a clone of the current one.
					block = block.cloneNode( false ) ;

					// Extract the range contents, moving it to the new block.
					range.ExtractContents().AppendTo( block ) ;
					FCKDomTools.TrimNode( block ) ;

					// Split the block. At this point, the range will be in the
					// right position for our intents.
					var splitInfo = range.SplitBlock() ;

					removePreviousBr = !splitInfo.WasStartOfBlock ;
					removeLastBr = !splitInfo.WasEndOfBlock ;

					// Insert the new block into the DOM.
					range.InsertNode( block ) ;
				}
			}
			else if ( !isLast )
			{
				// LIs are returned as is, with all their children (due to the
				// nested lists). But, the next node is the node right after
				// the current range, which could be an <li> child (nested
				// lists) or the next sibling <li>.

				this._NextNode = block == lastNode ? null : FCKDomTools.GetNextSourceNode( range.EndNode, true, null, lastNode ) ;
				return block ;
			}
		}

		if ( removePreviousBr )
		{
			var previousSibling = block.previousSibling ;
			if ( previousSibling && previousSibling.nodeType == 1 )
			{
				if ( previousSibling.nodeName.toLowerCase() == 'br' )
					previousSibling.parentNode.removeChild( previousSibling ) ;
				else if ( previousSibling.lastChild && previousSibling.lastChild.nodeName.IEquals( 'br' ) )
					previousSibling.removeChild( previousSibling.lastChild ) ;
			}
		}

		if ( removeLastBr )
		{
			var lastChild = block.lastChild ;
			if ( lastChild && lastChild.nodeType == 1 && lastChild.nodeName.toLowerCase() == 'br' )
				block.removeChild( lastChild ) ;
		}

		// Get a reference for the next element. This is important because the
		// above block can be removed or changed, so we can rely on it for the
		// next interation.
		if ( !this._NextNode )
			this._NextNode = ( isLast || block == lastNode ) ? null : FCKDomTools.GetNextSourceNode( block, true, null, lastNode ) ;

		return block ;
	}
} ;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
另类调教123区| 麻豆精品蜜桃视频网站| 日韩一区二区三区免费看| 韩国v欧美v亚洲v日本v| 伊人婷婷欧美激情| 国产亚洲美州欧州综合国| 欧美日韩国产小视频在线观看| 国内精品第一页| 日韩有码一区二区三区| 亚洲欧洲在线观看av| 精品久久久久一区| 91精品国产综合久久福利软件| 99精品视频在线播放观看| 激情五月婷婷综合网| 亚洲第四色夜色| 一区二区三区色| 国产精品盗摄一区二区三区| 精品久久久久久久久久久久包黑料| 欧美亚洲国产怡红院影院| 成人av网站大全| 国产a久久麻豆| 精品一区二区在线观看| 日韩精品欧美成人高清一区二区| 亚洲视频香蕉人妖| 日本一区二区不卡视频| 久久亚洲二区三区| 欧美成人性福生活免费看| 欧美人与z0zoxxxx视频| 在线观看欧美黄色| 在线免费精品视频| 972aa.com艺术欧美| www.欧美亚洲| 91免费精品国自产拍在线不卡| 懂色av一区二区在线播放| 韩国欧美国产1区| 国产精品一线二线三线精华| 激情六月婷婷久久| 加勒比av一区二区| 激情文学综合丁香| 国产精品亚洲第一区在线暖暖韩国| 精品一区二区三区在线播放 | 欧美不卡一区二区三区| 欧美一区二区三区在线电影| 欧美日韩一级片网站| 欧美日韩精品欧美日韩精品一综合| 欧美色男人天堂| 91精品国产入口| 日韩丝袜情趣美女图片| 日韩精品最新网址| 久久精品夜色噜噜亚洲aⅴ| 久久精品夜色噜噜亚洲a∨| 日本一区二区视频在线| 国产精品全国免费观看高清| 国产精品白丝在线| 亚洲欧美一区二区久久| 亚洲成av人片一区二区| 男女视频一区二区| 国产成人精品三级| 色婷婷精品久久二区二区蜜臂av| 欧美三级在线看| 欧美www视频| 国产精品少妇自拍| 夜夜爽夜夜爽精品视频| 日本欧美一区二区| 国产不卡高清在线观看视频| 色狠狠色狠狠综合| 日韩精品一区二区三区视频在线观看| 2021久久国产精品不只是精品| 国产精品美女久久久久久久久久久 | 国产久卡久卡久卡久卡视频精品| 成人免费va视频| 欧美日韩在线电影| 久久亚洲精品小早川怜子| 1024成人网| 日韩中文字幕1| 成人18视频日本| 91麻豆精品国产91久久久更新时间| 日韩美一区二区三区| 国产精品成人免费在线| 午夜私人影院久久久久| 国产精品中文有码| 欧美日韩不卡在线| 国产精品久久影院| 免费观看久久久4p| 91性感美女视频| 欧美成人福利视频| 樱花草国产18久久久久| 精油按摩中文字幕久久| 91在线一区二区| 精品国产99国产精品| 亚洲精品乱码久久久久| 国产麻豆午夜三级精品| 欧美三级韩国三级日本三斤| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 麻豆精品在线观看| 色综合久久综合网| 精品对白一区国产伦| 一区二区成人在线| 国产91在线看| 日韩欧美亚洲另类制服综合在线| 亚洲免费视频成人| 国产91丝袜在线观看| 日韩三级.com| 亚洲444eee在线观看| 成人午夜激情在线| 久久这里只有精品视频网| 亚洲资源在线观看| www.久久精品| 国产日韩亚洲欧美综合| 日本人妖一区二区| 欧美探花视频资源| 尤物在线观看一区| www.亚洲人| 国产精品久久三区| 国产成人精品亚洲午夜麻豆| 日韩精品一区二区三区四区视频| 亚洲成人一区二区| 在线影院国内精品| 亚洲另类在线一区| 99久久久久久| 国产精品久久久久久久久快鸭 | 午夜国产精品影院在线观看| 色素色在线综合| 亚洲欧美日韩综合aⅴ视频| 粉嫩嫩av羞羞动漫久久久| 久久免费午夜影院| 国产乱色国产精品免费视频| 欧美成人性福生活免费看| 奇米影视一区二区三区小说| 欧美日韩国产片| 亚洲不卡av一区二区三区| 欧美日韩视频专区在线播放| 亚洲第一主播视频| 欧美日韩三级在线| 亚洲成年人网站在线观看| 欧美日韩一区二区三区不卡| 亚洲小说欧美激情另类| 欧美日韩专区在线| 亚洲第一精品在线| 在线观看91av| 美国十次了思思久久精品导航| 日韩免费性生活视频播放| 黄页视频在线91| 国产人久久人人人人爽| 成人免费福利片| 一区二区三区在线视频播放| 色成人在线视频| 五月婷婷久久综合| 91精品国产91综合久久蜜臀| 久久精品国产色蜜蜜麻豆| 精品av综合导航| 成人免费福利片| 亚洲综合色噜噜狠狠| 欧美一区二区视频网站| 精品一区二区三区视频| 国产亚洲欧美在线| 99久久免费精品| 午夜精品久久久久影视| 日韩精品专区在线| 国产成人99久久亚洲综合精品| 亚洲欧美国产毛片在线| 欧美久久久久久蜜桃| 国产一区二区三区蝌蚪| 国产精品国产三级国产aⅴ原创| 欧美手机在线视频| 久久se精品一区二区| 国产精品久久久久久久久晋中| 欧美日韩亚洲国产综合| 国产在线乱码一区二区三区| 亚洲色图在线播放| 欧美一级专区免费大片| 福利一区福利二区| 一区二区三区四区在线免费观看 | 亚洲欧美偷拍三级| 欧美一级黄色录像| 成人黄色电影在线| 青青国产91久久久久久 | 免费在线看一区| 国产精品久久三| 制服丝袜国产精品| 成人黄色网址在线观看| 亚洲国产精品久久不卡毛片 | 91国产免费观看| 国内精品视频一区二区三区八戒| 亚洲人妖av一区二区| 欧美一区二区三区视频免费播放 | 欧美日韩一区二区三区四区五区 | 欧美日本精品一区二区三区| 国产91在线|亚洲| 秋霞av亚洲一区二区三| 亚洲精品伦理在线| 久久久精品免费观看| 91精品国产综合久久福利软件| 成人av先锋影音| 极品销魂美女一区二区三区| 亚洲成在人线免费| 中文字幕亚洲在| 久久久久99精品国产片| 4438x亚洲最大成人网| 91在线视频18|