[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/libraries/ckeditor/_source/core/ -> dataprocessor.js (source)

   1  /*

   2  Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.

   3  For licensing, see LICENSE.html or http://ckeditor.com/license

   4  */
   5  
   6  /**

   7   * @fileOverview Defines the "virtual" {@link CKEDITOR.dataProcessor} class, which

   8   *        defines the basic structure of data processor objects to be

   9   *        set to {@link CKEDITOR.editor.dataProcessor}.

  10   */
  11  
  12  /**

  13   * If defined, points to the data processor which is responsible to translate

  14   * and transform the editor data on input and output.

  15   * Generaly it will point to an instance of {@link CKEDITOR.htmlDataProcessor},

  16   * which handles HTML data. The editor may also handle other data formats by

  17   * using different data processors provided by specific plugins.

  18   * @name CKEDITOR.editor.dataProcessor

  19   * @type CKEDITOR.dataProcessor

  20   */
  21  
  22  /**

  23   * Represents a data processor, which is responsible to translate and transform

  24   * the editor data on input and output.

  25   * This class is not really part of the API. It's here for documentation

  26   * purposes, and serves as the base ("interface") for data processors

  27   * implementation.

  28   * @name CKEDITOR.dataProcessor

  29   * @contructor

  30   * @example

  31   */
  32  
  33  /**

  34   * Transforms input data into HTML to be loaded in the editor.

  35   * While the editor is able to handle non HTML data (like BBCode), at runtime

  36   * it can handle HTML data only. The role of the data processor is transforming

  37   * the input data into HTML through this function.

  38   * @name CKEDITOR.dataProcessor.prototype.toHtml

  39   * @function

  40   * @param {String} data The input data to be transformed.

  41   * @param {String} [fixForBody] The tag name to be used if the data must be

  42   *        fixed because it is supposed to be loaded direcly into the <body>

  43   *        tag. This is generally not used by non-HTML data processors.

  44   * @example

  45   * // Tranforming BBCode data, having a custom BBCode data processor.

  46   * var data = 'This is [b]an example[/b].';

  47   * var html = editor.dataProcessor.toHtml( data );  // '<p>This is <b>an example</b>.</p>'

  48   */
  49  
  50  /**

  51   * Transforms HTML into data to be outputted by the editor, in the format

  52   * expected by the data processor.

  53   * While the editor is able to handle non HTML data (like BBCode), at runtime

  54   * it can handle HTML data only. The role of the data processor is transforming

  55   * the HTML data containined by the editor into a specific data format through

  56   * this function.

  57   * @name CKEDITOR.dataProcessor.prototype.toDataFormat

  58   * @function

  59   * @param {String} html The HTML to be transformed.

  60   * @param {String} fixForBody The tag name to be used if the output data is

  61   *        coming from <body> and may be eventually fixed for it. This is

  62   * generally not used by non-HTML data processors.

  63   * // Tranforming into BBCode data, having a custom BBCode data processor.

  64   * var html = '<p>This is <b>an example</b>.</p>';

  65   * var data = editor.dataProcessor.toDataFormat( html );  // 'This is [b]an example[/b].'

  66   */


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7