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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 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 = currentNode ;
					}

					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 ;
	}
} ;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品欧美一区二区三区麻豆| 一本久道中文字幕精品亚洲嫩| 欧美精品乱码久久久久久按摩| 一区二区久久久久久| 色综合中文字幕国产| 国产精品国产精品国产专区不片| 波波电影院一区二区三区| 亚洲欧洲国产日韩| 欧美体内she精高潮| 午夜成人免费电影| 精品不卡在线视频| 岛国av在线一区| 亚洲欧美视频在线观看视频| 欧美少妇一区二区| 另类专区欧美蜜桃臀第一页| 久久久国产一区二区三区四区小说| 国产成人精品1024| 亚洲妇女屁股眼交7| 欧美mv和日韩mv的网站| 成人av网站大全| 午夜精品123| 久久精品人人爽人人爽| 欧美唯美清纯偷拍| 丁香天五香天堂综合| 亚洲国产一区二区在线播放| 精品久久久久久久久久久久久久久 | 一区二区三国产精华液| 欧美一区二区在线不卡| 国产成人精品www牛牛影视| 亚洲成a人v欧美综合天堂| ww亚洲ww在线观看国产| 色欧美片视频在线观看在线视频| 青青草97国产精品免费观看| 国产清纯白嫩初高生在线观看91| 日本高清无吗v一区| 精品一区二区三区免费| 亚洲精品中文字幕乱码三区| 日韩欧美精品在线视频| 91国在线观看| 成人网男人的天堂| 日av在线不卡| 亚洲精品成人少妇| 国产欧美日韩另类一区| 91精品欧美综合在线观看最新| 成人免费视频caoporn| 麻豆精品久久精品色综合| 亚洲三级免费观看| 日本一区二区视频在线观看| 欧美一级免费大片| 精品污污网站免费看| 成人成人成人在线视频| 国产老女人精品毛片久久| 午夜精品福利久久久| 亚洲综合色视频| 日韩一区日韩二区| 国产女人水真多18毛片18精品视频| 欧美乱熟臀69xxxxxx| 色又黄又爽网站www久久| 成人影视亚洲图片在线| 激情另类小说区图片区视频区| 午夜精品福利在线| 亚洲福利国产精品| 亚洲精品亚洲人成人网| 国产精品美女www爽爽爽| 久久久久久一二三区| 欧美成人在线直播| 日韩三级av在线播放| 欧美人体做爰大胆视频| 欧美性大战久久久| 欧美午夜电影在线播放| 欧美性感一区二区三区| 欧美三级在线播放| 欧美日韩一区在线观看| 色网站国产精品| 日本韩国欧美三级| 在线亚洲精品福利网址导航| 一本色道久久综合亚洲aⅴ蜜桃| 99精品欧美一区二区三区小说 | 亚洲免费在线视频一区 二区| 中文字幕精品三区| 国产精品欧美一区二区三区| 国产欧美1区2区3区| 国产精品免费久久| 亚洲免费在线观看| 亚洲尤物在线视频观看| 五月天视频一区| 免费成人在线观看| 韩国精品一区二区| 国产91丝袜在线观看| 97精品久久久午夜一区二区三区 | www.在线成人| 99免费精品在线观看| 色综合久久精品| 欧美美女激情18p| 91精品国产综合久久久久| 日韩免费高清av| 欧美高清在线视频| 亚洲视频免费在线观看| 亚洲国产aⅴ天堂久久| 日韩高清中文字幕一区| 国产在线视频不卡二| 国产99久久久国产精品潘金 | 91精品久久久久久久久99蜜臂| 日韩欧美在线123| 欧美韩日一区二区三区| 一区二区高清免费观看影视大全| 亚洲18女电影在线观看| 极品尤物av久久免费看| 99re视频精品| 欧美一区二区福利在线| 国产女人18水真多18精品一级做 | 亚洲成人动漫在线观看| 乱中年女人伦av一区二区| 波多野结衣中文字幕一区二区三区 | 欧美一区在线视频| 久久九九全国免费| 亚洲国产一区视频| 国产麻豆视频精品| 欧美性猛交xxxx乱大交退制版| 欧美va亚洲va香蕉在线| 亚洲婷婷综合色高清在线| 日本午夜一本久久久综合| 成人一区在线看| 日韩一区二区三区高清免费看看| 中日韩免费视频中文字幕| 亚洲国产精品一区二区久久 | 日韩有码一区二区三区| 国产sm精品调教视频网站| 欧美日韩高清影院| 亚洲国产精品激情在线观看| 婷婷中文字幕一区三区| www.av亚洲| 精品奇米国产一区二区三区| 亚洲日本中文字幕区| 国产在线精品一区二区| 欧美日韩1区2区| 亚洲视频一二区| 懂色av中文一区二区三区 | 日本大香伊一区二区三区| 久久精品人人做人人爽人人| 午夜精品aaa| 欧美午夜精品免费| 亚洲视频免费看| www.成人在线| 国产拍揄自揄精品视频麻豆| 蜜臀久久99精品久久久久久9| 一本一本久久a久久精品综合麻豆| 国产欧美1区2区3区| 激情综合五月婷婷| 欧美成人猛片aaaaaaa| 亚洲成人av一区| 欧美影片第一页| 亚洲精选视频在线| 成人h版在线观看| 国产精品视频你懂的| 国产精品亚洲综合一区在线观看| 日韩一区二区影院| 美女一区二区三区| 日韩一二三区不卡| 美女看a上一区| 欧美日韩国产精选| 丝瓜av网站精品一区二区| 91福利精品视频| 亚洲国产精品久久久久秋霞影院 | 亚洲精品自拍动漫在线| 99精品一区二区三区| 综合av第一页| 91美女在线看| 亚洲精品乱码久久久久久久久| 93久久精品日日躁夜夜躁欧美| 国产色综合一区| youjizz国产精品| 亚洲精品大片www| 欧洲日韩一区二区三区| 亚洲精品亚洲人成人网在线播放| 91原创在线视频| 亚洲在线中文字幕| 欧美绝品在线观看成人午夜影视| 午夜视黄欧洲亚洲| 日韩一区二区在线看| 老司机午夜精品| 国产亚洲成av人在线观看导航| 国产丶欧美丶日本不卡视频| 亚洲国产精品精华液ab| 色哟哟在线观看一区二区三区| 一区二区三区四区视频精品免费 | 激情深爱一区二区| 中文字幕高清一区| 97久久精品人人做人人爽| 一区二区高清视频在线观看| 欧美精选午夜久久久乱码6080| 激情欧美一区二区| 亚洲国产高清在线观看视频| 99久久久久久99| 午夜av一区二区三区| 精品99一区二区| 91一区二区在线| 免费观看日韩av| 中文字幕一区二区三区四区 | 一区二区视频在线看|