Ticket #11206: replacebycode.html

File replacebycode.html, 2.0 KB (added by Jakub Ś, 10 years ago)
Line 
1<!DOCTYPE html>
2<!--
3Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
4For licensing, see LICENSE.md or http://ckeditor.com/license
5-->
6<html>
7<head>
8        <title>Replace Textarea by Code &mdash; CKEditor Sample</title>
9        <meta charset="utf-8">
10        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
11        <script src="../ckeditor.js"></script>
12        <link href="sample.css" rel="stylesheet">
13</head>
14<body>
15        <h1 class="samples">
16                <a href="index.html">CKEditor Samples</a> &raquo; Replace Textarea Elements Using JavaScript Code
17        </h1>
18        <form action="sample_posteddata.php" method="post">
19                <div class="description">
20                        <p>
21                                This editor is using an <code>&lt;iframe&gt;</code> element-based editing area, provided by the <strong>Wysiwygarea</strong> plugin.
22                        </p>
23<pre class="samples">
24CKEDITOR.replace( '<em>textarea_id</em>' )
25</pre>
26                </div>
27                 <div id="book">
28                        <p> --- HTML Page Content here-- </p>
29        </div>
30
31                <script>
32
33                        // This call can be placed at any point after the
34                        // <textarea>, or inside a <head><script> in a
35                        // window.onload event handler.
36
37                        // Replace the <textarea id="editor"> with an CKEditor
38                        // instance, using default configurations.
39
40       
41
42    //CKEditor Plugins Integration
43        $(document).ready(function () {
44       $('#book').attr("contenteditable", true);                 
45       
46                //We need to turn off the automatic editor creation first.
47        CKEDITOR.disableAutoInline = true;
48       
49                var editor = CKEDITOR.inline('book', {
50            allowedContent: true
51        });
52    });
53
54
55                </script>
56                <p>
57                        <input type="submit" value="Submit">
58                </p>
59        </form>
60        <div id="footer">
61                <hr>
62                <p>
63                        CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
64                </p>
65                <p id="copy">
66                        Copyright &copy; 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
67                        Knabben. All rights reserved.
68                </p>
69        </div>
70</body>
71</html>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy