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

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

?? fck_gecko.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 ==
 *
 * Creation and initialization of the "FCK" object. This is the main
 * object that represents an editor instance.
 * (Gecko specific implementations)
 */

FCK.Description = "FCKeditor for Gecko Browsers" ;

FCK.InitializeBehaviors = function()
{
	// When calling "SetData", the editing area IFRAME gets a fixed height. So we must recalculate it.
	if ( window.onresize )		// Not for Safari/Opera.
		window.onresize() ;

	FCKFocusManager.AddWindow( this.EditorWindow ) ;

	this.ExecOnSelectionChange = function()
	{
		FCK.Events.FireEvent( "OnSelectionChange" ) ;
	}

	this._ExecDrop = function( evt )
	{
		if ( FCK.MouseDownFlag )
		{
			FCK.MouseDownFlag = false ;
			return ;
		}

		if ( FCKConfig.ForcePasteAsPlainText )
		{
			if ( evt.dataTransfer )
			{
				var text = evt.dataTransfer.getData( 'Text' ) ;
				text = FCKTools.HTMLEncode( text ) ;
				text = FCKTools.ProcessLineBreaks( window, FCKConfig, text ) ;
				FCK.InsertHtml( text ) ;
			}
			else if ( FCKConfig.ShowDropDialog )
				FCK.PasteAsPlainText() ;

			evt.preventDefault() ;
			evt.stopPropagation() ;
		}
	}

	this._ExecCheckCaret = function( evt )
	{
		if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
			return ;

		if ( evt.type == 'keypress' )
		{
			var keyCode = evt.keyCode ;
			// ignore if positioning key is not pressed.
			// left or up arrow keys need to be processed as well, since <a> links can be expanded in Gecko's editor
			// when the caret moved left or up from another block element below.
			if ( keyCode < 33 || keyCode > 40 )
				return ;
		}

		var blockEmptyStop = function( node )
		{
			if ( node.nodeType != 1 )
				return false ;
			var tag = node.tagName.toLowerCase() ;
			return ( FCKListsLib.BlockElements[tag] || FCKListsLib.EmptyElements[tag] ) ;
		}

		var moveCursor = function()
		{
			var selection = FCK.EditorWindow.getSelection() ;
			var range = selection.getRangeAt(0) ;
			if ( ! range || ! range.collapsed )
				return ;

			var node = range.endContainer ;

			// only perform the patched behavior if we're at the end of a text node.
			if ( node.nodeType != 3 )
				return ;

			if ( node.nodeValue.length != range.endOffset )
				return ;

			// only perform the patched behavior if we're in an <a> tag, or the End key is pressed.
			var parentTag = node.parentNode.tagName.toLowerCase() ;
			if ( ! (  parentTag == 'a' ||
					( ! ( FCKListsLib.BlockElements[parentTag] || FCKListsLib.NonEmptyBlockElements[parentTag] )
					  && keyCode == 35 ) ) )
				return ;

			// our caret has moved to just after the last character of a text node under an unknown tag, how to proceed?
			// first, see if there are other text nodes by DFS walking from this text node.
			// 	- if the DFS has scanned all nodes under my parent, then go the next step.
			//	- if there is a text node after me but still under my parent, then do nothing and return.
			var nextTextNode = FCKTools.GetNextTextNode( node, node.parentNode, blockEmptyStop ) ;
			if ( nextTextNode )
				return ;

			// we're pretty sure we need to move the caret forcefully from here.
			range = FCK.EditorDocument.createRange() ;

			nextTextNode = FCKTools.GetNextTextNode( node, node.parentNode.parentNode, blockEmptyStop ) ;
			if ( nextTextNode )
			{
				// Opera thinks the dummy empty text node we append beyond the end of <a> nodes occupies a caret
				// position. So if the user presses the left key and we reset the caret position here, the user
				// wouldn't be able to go back.
				if ( FCKBrowserInfo.IsOpera && keyCode == 37 )
					return ;

				// now we want to get out of our current parent node, adopt the next parent, and move the caret to
				// the appropriate text node under our new parent.
				// our new parent might be our current parent's siblings if we are lucky.
				range.setStart( nextTextNode, 0 ) ;
				range.setEnd( nextTextNode, 0 ) ;
			}
			else
			{
				// no suitable next siblings under our grandparent! what to do next?
				while ( node.parentNode
					&& node.parentNode != FCK.EditorDocument.body
					&& node.parentNode != FCK.EditorDocument.documentElement
					&& node == node.parentNode.lastChild
					&& ( ! FCKListsLib.BlockElements[node.parentNode.tagName.toLowerCase()]
					  && ! FCKListsLib.NonEmptyBlockElements[node.parentNode.tagName.toLowerCase()] ) )
					node = node.parentNode ;


				if ( FCKListsLib.BlockElements[ parentTag ]
						|| FCKListsLib.EmptyElements[ parentTag ]
						|| node == FCK.EditorDocument.body )
				{
					// if our parent is a block node, move to the end of our parent.
					range.setStart( node, node.childNodes.length ) ;
					range.setEnd( node, node.childNodes.length ) ;
				}
				else
				{
					// things are a little bit more interesting if our parent is not a block node
					// due to the weired ways how Gecko's caret acts...
					var stopNode = node.nextSibling ;

					// find out the next block/empty element at our grandparent, we'll
					// move the caret just before it.
					while ( stopNode )
					{
						if ( stopNode.nodeType != 1 )
						{
							stopNode = stopNode.nextSibling ;
							continue ;
						}

						var stopTag = stopNode.tagName.toLowerCase() ;
						if ( FCKListsLib.BlockElements[stopTag] || FCKListsLib.EmptyElements[stopTag]
							|| FCKListsLib.NonEmptyBlockElements[stopTag] )
							break ;
						stopNode = stopNode.nextSibling ;
					}

					// note that the dummy marker below is NEEDED, otherwise the caret's behavior will
					// be broken in Gecko.
					var marker = FCK.EditorDocument.createTextNode( '' ) ;
					if ( stopNode )
						node.parentNode.insertBefore( marker, stopNode ) ;
					else
						node.parentNode.appendChild( marker ) ;
					range.setStart( marker, 0 ) ;
					range.setEnd( marker, 0 ) ;
				}
			}

			selection.removeAllRanges() ;
			selection.addRange( range ) ;
			FCK.Events.FireEvent( "OnSelectionChange" ) ;
		}

		setTimeout( moveCursor, 1 ) ;
	}

	this.ExecOnSelectionChangeTimer = function()
	{
		if ( FCK.LastOnChangeTimer )
			window.clearTimeout( FCK.LastOnChangeTimer ) ;

		FCK.LastOnChangeTimer = window.setTimeout( FCK.ExecOnSelectionChange, 100 ) ;
	}

	this.EditorDocument.addEventListener( 'mouseup', this.ExecOnSelectionChange, false ) ;

	// On Gecko, firing the "OnSelectionChange" event on every key press started to be too much
	// slow. So, a timer has been implemented to solve performance issues when typing to quickly.
	this.EditorDocument.addEventListener( 'keyup', this.ExecOnSelectionChangeTimer, false ) ;

	this._DblClickListener = function( e )
	{
		FCK.OnDoubleClick( e.target ) ;
		e.stopPropagation() ;
	}
	this.EditorDocument.addEventListener( 'dblclick', this._DblClickListener, true ) ;

	// Record changes for the undo system when there are key down events.
	this.EditorDocument.addEventListener( 'keydown', this._KeyDownListener, false ) ;

	// Hooks for data object drops
	if ( FCKBrowserInfo.IsGecko )
	{
		this.EditorWindow.addEventListener( 'dragdrop', this._ExecDrop, true ) ;
	}
	else if ( FCKBrowserInfo.IsSafari )
	{
		var cancelHandler = function( evt ){ if ( ! FCK.MouseDownFlag ) evt.returnValue = false ; }
		this.EditorDocument.addEventListener( 'dragenter', cancelHandler, true ) ;
		this.EditorDocument.addEventListener( 'dragover', cancelHandler, true ) ;
		this.EditorDocument.addEventListener( 'drop', this._ExecDrop, true ) ;
		this.EditorDocument.addEventListener( 'mousedown',
			function( ev )
			{
				var element = ev.srcElement ;

				if ( element.nodeName.IEquals( 'IMG', 'HR', 'INPUT', 'TEXTAREA', 'SELECT' ) )
				{
					FCKSelection.SelectNode( element ) ;
				}
			}, true ) ;

		this.EditorDocument.addEventListener( 'mouseup',
			function( ev )
			{
				if ( ev.srcElement.nodeName.IEquals( 'INPUT', 'TEXTAREA', 'SELECT' ) )
					ev.preventDefault()
			}, true ) ;

		this.EditorDocument.addEventListener( 'click',
			function( ev )
			{
				if ( ev.srcElement.nodeName.IEquals( 'INPUT', 'TEXTAREA', 'SELECT' ) )
					ev.preventDefault()
			}, true ) ;
	}

	// Kludge for buggy Gecko caret positioning logic (Bug #393 and #1056)
	if ( FCKBrowserInfo.IsGecko || FCKBrowserInfo.IsOpera )
	{
		this.EditorDocument.addEventListener( 'keypress', this._ExecCheckCaret, false ) ;
		this.EditorDocument.addEventListener( 'click', this._ExecCheckCaret, false ) ;
	}

	// Reset the context menu.
	FCK.ContextMenu._InnerContextMenu.SetMouseClickWindow( FCK.EditorWindow ) ;
	FCK.ContextMenu._InnerContextMenu.AttachToElement( FCK.EditorDocument ) ;
}

FCK.MakeEditable = function()
{
	this.EditingArea.MakeEditable() ;
}

// Disable the context menu in the editor (outside the editing area).
function Document_OnContextMenu( e )
{
	if ( !e.target._FCKShowContextMenu )
		e.preventDefault() ;
}
document.oncontextmenu = Document_OnContextMenu ;

// GetNamedCommandState overload for Gecko.
FCK._BaseGetNamedCommandState = FCK.GetNamedCommandState ;
FCK.GetNamedCommandState = function( commandName )
{
	switch ( commandName )
	{
		case 'Unlink' :
			return FCKSelection.HasAncestorNode('A') ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
		default :
			return FCK._BaseGetNamedCommandState( commandName ) ;
	}
}

// Named commands to be handled by this browsers specific implementation.
FCK.RedirectNamedCommands =
{
	Print	: true,
	Paste	: true
} ;

// ExecuteNamedCommand overload for Gecko.
FCK.ExecuteRedirectedNamedCommand = function( commandName, commandParameter )
{
	switch ( commandName )
	{
		case 'Print' :
			FCK.EditorWindow.print() ;
			break ;
		case 'Paste' :
			try
			{
				// Force the paste dialog for Safari (#50).
				if ( FCKBrowserInfo.IsSafari )
					throw '' ;

				if ( FCK.Paste() )
					FCK.ExecuteNamedCommand( 'Paste', null, true ) ;
			}
			catch (e)	{ FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.Paste, 'dialog/fck_paste.html', 400, 330, 'Security' ) ; }
			break ;
		default :
			FCK.ExecuteNamedCommand( commandName, commandParameter ) ;
	}
}

FCK._ExecPaste = function()
{
	// Save a snapshot for undo before actually paste the text
	FCKUndo.SaveUndoStep() ;

	if ( FCKConfig.ForcePasteAsPlainText )
	{
		FCK.PasteAsPlainText() ;
		return false ;
	}

	/* For now, the AutoDetectPasteFromWord feature is IE only. */
	return true ;
}

//**
// FCK.InsertHtml: Inserts HTML at the current cursor location. Deletes the
// selected content if any.
FCK.InsertHtml = function( html )
{
	html = FCKConfig.ProtectedSource.Protect( html ) ;
	html = FCK.ProtectEvents( html ) ;
	html = FCK.ProtectUrls( html ) ;
	html = FCK.ProtectTags( html ) ;

	// Save an undo snapshot first.
	FCKUndo.SaveUndoStep() ;

	// Insert the HTML code.
	this.EditorDocument.execCommand( 'inserthtml', false, html ) ;
	this.Focus() ;

	// For some strange reason the SaveUndoStep() call doesn't activate the undo button at the first InsertHtml() call.
	this.Events.FireEvent( "OnSelectionChange" ) ;
}

FCK.PasteAsPlainText = function()
{
	// TODO: Implement the "Paste as Plain Text" code.

	// If the function is called immediately Firefox 2 does automatically paste the contents as soon as the new dialog is created
	// so we run it in a Timeout and the paste event can be cancelled
	FCKTools.RunFunction( FCKDialog.OpenDialog, FCKDialog, ['FCKDialog_Paste', FCKLang.PasteAsText, 'dialog/fck_paste.html', 400, 330, 'PlainText'] ) ;

/*
	var sText = FCKTools.HTMLEncode( clipboardData.getData("Text") ) ;
	sText = sText.replace( /\n/g, '<BR>' ) ;
	this.InsertHtml( sText ) ;
*/
}
/*
FCK.PasteFromWord = function()
{
	// TODO: Implement the "Paste as Plain Text" code.

	FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.PasteFromWord, 'dialog/fck_paste.html', 400, 330, 'Word' ) ;

//	FCK.CleanAndPaste( FCK.GetClipboardHTML() ) ;
}
*/
FCK.GetClipboardHTML = function()
{
	return '' ;
}

FCK.CreateLink = function( url, noUndo )
{
	// Creates the array that will be returned. It contains one or more created links (see #220).
	var aCreatedLinks = new Array() ;

	FCK.ExecuteNamedCommand( 'Unlink', null, false, !!noUndo ) ;

	if ( url.length > 0 )
	{
		// Generate a temporary name for the link.
		var sTempUrl = 'javascript:void(0);/*' + ( new Date().getTime() ) + '*/' ;

		// Use the internal "CreateLink" command to create the link.
		FCK.ExecuteNamedCommand( 'CreateLink', sTempUrl, false, !!noUndo ) ;

		// Retrieve the just created links using XPath.
		var oLinksInteractor = this.EditorDocument.evaluate("//a[@href='" + sTempUrl + "']", this.EditorDocument.body, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null) ;

		// Add all links to the returning array.
		for ( var i = 0 ; i < oLinksInteractor.snapshotLength ; i++ )
		{
			var oLink = oLinksInteractor.snapshotItem( i ) ;
			oLink.href = url ;

			// It may happen that the browser (aka Safari) decides to use the
			// URL as the link content to not leave it empty. In this case,
			// let's reset it.
			if ( sTempUrl == oLink.innerHTML )
				oLink.innerHTML = '' ;

			aCreatedLinks.push( oLink ) ;
		}
	}

	return aCreatedLinks ;
}

FCK._FillEmptyBlock = function( emptyBlockNode )
{
	if ( ! emptyBlockNode || emptyBlockNode.nodeType != 1 )
		return ;
	var nodeTag = emptyBlockNode.tagName.toLowerCase() ;
	if ( nodeTag != 'p' && nodeTag != 'div' )
		return ;
	if ( emptyBlockNode.firstChild )
		return ;
	FCKTools.AppendBogusBr( emptyBlockNode ) ;
}

FCK._ExecCheckEmptyBlock = function()
{
	FCK._FillEmptyBlock( FCK.EditorDocument.body.firstChild ) ;
	var sel = FCK.EditorWindow.getSelection() ;
	if ( !sel || sel.rangeCount < 1 )
		return ;
	var range = sel.getRangeAt( 0 );
	FCK._FillEmptyBlock( range.startContainer ) ;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜精品福利一区二区三区av| 欧美日韩一区高清| 天天色天天操综合| 在线观看中文字幕不卡| 亚洲国产成人高清精品| 欧美日韩成人综合在线一区二区| 午夜一区二区三区视频| 欧美一区二区三区免费观看视频| 久久av中文字幕片| 国产日韩欧美精品一区| 972aa.com艺术欧美| 亚洲成人免费av| 欧美精品一区二区久久久| 成人av在线观| 日韩福利电影在线观看| 国产日韩欧美精品电影三级在线| 99九九99九九九视频精品| 亚洲国产欧美一区二区三区丁香婷| 欧美日韩国产高清一区| 国产美女在线精品| 亚洲精品精品亚洲| 日韩一区二区高清| 成人免费福利片| 亚洲综合精品久久| xfplay精品久久| 91美女福利视频| 毛片一区二区三区| 日韩毛片精品高清免费| 日韩三级电影网址| 日本电影亚洲天堂一区| 国产一区二区0| 视频在线观看国产精品| 中文在线一区二区| 91精品欧美福利在线观看 | 性感美女久久精品| 久久精品视频在线看| 欧美性感一区二区三区| 国产精品白丝jk黑袜喷水| 午夜在线电影亚洲一区| 中文字幕中文字幕在线一区 | 日韩一级完整毛片| 91日韩一区二区三区| 国产在线精品一区二区三区不卡| 亚洲综合在线电影| 亚洲国产高清aⅴ视频| 日韩欧美专区在线| 欧美性大战久久| 91亚洲国产成人精品一区二三| 久久se这里有精品| 亚洲最大的成人av| 国产精品国产自产拍在线| 亚洲一线二线三线视频| 久久综合999| 6080国产精品一区二区| 色综合天天综合| 大陆成人av片| 国产精选一区二区三区| 欧美aaaaaa午夜精品| 亚洲午夜久久久| 亚洲男女毛片无遮挡| 国产精品视频yy9299一区| 欧美电影免费观看高清完整版 | 精品噜噜噜噜久久久久久久久试看 | 免费人成精品欧美精品| 亚洲一卡二卡三卡四卡| 亚洲男人的天堂在线观看| 亚洲欧美怡红院| 综合网在线视频| 亚洲欧美一区二区在线观看| 欧美国产日韩亚洲一区| 国产精品乱人伦| 中文字幕第一区二区| 国产三级欧美三级日产三级99| 久久―日本道色综合久久| 久久综合资源网| 久久久亚洲精品一区二区三区| 精品成人私密视频| 久久久久国产精品厨房| 国产情人综合久久777777| 国产精品网站导航| 中文字幕日韩欧美一区二区三区| 中文字幕一区二区三区四区不卡| 国产精品久久久99| 亚洲欧美日韩国产成人精品影院 | 一区二区免费看| 亚洲一区二区免费视频| 婷婷久久综合九色国产成人| 天堂在线一区二区| 久久国产精品一区二区| 国产麻豆视频精品| av中文字幕不卡| 精品1区2区3区| 欧美夫妻性生活| 一区二区久久久久久| 日韩有码一区二区三区| 国产综合色产在线精品| 99精品视频在线观看| 欧美性三三影院| 精品少妇一区二区三区在线播放| 国产亚洲精品福利| 亚洲欧美成人一区二区三区| 亚洲成人免费av| 国产激情视频一区二区三区欧美 | 婷婷成人激情在线网| 毛片不卡一区二区| 成人午夜私人影院| 欧美亚洲尤物久久| 久久亚洲一级片| 一区二区在线观看不卡| 美国毛片一区二区三区| av亚洲精华国产精华精| 欧美日韩国产影片| 久久久噜噜噜久久中文字幕色伊伊 | 在线观看成人小视频| 欧美本精品男人aⅴ天堂| 国产精品久久久久永久免费观看| 天天综合网 天天综合色| 国产成人综合自拍| 欧美一区中文字幕| 国产精品丝袜黑色高跟| 日韩中文字幕亚洲一区二区va在线| 免费亚洲电影在线| 中文字幕在线不卡国产视频| 日韩国产精品久久久久久亚洲| 成人黄色av电影| 91麻豆精品国产91久久久久久久久 | 久久精品在线观看| 怡红院av一区二区三区| 亚洲精品美腿丝袜| 国产黄色精品视频| 欧美日韩在线三区| 国产精品美女一区二区三区| 蜜桃视频一区二区三区| 欧美中文字幕一区二区三区 | 国产精品久久久久久久第一福利| 天天做天天摸天天爽国产一区| av高清不卡在线| 精品国产伦一区二区三区观看方式 | 亚洲综合成人在线| 成人免费看的视频| 久久综合色综合88| 天堂一区二区在线免费观看| 95精品视频在线| 日本一区二区综合亚洲| 久久66热偷产精品| 欧美一区午夜精品| 日韩精品视频网| 欧美色精品在线视频| 亚洲欧美区自拍先锋| 国产大陆精品国产| 国产午夜精品久久久久久久| 久久激情综合网| 欧美一级夜夜爽| 日韩在线观看一区二区| 欧美日韩国产经典色站一区二区三区| 最新国产成人在线观看| 国产激情视频一区二区在线观看| 2017欧美狠狠色| 国产美女精品在线| 久久综合色播五月| 韩国女主播成人在线观看| 欧美挠脚心视频网站| 亚洲国产成人av网| 欧美在线视频日韩| 夜夜揉揉日日人人青青一国产精品| 一本色道久久综合亚洲91| 亚洲少妇中出一区| 99精品偷自拍| 亚洲一区二区三区四区不卡| 欧美三级韩国三级日本三斤| 亚洲香肠在线观看| 欧美揉bbbbb揉bbbbb| 亚欧色一区w666天堂| 欧美日韩国产高清一区二区三区| 亚洲高清久久久| 欧美日韩不卡在线| 午夜激情一区二区| 欧美一区二区不卡视频| 另类小说综合欧美亚洲| 久久网站最新地址| 成人一区二区三区中文字幕| 中文字幕一区二区三区在线不卡| 色综合天天天天做夜夜夜夜做| 亚洲一区二区三区四区五区中文| 欧美性大战久久久久久久| 蜜桃一区二区三区在线| 久久久天堂av| 91丨九色丨黑人外教| 性感美女久久精品| 久久久综合九色合综国产精品| 国产不卡视频一区| 日本91福利区| 中文av一区二区| 在线观看日韩电影| 免费精品99久久国产综合精品| 久久久久97国产精华液好用吗| 成人av影院在线| 日韩vs国产vs欧美| 欧美—级在线免费片| 欧美日韩国产一区|