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

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

?? fckstyle.js

?? 這是一個BBS系統
?? 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一区二区三区免费野_久草精品视频
91蜜桃婷婷狠狠久久综合9色| 欧美日韩国产天堂| 日韩精品乱码av一区二区| 国产精品视频观看| 欧美肥胖老妇做爰| 91麻豆国产自产在线观看| 国产伦精品一区二区三区视频青涩| 亚洲国产色一区| 亚洲欧洲日韩女同| 久久女同精品一区二区| 91精品婷婷国产综合久久性色| 97久久精品人人爽人人爽蜜臀| 开心九九激情九九欧美日韩精美视频电影| 亚洲欧美福利一区二区| 欧美国产禁国产网站cc| 精品日韩欧美在线| 制服丝袜亚洲色图| 欧美日精品一区视频| 色婷婷av一区二区三区大白胸| 国产成人在线色| 国产精品一线二线三线精华| 久久av中文字幕片| 免费成人av在线| 日韩电影在线一区二区三区| 亚洲曰韩产成在线| 亚洲午夜激情网站| 亚洲一区二区精品视频| 亚洲欧美日韩国产综合在线| 欧美高清在线视频| 久久这里只有精品6| 欧美成人bangbros| 精品国产精品一区二区夜夜嗨| 欧美精品日韩综合在线| 欧美老女人第四色| 51精品国自产在线| 日韩欧美激情四射| 久久午夜电影网| 国产午夜精品一区二区三区视频| 国产亚洲精品久| 亚洲国产精品传媒在线观看| 亚洲激情自拍偷拍| 亚洲国产成人porn| 偷拍一区二区三区| 麻豆极品一区二区三区| 黑人精品欧美一区二区蜜桃| 久久99久久精品| 激情小说欧美图片| 国产精品亚洲第一区在线暖暖韩国| 国产麻豆一精品一av一免费| 国产成人综合视频| 91在线一区二区| 日本一二三不卡| 国产精品国产三级国产aⅴ入口| 国产蜜臀av在线一区二区三区| 亚洲国产高清aⅴ视频| 亚洲欧美偷拍卡通变态| 亚洲地区一二三色| 裸体在线国模精品偷拍| 国产一区二区网址| eeuss鲁片一区二区三区| 在线观看国产精品网站| 91精品国产91久久久久久最新毛片 | 日本韩国一区二区| 欧美精品乱人伦久久久久久| 日韩美一区二区三区| 国产亚洲精品超碰| 一区二区三区四区国产精品| 视频一区免费在线观看| 精品在线一区二区三区| 99精品在线免费| 欧美日韩久久久久久| 精品国精品国产尤物美女| 国产欧美久久久精品影院| 亚洲主播在线观看| 国精产品一区一区三区mba视频| 播五月开心婷婷综合| 欧美另类一区二区三区| 国产亚洲一二三区| 亚洲国产精品一区二区www在线| 蜜桃av一区二区三区| 91视频xxxx| www成人在线观看| 亚洲免费观看高清在线观看| 青青草国产成人99久久| www..com久久爱| 日韩一区二区三区在线观看| 国产精品灌醉下药二区| 蜜桃久久av一区| 色综合久久综合网97色综合| 欧美xxxx在线观看| 亚洲一区二区成人在线观看| 国产酒店精品激情| 欧美精品久久一区二区三区| 国产欧美精品一区| 日韩中文字幕一区二区三区| av在线不卡电影| 26uuu久久天堂性欧美| 香蕉av福利精品导航| 不卡视频在线观看| 日韩一级在线观看| 夜夜爽夜夜爽精品视频| 成人精品视频一区| 日韩欧美国产成人一区二区| 亚洲宅男天堂在线观看无病毒 | 欧洲中文字幕精品| 国产精品久久久久天堂| 久久国产婷婷国产香蕉| 欧美色精品天天在线观看视频| 国产精品久久久久久久久久免费看| 麻豆精品视频在线| 欧美精品电影在线播放| 亚洲精品国产视频| 91亚洲午夜精品久久久久久| 国产午夜一区二区三区| 精品中文字幕一区二区| 日韩小视频在线观看专区| 亚洲成av人片www| 欧美综合亚洲图片综合区| 国产三级欧美三级| 国产一区二区三区观看| 日韩视频中午一区| 日韩成人精品在线| 91精品国产麻豆国产自产在线| 亚洲综合激情网| 日本高清不卡视频| 亚洲精品国产a| 在线观看日韩电影| 亚洲综合一区二区| 欧美性一区二区| 亚洲国产毛片aaaaa无费看| 欧洲国产伦久久久久久久| 一区二区三区小说| 欧美午夜电影一区| 午夜视频一区在线观看| 欧美三级电影在线看| 亚洲成人av一区| 91精品国模一区二区三区| 日韩激情一二三区| 精品国产乱码久久久久久闺蜜| 精品一二三四在线| 日本一区二区三区dvd视频在线| 国产电影一区在线| 国产精品国产成人国产三级| 91免费国产在线| 亚洲午夜免费福利视频| 在线综合视频播放| 久久99精品网久久| 国产偷v国产偷v亚洲高清| 丁香婷婷综合五月| 亚洲品质自拍视频| 欧美丰满嫩嫩电影| 狠狠色狠狠色综合系列| 国产日韩欧美在线一区| 97久久人人超碰| 日韩av网站在线观看| 2023国产精华国产精品| 成人午夜激情影院| 亚洲一区二区偷拍精品| 日韩视频免费观看高清在线视频| 国产一区二区精品久久91| 国产精品伦一区| 欧美色综合影院| 激情综合色综合久久综合| 国产精品每日更新| 欧美日韩一卡二卡| 精品一二三四区| 最新高清无码专区| 欧美一区二区私人影院日本| 国产九九视频一区二区三区| 亚洲免费观看高清在线观看| 欧美一三区三区四区免费在线看| 狠狠色狠狠色合久久伊人| 亚洲精品日韩一| 2024国产精品视频| 欧美亚洲国产怡红院影院| 精品一区二区三区不卡| 日韩美女视频一区| 日韩欧美一级精品久久| 91麻豆swag| 国产美女在线精品| 亚洲在线免费播放| 亚洲国产精品精华液2区45| 欧美男同性恋视频网站| 高清不卡一区二区在线| 五月综合激情婷婷六月色窝| 欧美国产日韩在线观看| 欧美一区二区三区在线视频| 不卡的av电影在线观看| 久久99精品久久久久久动态图 | 国产一区二区三区在线观看精品| 亚洲男人的天堂在线观看| 久久综合999| 欧美精品成人一区二区三区四区| 成人激情开心网| 激情偷乱视频一区二区三区| 亚洲国产日韩在线一区模特| 国产精品久久久久桃色tv| 久久先锋影音av| 欧美一激情一区二区三区| 日本国产一区二区|