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

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

?? fckstyle.js

?? BugNET is an issue tracking and project issue management solution built using the ASP.NET web applic
?? JS
?? 第 1 頁 / 共 4 頁
字號:
?/*
 * 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 ;

											/*jsl:fallthru*/

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

			return ;
		}

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

		// Bookmark the range so we can re-select it after processing.
		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 ;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲另类春色国产| 欧美精品一区二区精品网| 日韩专区欧美专区| 久久天天做天天爱综合色| 欧美三级日韩三级国产三级| 激情久久五月天| 亚洲精品免费电影| 欧美激情在线免费观看| 欧美日韩在线播放一区| 成人动漫精品一区二区| 麻豆成人av在线| 午夜精品视频一区| 亚洲三级在线看| 国产亚洲人成网站| 日韩欧美亚洲一区二区| 欧美在线观看一区| 91原创在线视频| 国产成人免费在线| 国产中文字幕一区| 韩国精品久久久| 麻豆精品在线视频| 五月婷婷色综合| 亚洲一区二区av电影| 成人免费小视频| 国产精品午夜在线观看| 久久精品亚洲麻豆av一区二区| 在线电影欧美成精品| 欧美性生活影院| 色狠狠av一区二区三区| 99精品一区二区| www.99精品| 成人福利视频网站| av激情亚洲男人天堂| 国产成人啪午夜精品网站男同| 国产一区二区三区av电影 | 午夜激情久久久| 有码一区二区三区| 有坂深雪av一区二区精品| 亚洲青青青在线视频| 亚洲精品综合在线| 一个色综合av| 亚洲妇熟xx妇色黄| 日韩精品三区四区| 日韩国产高清影视| 美女一区二区三区| 麻豆免费精品视频| 国产精品2024| 成人app在线观看| 91丨porny丨国产| 91久久精品网| 欧美日韩www| 日韩视频一区在线观看| 精品日韩欧美在线| 国产欧美日韩精品一区| 国产精品久久久久精k8| 亚洲黄色av一区| 香蕉成人啪国产精品视频综合网 | 欧美成人在线直播| 久久九九国产精品| 国产精品护士白丝一区av| 成人免费在线观看入口| 亚洲综合另类小说| 日本一区中文字幕| 国产精品亚洲人在线观看| eeuss影院一区二区三区| 91视频你懂的| 欧美日本视频在线| 久久精品综合网| 一区二区三区在线观看动漫| 日韩精品一二三区| 国产自产高清不卡| 在线免费观看日韩欧美| 日韩一区二区免费在线观看| 日本一区二区在线不卡| 亚洲综合免费观看高清在线观看| 美女精品一区二区| 99久久精品国产导航| 欧美日韩国产免费一区二区| 久久久久青草大香线综合精品| 一级做a爱片久久| 色偷偷一区二区三区| 欧美精品xxxxbbbb| 国产视频亚洲色图| 亚洲精品欧美专区| 久久成人久久鬼色| 一本大道av一区二区在线播放| 欧美浪妇xxxx高跟鞋交| 中文字幕av一区二区三区| 亚洲综合激情网| 国产福利一区二区三区视频在线| 色综合久久中文综合久久97| 日韩精品一区国产麻豆| 亚洲靠逼com| 国产一区二区在线免费观看| 欧美在线观看视频一区二区三区| 精品少妇一区二区三区在线视频| 亚洲三级久久久| 国产美女在线观看一区| 欧美日韩视频在线一区二区| 国产拍欧美日韩视频二区| 午夜精品久久久久久久久久| 成人精品视频.| 精品人伦一区二区色婷婷| 夜夜爽夜夜爽精品视频| 国产69精品久久久久毛片| 欧美肥胖老妇做爰| 亚洲天天做日日做天天谢日日欢| 激情六月婷婷久久| 欧美一区二区三区四区视频| 亚洲精品成人天堂一二三| 国产iv一区二区三区| 日韩美女视频一区二区在线观看| 一区二区三区精品在线| 99综合影院在线| 久久精品视频在线看| 美女视频黄 久久| 美女在线视频一区| 国内精品免费在线观看| 欧美日本韩国一区二区三区视频| 欧美极品少妇xxxxⅹ高跟鞋| 精品一区二区三区免费播放| 欧美日韩国产系列| 亚洲高清一区二区三区| 色综合久久综合| 自拍偷拍亚洲欧美日韩| 国产mv日韩mv欧美| 欧美国产激情一区二区三区蜜月| 久久精品99国产精品日本| 欧美精选一区二区| 亚洲午夜视频在线| 欧美午夜电影一区| 亚洲一区二区影院| 91成人在线观看喷潮| 亚洲精品菠萝久久久久久久| 色综合中文字幕国产 | 成人av网站在线观看免费| 337p粉嫩大胆色噜噜噜噜亚洲 | 97se亚洲国产综合自在线观| 欧美激情一区二区三区全黄 | 日韩一区二区麻豆国产| 91色在线porny| 国产日韩综合av| 国产精品亚洲视频| 中文字幕一区二区视频| 97精品国产97久久久久久久久久久久| 国产精品视频看| 91女厕偷拍女厕偷拍高清| 一区二区三区蜜桃网| 欧美日韩一区二区三区四区 | 亚洲国产日韩一级| 欧美另类久久久品| 蜜臀av国产精品久久久久| 日韩精品在线看片z| 丰满岳乱妇一区二区三区| 中文字幕在线不卡一区二区三区 | 精品福利视频一区二区三区| 国产酒店精品激情| 亚洲视频一区二区在线| 欧美日韩在线免费视频| 久久精品久久综合| 国产欧美va欧美不卡在线 | 2020国产精品久久精品美国| 国产精品一区二区三区乱码| 国产精品白丝在线| 欧美色图一区二区三区| 久久97超碰国产精品超碰| 欧美激情一区二区三区全黄| 99re视频精品| 久久久国产精品不卡| 国产综合成人久久大片91| 国产精品九色蝌蚪自拍| 国产欧美日韩在线视频| 91论坛在线播放| 青青草一区二区三区| 欧美激情在线一区二区| 精品视频免费看| 国产91在线看| 性感美女久久精品| 中文字幕乱码久久午夜不卡| 日本久久电影网| 国内精品在线播放| 亚洲精品视频免费看| 精品国产污污免费网站入口 | 国产一区二区在线免费观看| 亚洲精品日韩一| 亚洲精品一区二区精华| 在线视频综合导航| 国产a精品视频| 日本女优在线视频一区二区| 国产精品国产三级国产aⅴ入口 | 成人性生交大片免费看中文网站| 亚洲曰韩产成在线| 欧美经典一区二区三区| 4438x亚洲最大成人网| 99re这里只有精品视频首页| 国精产品一区一区三区mba桃花 | 亚洲高清在线视频| 亚洲欧洲国产专区| 久久青草国产手机看片福利盒子| 欧美日韩你懂得|