Index: /FCKeditor/trunk/editor/_source/commandclasses/fckblockquotecommand.js
===================================================================
--- /FCKeditor/trunk/editor/_source/commandclasses/fckblockquotecommand.js	(revision 850)
+++ /FCKeditor/trunk/editor/_source/commandclasses/fckblockquotecommand.js	(revision 850)
@@ -0,0 +1,112 @@
+﻿/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 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 ==
+ *
+ * FCKBlockQuoteCommand Class: adds or removes blockquote tags.
+ */
+
+var FCKBlockQuoteCommand = function()
+{
+}
+
+FCKBlockQuoteCommand.prototype = 
+{
+	Execute : function()
+	{
+		FCKUndo.SaveUndoStep() ;
+
+		var state = this.GetState() ;
+		var range = new FCKDomRange( FCK.EditorWindow ) ;
+		range.MoveToSelection() ;
+		var bookmark = range.CreateBookmark() ;
+		var iterator = new FCKDomRangeIterator( range ) ;
+		var block ;
+
+		if ( state == FCK_TRISTATE_OFF )
+		{
+			range.Expand( 'block_contents' ) ;
+			range.SetStart( range.StartContainer, 3 ) ;
+			range.SetEnd( range.EndContainer, 4 ) ;
+			var oldStart = range.StartContainer ;
+			var oldEnd = range.EndContainer ;
+			var docFrag = range.ExtractContents() ;
+			var quoteBlock = range.Window.document.createElement( 'blockquote' ) ;
+			docFrag.AppendTo( quoteBlock ) ;
+			range.InsertNode( quoteBlock ) ;
+			if ( ! oldStart.lastChild )
+				oldStart.parentNode.removeChild( oldStart ) ;
+			if ( ! oldEnd.lastChild )
+				oldEnd.parentNode.removeChild( oldEnd ) ;
+		}
+		else if ( state == FCK_TRISTATE_ON )
+		{
+			var bqBlocks = [] ;
+			while ( ( block = iterator.GetNextParagraph() ) )
+			{
+				var bqParent = this._GetBlockquoteParent( block ) ;
+				if ( ! bqParent )
+					continue ;
+
+				if ( bqParent._FCK_AREADY_ADDED )
+					continue ;
+
+				bqBlocks.push( bqParent ) ;
+				bqParent._FCK_AREADY_ADDED = true ;
+			}
+
+			while ( bqBlocks.length > 0 )
+			{
+				var blockquote = bqBlocks.shift() ;
+				var fragment = blockquote.ownerDocument.createDocumentFragment() ;
+				while ( blockquote.firstChild )
+					fragment.appendChild( blockquote.removeChild( blockquote.firstChild ) ) ;
+				blockquote.parentNode.replaceChild( fragment, blockquote ) ;
+			}
+		}
+		range.MoveToBookmark( bookmark ) ;
+		range.Select() ;
+		FCK.Events.FireEvent( 'OnSelectionChange' ) ;
+	},
+
+	GetState : function()
+	{
+		// Disabled if not WYSIWYG.
+		if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG || ! FCK.EditorWindow )
+			return FCK_TRISTATE_DISABLED ;
+
+		var path = new FCKElementPath( FCKSelection.GetBoundaryParentElement( true ) ) ;
+		var firstBlock = path.Block || path.BlockLimit ;
+
+		if ( !firstBlock || firstBlock.nodeName.toLowerCase() == 'body' )
+			return FCK_TRISTATE_OFF ;
+
+		// See if the first block has a blockquote parent.
+		for ( var i = 0 ; i < path.Elements.length ; i++ )
+		{
+			if ( path.Elements[i].nodeName.IEquals( 'blockquote' ) )
+				return FCK_TRISTATE_ON ;
+		}
+		return FCK_TRISTATE_OFF ;
+	},
+
+	_GetBlockquoteParent : function( node )
+	{
+		return FCKDomTools.GetCommonParentNode( node, node, 'blockquote' ) ;
+	}
+} ;
Index: /FCKeditor/trunk/editor/_source/internals/fckcommands.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fckcommands.js	(revision 849)
+++ /FCKeditor/trunk/editor/_source/internals/fckcommands.js	(revision 850)
@@ -95,4 +95,5 @@
 		case 'Indent'	: oCommand = new FCKIndentCommand( 'indent', FCKConfig.IndentLength ) ; break ;
 		case 'Outdent'	: oCommand = new FCKIndentCommand( 'outdent', FCKConfig.IndentLength * -1 ) ; break ;
+		case 'Blockquote'	: oCommand = new FCKBlockQuoteCommand() ; break ;
 
 		case 'TableInsertRowAfter'		: oCommand = new FCKTableCommand('TableInsertRowAfter') ; break ;
Index: /FCKeditor/trunk/editor/_source/internals/fcktoolbaritems.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fcktoolbaritems.js	(revision 849)
+++ /FCKeditor/trunk/editor/_source/internals/fcktoolbaritems.js	(revision 850)
@@ -71,4 +71,5 @@
 		case 'Outdent'			: oItem = new FCKToolbarButton( 'Outdent'	, FCKLang.DecreaseIndent, null, null, false, true, 28 ) ; break ;
 		case 'Indent'			: oItem = new FCKToolbarButton( 'Indent'	, FCKLang.IncreaseIndent, null, null, false, true, 29 ) ; break ;
+		case 'Blockquote'			: oItem = new FCKToolbarButton( 'Blockquote'	, FCKLang.Blockquote, null, null, false, true, 73 ) ; break ;
 
 		case 'Link'				: oItem = new FCKToolbarButton( 'Link'		, FCKLang.InsertLinkLbl, FCKLang.InsertLink, null, false, true, 34 ) ; break ;
Index: /FCKeditor/trunk/editor/fckeditor.html
===================================================================
--- /FCKeditor/trunk/editor/fckeditor.html	(revision 849)
+++ /FCKeditor/trunk/editor/fckeditor.html	(revision 850)
@@ -120,4 +120,5 @@
 LoadScript( '_source/commandclasses/fckjustifycommands.js' ) ;
 LoadScript( '_source/commandclasses/fckindentcommands.js' ) ;
+LoadScript( '_source/commandclasses/fckblockquotecommand.js' ) ;
 LoadScript( '_source/commandclasses/fckcorestylecommand.js' ) ;
 LoadScript( '_source/commandclasses/fckremoveformatcommand.js' ) ;
Index: /FCKeditor/trunk/editor/lang/en-au.js
===================================================================
--- /FCKeditor/trunk/editor/lang/en-au.js	(revision 849)
+++ /FCKeditor/trunk/editor/lang/en-au.js	(revision 850)
@@ -72,4 +72,5 @@
 DecreaseIndent		: "Decrease Indent",
 IncreaseIndent		: "Increase Indent",
+Blockquote		: "Blockquote",
 Undo				: "Undo",
 Redo				: "Redo",
Index: /FCKeditor/trunk/editor/lang/en-ca.js
===================================================================
--- /FCKeditor/trunk/editor/lang/en-ca.js	(revision 849)
+++ /FCKeditor/trunk/editor/lang/en-ca.js	(revision 850)
@@ -72,4 +72,5 @@
 DecreaseIndent		: "Decrease Indent",
 IncreaseIndent		: "Increase Indent",
+Blockquote		: "Blockquote",
 Undo				: "Undo",
 Redo				: "Redo",
Index: /FCKeditor/trunk/editor/lang/en-uk.js
===================================================================
--- /FCKeditor/trunk/editor/lang/en-uk.js	(revision 849)
+++ /FCKeditor/trunk/editor/lang/en-uk.js	(revision 850)
@@ -72,4 +72,5 @@
 DecreaseIndent		: "Decrease Indent",
 IncreaseIndent		: "Increase Indent",
+Blockquote		: "Blockquote",
 Undo				: "Undo",
 Redo				: "Redo",
Index: /FCKeditor/trunk/editor/lang/en.js
===================================================================
--- /FCKeditor/trunk/editor/lang/en.js	(revision 849)
+++ /FCKeditor/trunk/editor/lang/en.js	(revision 850)
@@ -72,4 +72,5 @@
 DecreaseIndent		: "Decrease Indent",
 IncreaseIndent		: "Increase Indent",
+Blockquote		: "Blockquote",
 Undo				: "Undo",
 Redo				: "Redo",
Index: /FCKeditor/trunk/editor/lang/zh-cn.js
===================================================================
--- /FCKeditor/trunk/editor/lang/zh-cn.js	(revision 849)
+++ /FCKeditor/trunk/editor/lang/zh-cn.js	(revision 850)
@@ -72,4 +72,5 @@
 DecreaseIndent		: "减少缩进量",
 IncreaseIndent		: "增加缩进量",
+Blockquote		: "引用文字",
 Undo				: "撤消",
 Redo				: "重做",
Index: /FCKeditor/trunk/editor/lang/zh.js
===================================================================
--- /FCKeditor/trunk/editor/lang/zh.js	(revision 849)
+++ /FCKeditor/trunk/editor/lang/zh.js	(revision 850)
@@ -72,4 +72,5 @@
 DecreaseIndent		: "減少縮排",
 IncreaseIndent		: "增加縮排",
+Blockquote		: "块引用",
 Undo				: "復原",
 Redo				: "重複",
Index: /FCKeditor/trunk/fckconfig.js
===================================================================
--- /FCKeditor/trunk/fckconfig.js	(revision 849)
+++ /FCKeditor/trunk/fckconfig.js	(revision 850)
@@ -109,5 +109,5 @@
 	'/',
 	['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
-	['OrderedList','UnorderedList','-','Outdent','Indent'],
+	['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
 	['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
 	['Link','Unlink','Anchor'],
Index: /FCKeditor/trunk/fckpackager.xml
===================================================================
--- /FCKeditor/trunk/fckpackager.xml	(revision 849)
+++ /FCKeditor/trunk/fckpackager.xml	(revision 850)
@@ -130,4 +130,5 @@
 		<File path="editor/_source/commandclasses/fckjustifycommands.js" />
 		<File path="editor/_source/commandclasses/fckindentcommands.js" />
+		<File path="editor/_source/commandclasses/fckblockquotecommand.js" />
 		<File path="editor/_source/commandclasses/fckcorestylecommand.js" />
 		<File path="editor/_source/commandclasses/fckremoveformatcommand.js" />
@@ -224,4 +225,5 @@
 		<File path="editor/_source/commandclasses/fckjustifycommands.js" />
 		<File path="editor/_source/commandclasses/fckindentcommands.js" />
+		<File path="editor/_source/commandclasses/fckblockquotecommand.js" />
 		<File path="editor/_source/commandclasses/fckcorestylecommand.js" />
 		<File path="editor/_source/commandclasses/fckremoveformatcommand.js" />
