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

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

?? fckstyle.js

?? 這個(gè)寫的就更好了
?? JS
?? 第 1 頁 / 共 3 頁
字號(hào):
?/*
 * 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 ==
 *
 * FCKStyle Class: contains a style definition, and all methods to work with
 * the style in a document.
 */

/**
 * @param {Object} styleDesc A "style descriptor" object, containing the raw
 * style definition in the following format:
 *		'<style name>' : {
 *			Element : '<element name>',
 *			Attributes : {
 *				'<att name>' : '<att value>',
 *				...
 *			},
 *			Styles : {
 *				'<style name>' : '<style value>',
 *				...
 *			},
 *			Overrides : '<element name>'|{
 *				Element : '<element name>',
 *				Attributes : {
 *					'<att name>' : '<att value>'|/<att regex>/
 *				},
 *				Styles : {
 *					'<style name>' : '<style value>'|/<style regex>/
 *				},
 *			}
 *		}
 */
var FCKStyle = function( styleDesc )
{
	this.Element = ( styleDesc.Element || 'span' ).toLowerCase() ;
	this._StyleDesc = styleDesc ;
}

FCKStyle.prototype =
{
	/**
	 * Get the style type, based on its element name:
	 *		- FCK_STYLE_BLOCK  (0): Block Style
	 *		- FCK_STYLE_INLINE (1): Inline Style
	 *		- FCK_STYLE_OBJECT (2): Object Style
	 */
	GetType : function()
	{
		var type = this.GetType_$ ;

		if ( type != undefined )
			return type ;

		var elementName = this.Element ;

		if ( elementName == '#' || FCKListsLib.StyleBlockElements[ elementName ] )
			type = FCK_STYLE_BLOCK ;
		else if ( FCKListsLib.StyleObjectElements[ elementName ] )
			type = FCK_STYLE_OBJECT ;
		else
			type = FCK_STYLE_INLINE ;

		return ( this.GetType_$ = type ) ;
	},

	/**
	 * Apply the style to the current selection.
	 */
	ApplyToSelection : function( targetWindow )
	{
		// Create a range for the current selection.
		var range = new FCKDomRange( targetWindow ) ;
		range.MoveToSelection() ;

		this.ApplyToRange( range, true ) ;
	},

	/**
	 * Apply the style to a FCKDomRange.
	 */
	ApplyToRange : function( range, selectIt, updateRange )
	{
		// ApplyToRange is not valid for FCK_STYLE_OBJECT types.
		// Use ApplyToObject instead.

		switch ( this.GetType() )
		{
			case FCK_STYLE_BLOCK :
				this.ApplyToRange = this._ApplyBlockStyle ;
				break ;
			case FCK_STYLE_INLINE :
				this.ApplyToRange = this._ApplyInlineStyle ;
				break ;
			default :
				return ;
		}

		this.ApplyToRange( range, selectIt, updateRange ) ;
	},

	/**
	 * Apply the style to an object. Valid for FCK_STYLE_BLOCK types only.
	 */
	ApplyToObject : function( objectElement )
	{
		if ( !objectElement )
			return ;

		this.BuildElement( null, objectElement ) ;
	},

	/**
	 * Remove the style from the current selection.
	 */
	RemoveFromSelection : function( targetWindow )
	{
		// Create a range for the current selection.
		var range = new FCKDomRange( targetWindow ) ;
		range.MoveToSelection() ;

		this.RemoveFromRange( range, true ) ;
	},

	/**
	 * Remove the style from a FCKDomRange. Block type styles will have no
	 * effect.
	 */
	RemoveFromRange : function( range, selectIt, updateRange )
	{
		var bookmark ;

		// Create the attribute list to be used later for element comparisons.
		var styleAttribs = this._GetAttribsForComparison() ;
		var styleOverrides = this._GetOverridesForComparison() ;

		// If collapsed, we are removing all conflicting styles from the range
		// parent tree.
		if ( range.CheckIsCollapsed() )
		{
			// Bookmark the range so we can re-select it after processing.
			var bookmark = range.CreateBookmark( true ) ;

			// Let's start from the bookmark <span> parent.
			var bookmarkStart = range.GetBookmarkNode( bookmark, true ) ;

			var path = new FCKElementPath( bookmarkStart.parentNode ) ;

			// While looping through the path, we'll be saving references to
			// parent elements if the range is in one of their boundaries. In
			// this way, we are able to create a copy of those elements when
			// removing a style if the range is in a boundary limit (see #1270).
			var boundaryElements = [] ;

			// Check if the range is in the boundary limits of an element
			// (related to #1270).
			var isBoundaryRight = !FCKDomTools.GetNextSibling( bookmarkStart ) ;
			var isBoundary = isBoundaryRight || !FCKDomTools.GetPreviousSibling( bookmarkStart ) ;

			// This is the last element to be removed in the boundary situation
			// described at #1270.
			var lastBoundaryElement ;
			var boundaryLimitIndex = -1 ;

			for ( var i = 0 ; i < path.Elements.length ; i++ )
			{
				var pathElement = path.Elements[i] ;
				if ( this.CheckElementRemovable( pathElement ) )
				{
					if ( isBoundary
						&& !FCKDomTools.CheckIsEmptyElement( pathElement,
								function( el )
								{
									return ( el != bookmarkStart ) ;
								} )
						)
					{
						lastBoundaryElement = pathElement ;

						// We'll be continuously including elements in the
						// boundaryElements array, but only those added before
						// setting lastBoundaryElement must be used later, so
						// let's mark the current index here.
						boundaryLimitIndex = boundaryElements.length - 1 ;
					}
					else
					{
						var pathElementName = pathElement.nodeName.toLowerCase() ;

						if ( pathElementName == this.Element )
						{
							// Remove any attribute that conflict with this style, no
							// matter their values.
							for ( var att in styleAttribs )
							{
								if ( FCKDomTools.HasAttribute( pathElement, att ) )
								{
									switch ( att )
									{
										case 'style' :
											this._RemoveStylesFromElement( pathElement ) ;
											break ;

										case 'class' :
											// The 'class' element value must match (#1318).
											if ( FCKDomTools.GetAttributeValue( pathElement, att ) != this.GetFinalAttributeValue( att ) )
												continue ;

										default :
											FCKDomTools.RemoveAttribute( pathElement, att ) ;
									}
								}
							}
						}

						// Remove overrides defined to the same element name.
						this._RemoveOverrides( pathElement, styleOverrides[ pathElementName ] ) ;

						// Remove the element if no more attributes are available and it's an inline style element
						if ( this.GetType() == FCK_STYLE_INLINE)
							this._RemoveNoAttribElement( pathElement ) ;
					}
				}
				else if ( isBoundary )
					boundaryElements.push( pathElement ) ;

				// Check if we are still in a boundary (at the same side).
				isBoundary = isBoundary && ( ( isBoundaryRight && !FCKDomTools.GetNextSibling( pathElement ) ) || ( !isBoundaryRight && !FCKDomTools.GetPreviousSibling( pathElement ) ) ) ;

				// If we are in an element that is not anymore a boundary, or
				// we are at the last element, let's move things outside the
				// boundary (if available).
				if ( lastBoundaryElement && ( !isBoundary || ( i == path.Elements.length - 1 ) ) )
				{
					// Remove the bookmark node from the DOM.
					var currentElement = FCKDomTools.RemoveNode( bookmarkStart ) ;

					// Build the collapsed group of elements that are not
					// removed by this style, but share the boundary.
					// (see comment 1 and 2 at #1270)
					for ( var j = 0 ; j <= boundaryLimitIndex ; j++ )
					{
						var newElement = FCKDomTools.CloneElement( boundaryElements[j] ) ;
						newElement.appendChild( currentElement ) ;
						currentElement = newElement ;
					}

					// Re-insert the bookmark node (and the collapsed elements)
					// in the DOM, in the new position next to the styled element.
					if ( isBoundaryRight )
						FCKDomTools.InsertAfterNode( lastBoundaryElement, currentElement ) ;
					else
						lastBoundaryElement.parentNode.insertBefore( currentElement, lastBoundaryElement ) ;

					isBoundary = false ;
					lastBoundaryElement = null ;
				}
			}

				// Re-select the original range.
			if ( selectIt )
				range.SelectBookmark( bookmark ) ;

			if ( updateRange )
				range.MoveToBookmark( bookmark ) ;
		}

		// Expand the range, if inside inline element boundaries.
		range.Expand( 'inline_elements' ) ;

		// Bookmark the range so we can re-select it after processing.
		var bookmark = range.CreateBookmark( true ) ;

		// The style will be applied within the bookmark boundaries.
		var startNode	= range.GetBookmarkNode( bookmark, true ) ;
		var endNode		= range.GetBookmarkNode( bookmark, false ) ;

		range.Release( true ) ;

		// We need to check the selection boundaries (bookmark spans) to break
		// the code in a way that we can properly remove partially selected nodes.
		// For example, removing a <b> style from
		//		<b>This is [some text</b> to show <b>the] problem</b>
		// ... where [ and ] represent the selection, must result:
		//		<b>This is </b>[some text to show the]<b> problem</b>
		// The strategy is simple, we just break the partial nodes before the
		// removal logic, having something that could be represented this way:
		//		<b>This is </b>[<b>some text</b> to show <b>the</b>]<b> problem</b>

		// Let's start checking the start boundary.
		var path = new FCKElementPath( startNode ) ;
		var pathElements = path.Elements ;
		var pathElement ;

		for ( var i = 1 ; i < pathElements.length ; i++ )
		{
			pathElement = pathElements[i] ;

			if ( pathElement == path.Block || pathElement == path.BlockLimit )
				break ;

			// If this element can be removed (even partially).
			if ( this.CheckElementRemovable( pathElement ) )
				FCKDomTools.BreakParent( startNode, pathElement, range ) ;
		}

		// Now the end boundary.
		path = new FCKElementPath( endNode ) ;
		pathElements = path.Elements ;

		for ( var i = 1 ; i < pathElements.length ; i++ )
		{
			pathElement = pathElements[i] ;

			if ( pathElement == path.Block || pathElement == path.BlockLimit )
				break ;

			elementName = pathElement.nodeName.toLowerCase() ;

			// If this element can be removed (even partially).
			if ( this.CheckElementRemovable( pathElement ) )
				FCKDomTools.BreakParent( endNode, pathElement, range ) ;
		}

		// Navigate through all nodes between the bookmarks.
		var currentNode = FCKDomTools.GetNextSourceNode( startNode, true ) ;

		while ( currentNode )
		{
			// Cache the next node to be processed. Do it now, because
			// currentNode may be removed.
			var nextNode = FCKDomTools.GetNextSourceNode( currentNode ) ;

			// Remove elements nodes that match with this style rules.
			if ( currentNode.nodeType == 1 )
			{
				var elementName = currentNode.nodeName.toLowerCase() ;

				var mayRemove = ( elementName == this.Element ) ;
				if ( mayRemove )
				{
					// Remove any attribute that conflict with this style, no matter
					// their values.
					for ( var att in styleAttribs )
					{
						if ( FCKDomTools.HasAttribute( currentNode, att ) )
						{
							switch ( att )
							{
								case 'style' :
									this._RemoveStylesFromElement( currentNode ) ;
									break ;

								case 'class' :
									// The 'class' element value must match (#1318).
									if ( FCKDomTools.GetAttributeValue( currentNode, att ) != this.GetFinalAttributeValue( att ) )
										continue ;

								default :
									FCKDomTools.RemoveAttribute( currentNode, att ) ;
							}
						}
					}
				}
				else
					mayRemove = !!styleOverrides[ elementName ] ;

				if ( mayRemove )
				{
					// Remove overrides defined to the same element name.
					this._RemoveOverrides( currentNode, styleOverrides[ elementName ] ) ;

					// Remove the element if no more attributes are available.
					this._RemoveNoAttribElement( currentNode ) ;
				}
			}

			// If we have reached the end of the selection, stop looping.
			if ( nextNode == endNode )
				break ;

			currentNode = nextNode ;
		}

		this._FixBookmarkStart( startNode ) ;

		// Re-select the original range.
		if ( selectIt )
			range.SelectBookmark( bookmark ) ;

		if ( updateRange )
			range.MoveToBookmark( bookmark ) ;
	},

	/**
	 * Checks if an element, or any of its attributes, is removable by the
	 * current style definition.
	 */
	CheckElementRemovable : function( element, fullMatch )
	{
		if ( !element )
			return false ;

		var elementName = element.nodeName.toLowerCase() ;

		// If the element name is the same as the style name.
		if ( elementName == this.Element )
		{
			// If no attributes are defined in the element.
			if ( !fullMatch && !FCKDomTools.HasAttributes( element ) )
				return true ;

			// If any attribute conflicts with the style attributes.
			var attribs = this._GetAttribsForComparison() ;
			var allMatched = ( attribs._length == 0 ) ;
			for ( var att in attribs )
			{
				if ( att == '_length' )
					continue ;

				if ( this._CompareAttributeValues( att, FCKDomTools.GetAttributeValue( element, att ), ( this.GetFinalAttributeValue( att ) || '' ) ) )
				{
					allMatched = true ;
					if ( !fullMatch )
						break ;
				}
				else
				{
					allMatched = false ;
					if ( fullMatch )
						return false ;
				}
			}
			if ( allMatched )
				return true ;
		}

		// Check if the element can be somehow overriden.
		var override = this._GetOverridesForComparison()[ elementName ] ;
		if ( override )
		{
			// If no attributes have been defined, remove the element.
			if ( !( attribs = override.Attributes ) ) // Only one "="
				return true ;

			for ( var i = 0 ; i < attribs.length ; i++ )
			{
				var attName = attribs[i][0] ;
				if ( FCKDomTools.HasAttribute( element, attName ) )

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产区在线观看成人精品 | 日韩av不卡一区二区| 久久久久久久电影| 91精品欧美综合在线观看最新| 99精品视频中文字幕| 国产不卡在线视频| 丁香亚洲综合激情啪啪综合| 国产成人综合网| 国产一区二区在线电影| 国产精品一区免费在线观看| 国产精品一级黄| 99久久国产综合精品色伊| 91亚洲精品久久久蜜桃网站| 色呦呦国产精品| 日本精品一级二级| 欧美中文字幕亚洲一区二区va在线| 91麻豆swag| 欧美精三区欧美精三区| 欧美一区二区三区在线观看视频| 欧美一区二区播放| 国产网站一区二区| 国产精品高清亚洲| 午夜av一区二区| 国产最新精品免费| 99热精品一区二区| 91麻豆精品国产91| 国产欧美视频一区二区| 一区二区在线观看视频| 婷婷夜色潮精品综合在线| 精品一区精品二区高清| 99视频一区二区| 日韩一区二区三区四区五区六区| 国产欧美日韩在线观看| 亚洲国产综合色| 国产毛片一区二区| 99精品视频在线观看| 欧美猛男gaygay网站| 久久久久久久久久久黄色| 亚洲精品一二三区| 激情综合亚洲精品| 欧美午夜电影网| 国产日产欧美一区二区三区 | 一区二区三区视频在线看| 亚洲超丰满肉感bbw| 国产福利91精品| 欧美日韩免费电影| **欧美大码日韩| 国产资源在线一区| 在线播放91灌醉迷j高跟美女 | 伊人开心综合网| 成人免费观看视频| 精品国产制服丝袜高跟| 一区二区三区四区乱视频| 国产精品一区二区免费不卡 | 91视频免费观看| 2023国产精品| 日韩高清不卡一区二区| 色老综合老女人久久久| 欧美激情在线一区二区| 麻豆精品久久精品色综合| 在线观看日韩电影| ㊣最新国产の精品bt伙计久久| 国产伦精一区二区三区| 欧美一级免费大片| 亚洲国产va精品久久久不卡综合| 91玉足脚交白嫩脚丫在线播放| 久久久精品中文字幕麻豆发布| 免费在线观看一区二区三区| 色婷婷综合久久久久中文| 亚洲国产精品成人综合 | 亚洲黄色小视频| 99久久国产综合精品色伊| 国产精品久99| 成人app软件下载大全免费| 国产精品三级av| 成人97人人超碰人人99| 国产精品你懂的在线欣赏| 成人午夜伦理影院| 一片黄亚洲嫩模| 欧美性一二三区| 亚洲成人av电影在线| 欧美精品欧美精品系列| 亚洲成人动漫在线观看| 欧美一区二区三区思思人| 日本欧美在线观看| 精品国产网站在线观看| 国产乱对白刺激视频不卡| 国产拍欧美日韩视频二区 | 亚洲色图丝袜美腿| 91免费版pro下载短视频| 一区二区三区欧美日| 欧美高清视频在线高清观看mv色露露十八| 亚洲一级二级在线| 欧美一区二区三区四区五区| 久久不见久久见免费视频7| 久久久久青草大香线综合精品| 国产精品系列在线观看| 国产精品久久久久久久久久免费看 | 国产福利一区二区三区在线视频| 久久久久久97三级| 91视频在线观看| 美女视频免费一区| 中文字幕乱码一区二区免费| 91影院在线免费观看| 日韩和的一区二区| 国产日韩欧美综合在线| 91色porny蝌蚪| 免费黄网站欧美| 国产精品久久久久久久久图文区| 在线中文字幕一区| 韩国成人福利片在线播放| 综合色中文字幕| 欧美一区二区三区在线观看| 成人免费高清视频在线观看| 亚洲国产人成综合网站| 精品福利视频一区二区三区| 97se亚洲国产综合在线| 69久久夜色精品国产69蝌蚪网| 久久91精品久久久久久秒播| 国产精品二区一区二区aⅴ污介绍| 欧美在线观看一二区| 国产伦理精品不卡| 亚洲.国产.中文慕字在线| 久久综合狠狠综合| 91成人在线精品| 国产麻豆午夜三级精品| 亚洲黄色片在线观看| 欧美大片拔萝卜| 色婷婷激情综合| 国产成人精品免费看| 国产一区在线视频| 亚洲视频小说图片| 一本色道久久综合亚洲aⅴ蜜桃 | 精品一区二区三区日韩| 亚洲欧美日韩一区二区 | 亚洲三级电影网站| 国产日韩精品一区二区三区| 欧美高清视频不卡网| 在线亚洲欧美专区二区| 成人开心网精品视频| 国产一区二区调教| 韩日精品视频一区| 日韩激情av在线| 午夜精品久久久久久| 亚洲欧美另类久久久精品| 久久精品视频一区二区三区| 欧美一区在线视频| 在线免费精品视频| 北条麻妃一区二区三区| 久久精品国产久精国产| 美国毛片一区二区| 日韩精品亚洲专区| 日本vs亚洲vs韩国一区三区| 日韩国产欧美在线播放| 无码av中文一区二区三区桃花岛| 伊人色综合久久天天| 亚洲一区二区在线观看视频 | 精品国产伦一区二区三区免费| 欧美精品自拍偷拍| 911精品国产一区二区在线| 欧美三级电影精品| 欧美一区二区三区四区在线观看| 欧美一区二区免费| 日韩精品一区二区三区在线| 日韩一区二区在线免费观看| 欧美一区二区成人6969| 久久久久久久免费视频了| 国产亚洲一区二区三区| 国产精品第五页| 亚洲最新视频在线观看| 丝袜诱惑制服诱惑色一区在线观看 | 亚洲bdsm女犯bdsm网站| 日韩制服丝袜av| 国产一区二区三区久久久| 福利电影一区二区三区| 色综合久久精品| 欧美一区二区私人影院日本| 26uuu亚洲综合色欧美 | 欧美视频日韩视频在线观看| 欧美顶级少妇做爰| www激情久久| 婷婷国产v国产偷v亚洲高清| 蜜桃在线一区二区三区| 成人夜色视频网站在线观看| 在线观看亚洲成人| 精品国产乱码久久久久久久 | 一区二区三区中文在线| 秋霞电影一区二区| 成人激情黄色小说| 69久久99精品久久久久婷婷| 国产午夜精品福利| 五月天丁香久久| 成人晚上爱看视频| 欧美一区二区三区免费视频 | 欧美肥胖老妇做爰| 国产精品麻豆一区二区| 欧美aaa在线| 色婷婷综合久久久久中文 | 精品在线一区二区三区| av中文字幕不卡|