annotate sites/all/libraries/ckeditor/_samples/replacebycode.html @ 2:b74b41bb73f0

-- Google analytics module
author danieleb <danielebarchiesi@me.com>
date Thu, 22 Aug 2013 17:22:54 +0100
parents ff03f76ab3fe
children
rev   line source
danielebarchiesi@0 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
danielebarchiesi@0 2 <!--
danielebarchiesi@0 3 Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
danielebarchiesi@0 4 For licensing, see LICENSE.html or http://ckeditor.com/license
danielebarchiesi@0 5 -->
danielebarchiesi@0 6 <html xmlns="http://www.w3.org/1999/xhtml">
danielebarchiesi@0 7 <head>
danielebarchiesi@0 8 <title>Replace Textarea by Code &mdash; CKEditor Sample</title>
danielebarchiesi@0 9 <meta content="text/html; charset=utf-8" http-equiv="content-type" />
danielebarchiesi@0 10 <script type="text/javascript" src="../ckeditor.js"></script>
danielebarchiesi@0 11 <script src="sample.js" type="text/javascript"></script>
danielebarchiesi@0 12 <link href="sample.css" rel="stylesheet" type="text/css" />
danielebarchiesi@0 13 </head>
danielebarchiesi@0 14 <body>
danielebarchiesi@0 15 <h1 class="samples">
danielebarchiesi@0 16 CKEditor Sample &mdash; Replace Textarea Elements Using JavaScript Code
danielebarchiesi@0 17 </h1>
danielebarchiesi@0 18 <div class="description">
danielebarchiesi@0 19 <p>
danielebarchiesi@0 20 This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
danielebarchiesi@0 21 with a CKEditor instance by using a JavaScript call.
danielebarchiesi@0 22 </p>
danielebarchiesi@0 23 <p>
danielebarchiesi@0 24 To replace a <code>&lt;textarea&gt;</code> element, place the following call at any point
danielebarchiesi@0 25 after the <code>&lt;textarea&gt;</code> element or inside a <code>&lt;script&gt;</code> element located
danielebarchiesi@0 26 in the <code>&lt;head&gt;</code> section of the page, in a <code>window.onload</code> event handler:
danielebarchiesi@0 27 </p>
danielebarchiesi@0 28 <pre class="samples">CKEDITOR.replace( '<em>textarea_id</em>' );</pre>
danielebarchiesi@0 29 <p>
danielebarchiesi@0 30 Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
danielebarchiesi@0 31 the <code>&lt;textarea&gt;</code> element to be replaced.
danielebarchiesi@0 32 </p>
danielebarchiesi@0 33 </div>
danielebarchiesi@0 34
danielebarchiesi@0 35 <!-- This <div> holds alert messages to be display in the sample page. -->
danielebarchiesi@0 36 <div id="alerts">
danielebarchiesi@0 37 <noscript>
danielebarchiesi@0 38 <p>
danielebarchiesi@0 39 <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
danielebarchiesi@0 40 support, like yours, you should still see the contents (HTML data) and you should
danielebarchiesi@0 41 be able to edit it normally, without a rich editor interface.
danielebarchiesi@0 42 </p>
danielebarchiesi@0 43 </noscript>
danielebarchiesi@0 44 </div>
danielebarchiesi@0 45 <form action="sample_posteddata.php" method="post">
danielebarchiesi@0 46 <p>
danielebarchiesi@0 47 <label for="editor1">
danielebarchiesi@0 48 Editor 1:</label>
danielebarchiesi@0 49 <textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
danielebarchiesi@0 50 <script type="text/javascript">
danielebarchiesi@0 51 //<![CDATA[
danielebarchiesi@0 52
danielebarchiesi@0 53 // This call can be placed at any point after the
danielebarchiesi@0 54 // <textarea>, or inside a <head><script> in a
danielebarchiesi@0 55 // window.onload event handler.
danielebarchiesi@0 56
danielebarchiesi@0 57 // Replace the <textarea id="editor"> with an CKEditor
danielebarchiesi@0 58 // instance, using default configurations.
danielebarchiesi@0 59 CKEDITOR.replace( 'editor1' );
danielebarchiesi@0 60
danielebarchiesi@0 61 //]]>
danielebarchiesi@0 62 </script>
danielebarchiesi@0 63 </p>
danielebarchiesi@0 64 <p>
danielebarchiesi@0 65 <label for="editor2">
danielebarchiesi@0 66 Editor 2:</label>
danielebarchiesi@0 67 <textarea cols="80" id="editor2" name="editor2" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
danielebarchiesi@0 68 <script type="text/javascript">
danielebarchiesi@0 69 //<![CDATA[
danielebarchiesi@0 70
danielebarchiesi@0 71 // This call can be placed at any point after the
danielebarchiesi@0 72 // <textarea>, or inside a <head><script> in a
danielebarchiesi@0 73 // window.onload event handler.
danielebarchiesi@0 74
danielebarchiesi@0 75 // Replace the <textarea id="editor"> with an CKEditor
danielebarchiesi@0 76 // instance, using default configurations.
danielebarchiesi@0 77 CKEDITOR.replace( 'editor2' );
danielebarchiesi@0 78
danielebarchiesi@0 79 //]]>
danielebarchiesi@0 80 </script>
danielebarchiesi@0 81 </p>
danielebarchiesi@0 82 <p>
danielebarchiesi@0 83 <input type="submit" value="Submit" />
danielebarchiesi@0 84 </p>
danielebarchiesi@0 85 </form>
danielebarchiesi@0 86 <div id="footer">
danielebarchiesi@0 87 <hr />
danielebarchiesi@0 88 <p>
danielebarchiesi@0 89 CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
danielebarchiesi@0 90 </p>
danielebarchiesi@0 91 <p id="copy">
danielebarchiesi@0 92 Copyright &copy; 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
danielebarchiesi@0 93 Knabben. All rights reserved.
danielebarchiesi@0 94 </p>
danielebarchiesi@0 95 </div>
danielebarchiesi@0 96 </body>
danielebarchiesi@0 97 </html>