[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/libraries/ckeditor/_samples/ -> ajax.html (source)

   1  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   2  <!--
   3  Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
   4  For licensing, see LICENSE.html or http://ckeditor.com/license
   5  -->
   6  <html xmlns="http://www.w3.org/1999/xhtml">
   7  <head>
   8      <title>Ajax - CKEditor Sample</title>
   9      <meta content="text/html; charset=utf-8" http-equiv="content-type" />
  10      <script type="text/javascript" src="../ckeditor.js"></script>
  11      <script src="sample.js" type="text/javascript"></script>
  12      <link href="sample.css" rel="stylesheet" type="text/css" />
  13      <script type="text/javascript">
  14      //<![CDATA[

  15  
  16  var editor;
  17  
  18  function createEditor()
  19  {
  20      if ( editor )
  21          return;
  22  
  23      var html = document.getElementById( 'editorcontents' ).innerHTML;
  24  
  25      // Create a new editor inside the <div id="editor">, setting its value to html

  26      var config = {};
  27      editor = CKEDITOR.appendTo( 'editor', config, html );
  28  }
  29  
  30  function removeEditor()
  31  {
  32      if ( !editor )
  33          return;
  34  
  35      // Retrieve the editor contents. In an Ajax application, this data would be

  36      // sent to the server or used in any other way.

  37      document.getElementById( 'editorcontents' ).innerHTML = editor.getData();
  38      document.getElementById( 'contents' ).style.display = '';
  39  
  40      // Destroy the editor.

  41      editor.destroy();
  42      editor = null;
  43  }
  44  
  45      //]]>

  46      </script>
  47  </head>
  48  <body>
  49      <h1>
  50          CKEditor Sample
  51      </h1>
  52      <!-- This <div> holds alert messages to be display in the sample page. -->
  53      <div id="alerts">
  54          <noscript>
  55              <p>
  56                  <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
  57                  support, like yours, you should still see the contents (HTML data) and you should
  58                  be able to edit it normally, without a rich editor interface.
  59              </p>
  60          </noscript>
  61      </div>
  62      <p>
  63          <input onclick="createEditor();" type="button" value="Create Editor" />
  64          <input onclick="removeEditor();" type="button" value="Remove Editor" />
  65      </p>
  66      <!-- This div will hold the editor. -->
  67      <div id="editor">
  68      </div>
  69      <div id="contents" style="display: none">
  70          <p>
  71              Edited Contents:</p>
  72          <!-- This div will be used to display the editor contents. -->
  73          <div id="editorcontents">
  74          </div>
  75      </div>
  76      <div id="footer">
  77          <hr />
  78          <p>
  79              CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>
  80          </p>
  81          <p id="copy">
  82              Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico
  83              Knabben. All rights reserved.
  84          </p>
  85      </div>
  86  </body>
  87  </html>


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