PHP 8.1.33
Preview: fckdataprocessor.js Size: 4.02 KB
/home/jambtst2015/public_html/fckeditor/editor/_source/classes/fckdataprocessor.js

/*
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 * Copyright (C) 2003-2010 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 ==
 *
 * The Data Processor is responsible for transforming the input and output data
 * in the editor. For more info:
 * http://dev.fckeditor.net/wiki/Components/DataProcessor
 *
 * The default implementation offers the base XHTML compatibility features of
 * FCKeditor. Further Data Processors may be implemented for other purposes.
 *
 */

var FCKDataProcessor = function()
{}

FCKDataProcessor.prototype =
{
	/*
	 * Returns a string representing the HTML format of "data". The returned
	 * value will be loaded in the editor.
	 * The HTML must be from <html> to </html>, including <head>, <body> and
	 * eventually the DOCTYPE.
	 * Note: HTML comments may already be part of the data because of the
	 * pre-processing made with ProtectedSource.
	 *     @param {String} data The data to be converted in the
	 *            DataProcessor specific format.
	 */
	ConvertToHtml : function( data )
	{
		// The default data processor must handle two different cases depending
		// on the FullPage setting. Custom Data Processors will not be
		// compatible with FullPage, much probably.
		if ( FCKConfig.FullPage )
		{
			// Save the DOCTYPE.
			FCK.DocTypeDeclaration = data.match( FCKRegexLib.DocTypeTag ) ;

			// Check if the <body> tag is available.
			if ( !FCKRegexLib.HasBodyTag.test( data ) )
				data = '<body>' + data + '</body>' ;

			// Check if the <html> tag is available.
			if ( !FCKRegexLib.HtmlOpener.test( data ) )
				data = '<html dir="' + FCKConfig.ContentLangDirection + '">' + data + '</html>' ;

			// Check if the <head> tag is available.
			if ( !FCKRegexLib.HeadOpener.test( data ) )
				data = data.replace( FCKRegexLib.HtmlOpener, '$&<head><title></title></head>' ) ;

			return data ;
		}
		else
		{
			var html =
				FCKConfig.DocType +
				'<html dir="' + FCKConfig.ContentLangDirection + '"' ;

			// On IE, if you are using a DOCTYPE different of HTML 4 (like
			// XHTML), you must force the vertical scroll to show, otherwise
			// the horizontal one may appear when the page needs vertical scrolling.
			// TODO : Check it with IE7 and make it IE6- if it is the case.
			if ( FCKBrowserInfo.IsIE && FCKConfig.DocType.length > 0 && !FCKRegexLib.Html4DocType.test( FCKConfig.DocType ) )
				html += ' style="overflow-y: scroll"' ;

			html += '><head><title></title></head>' +
				'<body' + FCKConfig.GetBodyAttributes() + '>' +
				data +
				'</body></html>' ;

			return html ;
		}
	},

	/*
	 * Converts a DOM (sub-)tree to a string in the data format.
	 *     @param {Object} rootNode The node that contains the DOM tree to be
	 *            converted to the data format.
	 *     @param {Boolean} excludeRoot Indicates that the root node must not
	 *            be included in the conversion, only its children.
	 *     @param {Boolean} format Indicates that the data must be formatted
	 *            for human reading. Not all Data Processors may provide it.
	 */
	ConvertToDataFormat : function( rootNode, excludeRoot, ignoreIfEmptyParagraph, format )
	{
		var data = FCKXHtml.GetXHTML( rootNode, !excludeRoot, format ) ;

		if ( ignoreIfEmptyParagraph && FCKRegexLib.EmptyOutParagraph.test( data ) )
			return '' ;

		return data ;
	},

	/*
	 * Makes any necessary changes to a piece of HTML for insertion in the
	 * editor selection position.
	 *     @param {String} html The HTML to be fixed.
	 */
	FixHtml : function( html )
	{
		return html ;
	}
} ;

Directory Contents

Dirs: 0 × Files: 39

Name Size Perms Modified Actions
6.07 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
4.02 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
1.58 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
1.69 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
27.34 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
9.98 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
3.16 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
5.99 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
11.60 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
2.20 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
20.62 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
1.88 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
3.43 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
2.97 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
1.99 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
1.73 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
4.38 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
3.95 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
1.51 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
4.43 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
13.84 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
1.66 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
11.36 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
45.74 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
2.75 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
1.10 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
1.12 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
2.41 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
6.38 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
3.55 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
2.50 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
2.11 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
3.43 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
4.17 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
5.34 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
13.26 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
2.41 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
3.03 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download
2.46 KB lrw-r--r-- 2024-11-22 17:53:05
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).