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

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

?? fckstyle.js

?? 強大的個人日志系統,界面華麗
?? 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一区二区三区免费野_久草精品视频
欧美mv日韩mv亚洲| 国产精品欧美一级免费| 成人黄色综合网站| 日韩国产精品91| 最近日韩中文字幕| 欧美tickling挠脚心丨vk| 色婷婷久久一区二区三区麻豆| 久久国产福利国产秒拍| 伊人开心综合网| 国产欧美精品一区aⅴ影院| 欧美日韩综合色| 91污片在线观看| 国产成人精品免费| 奇米在线7777在线精品| 亚洲最大色网站| 成人免费在线播放视频| 国产亚洲综合在线| 精品理论电影在线观看| 欧美精品一卡两卡| 在线观看www91| 91蝌蚪国产九色| 99久久精品免费观看| 国产乱码精品一区二区三| 美女脱光内衣内裤视频久久网站| 亚洲精品写真福利| 国产精品三级av| 欧美激情在线观看视频免费| 精品久久久久一区| 精品乱人伦小说| 欧美一区二区三区四区久久| 欧美美女激情18p| 欧美私模裸体表演在线观看| 在线观看欧美精品| 在线精品视频免费观看| 色网站国产精品| 色www精品视频在线观看| 97国产精品videossex| 99在线热播精品免费| 91在线视频在线| 91丨porny丨最新| 91精品1区2区| 欧美色图天堂网| 88在线观看91蜜桃国自产| 在线不卡a资源高清| 欧美一区二区视频网站| 日韩色在线观看| 精品88久久久久88久久久| 久久伊人中文字幕| 国产欧美日韩不卡免费| 国产精品久久久久久久久图文区| 日本一区二区免费在线观看视频| 欧美国产乱子伦 | 成人免费视频视频在线观看免费 | 亚洲精品欧美在线| 有码一区二区三区| 性做久久久久久久免费看| 欧美bbbbb| 国产精品综合在线视频| 成人午夜在线视频| 色婷婷国产精品综合在线观看| 欧美日韩高清一区| 精品久久久久一区| 亚洲欧洲日产国产综合网| 亚洲激情自拍视频| 蜜臀99久久精品久久久久久软件| 国产精品一区免费在线观看| 99re热这里只有精品视频| 欧美日韩色一区| 精品国产伦理网| 国产精品电影一区二区| 婷婷成人激情在线网| 黄色精品一二区| 不卡一区中文字幕| 欧美精品日日鲁夜夜添| 久久免费电影网| 亚洲欧美电影一区二区| 免费av成人在线| 成人黄色在线看| 欧美日韩免费观看一区三区| 久久久久97国产精华液好用吗| 亚洲日本va午夜在线电影| 日韩精品每日更新| 国产99精品国产| 欧美福利视频导航| 国产精品国产自产拍高清av| 丝袜国产日韩另类美女| 国产成人在线网站| 欧美军同video69gay| 国产精品久久久一本精品| 日本中文字幕不卡| 一本一道久久a久久精品| 精品国产一区二区精华| 亚洲一卡二卡三卡四卡无卡久久| 国产一区二区三区四区在线观看| 在线观看一区不卡| 国产清纯白嫩初高生在线观看91 | 日韩激情一区二区| 成人免费视频视频在线观看免费| 91精品国产品国语在线不卡| 自拍偷自拍亚洲精品播放| 国产在线精品不卡| 欧美日本免费一区二区三区| 亚洲欧洲精品成人久久奇米网| 美日韩一区二区| 欧美日韩精品一区二区三区蜜桃 | 亚洲精品在线免费观看视频| 亚洲国产综合色| 99视频一区二区| 26uuu亚洲综合色| 奇米在线7777在线精品| 欧美三级三级三级爽爽爽| 中文字幕亚洲视频| 国产黄色91视频| 精品国产乱子伦一区| 午夜精品福利一区二区三区av| 色综合天天在线| 国产精品色在线| 国产麻豆午夜三级精品| 91精品国产91综合久久蜜臀| 亚洲一区二区欧美激情| 99精品视频在线播放观看| 国产欧美精品一区二区色综合 | 成人毛片老司机大片| xf在线a精品一区二区视频网站| 天堂精品中文字幕在线| 欧美中文字幕久久| 亚洲综合丁香婷婷六月香| 91免费国产在线观看| 亚洲女性喷水在线观看一区| 成人av在线看| 国产精品超碰97尤物18| 成人a级免费电影| 国产精品理论片| a级精品国产片在线观看| 国产精品久线观看视频| 成人av午夜电影| 亚洲欧美区自拍先锋| 一本久久精品一区二区| 一区二区三区av电影| 欧美系列亚洲系列| 亚洲成人福利片| 91精品国产欧美一区二区18| 久久国产精品露脸对白| 久久精品夜色噜噜亚洲a∨| 国产成人8x视频一区二区| 国产精品色哟哟网站| 91精彩视频在线| 日韩中文字幕麻豆| 精品国产青草久久久久福利| 国产一区二区三区在线观看精品 | 免费观看在线综合色| 欧美一级欧美三级| 国产乱码精品1区2区3区| 国产精品久久久久久久第一福利| 91亚洲精品乱码久久久久久蜜桃| 亚洲情趣在线观看| 欧美日韩成人综合| 激情久久久久久久久久久久久久久久| 久久久99久久精品欧美| 99视频一区二区| 亚洲123区在线观看| 精品久久久久久亚洲综合网| 成a人片国产精品| 日韩黄色一级片| 国产欧美中文在线| 在线观看www91| 国产真实乱子伦精品视频| 中文字幕制服丝袜一区二区三区 | 欧美视频在线一区| 另类小说欧美激情| 中文字幕亚洲欧美在线不卡| 9191精品国产综合久久久久久| 精品一区二区免费| 亚洲天堂a在线| 日韩欧美综合在线| 成人激情av网| 男女激情视频一区| 自拍视频在线观看一区二区| 91精品国产入口在线| 99re视频这里只有精品| 精彩视频一区二区| 一区二区三区在线观看视频| 欧美电影免费提供在线观看| 色香蕉成人二区免费| 久久91精品久久久久久秒播| 中文字幕一区二区三区蜜月| 51精品视频一区二区三区| 成人免费视频一区| 久久99这里只有精品| 一区二区三区视频在线看| 久久久蜜臀国产一区二区| 欧美日本在线看| 91麻豆国产福利在线观看| 国产伦精品一区二区三区视频青涩| 亚洲高清在线视频| 国产精品色在线| 26uuu亚洲| 日韩一区二区精品| 欧美三片在线视频观看| 99久久国产免费看|