Code Index | File Index

Namespaces

Classes


Class CKEDITOR.dataProcessor

Represents a data processor, which is responsible to translate and transform the editor data on input and output.
Defined in: core/dataprocessor.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
This class is here for documentation purposes only and is not really part of the API.
Method Summary
Method Attributes Method Name and Description
 
toDataFormat(html, fixForBody)
Transforms HTML into data to be outputted by the editor, in the format expected by the data processor.
 
toHtml(data, fixForBody)
Transforms input data into HTML to be loaded in the editor.
Class Detail
CKEDITOR.dataProcessor()
Since: 3.0
This class is here for documentation purposes only and is not really part of the API. It serves as the base ("interface") for data processors implementation.
Method Detail
{Undefined} toDataFormat(html, fixForBody)
Since: 3.0
Transforms HTML into data to be outputted by the editor, in the format expected by the data processor. While the editor is able to handle non HTML data (like BBCode), at runtime it can handle HTML data only. The role of the data processor is transforming the HTML data containined by the editor into a specific data format through this function.
NO EXAMPLE AVAILABLE
Parameters:
{String} html
The HTML to be transformed.
{String} fixForBody
The tag name to be used if the output data is coming from <body> and may be eventually fixed for it. This is generally not used by non-HTML data processors. // Tranforming into BBCode data, having a custom BBCode data processor. var html = '<p>This is <b>an example</b>.</p>'; var data = editor.dataProcessor.toDataFormat( html ); // 'This is [b]an example[/b].'

{Undefined} toHtml(data, fixForBody)
Since: 3.0
Transforms input data into HTML to be loaded in the editor. While the editor is able to handle non HTML data (like BBCode), at runtime it can handle HTML data only. The role of the data processor is transforming the input data into HTML through this function.
// Tranforming BBCode data, having a custom BBCode data processor.
var data = 'This is [b]an example[/b].';
var html = editor.dataProcessor.toHtml( data );  // '<p>This is <b>an example</b>.</p>'
Parameters:
{String} data
The input data to be transformed.
{String} fixForBody Optional
The tag name to be used if the data must be fixed because it is supposed to be loaded direcly into the <body> tag. This is generally not used by non-HTML data processors.

Copyright © 2003-2010, CKSource - Frederico Knabben. All rights reserved.