Ticket #11179: inline_destroy.html

File inline_destroy.html, 1.3 KB (added by Teresa Monahan, 11 years ago)
Line 
1<!DOCTYPE html>
2<html>
3<head>
4        <title>CKEditor Inline Editor Sample </title>
5        <meta charset="utf-8">
6        <script src="../ckeditor.js"></script>
7        <script>
8
9                var editor;
10
11                function createInlineEditor() {
12                        if ( editor )
13                                return;
14
15                        document.getElementById('editable').contentEditable = true;
16                        editor = CKEDITOR.inline( 'editable', {extraPlugins: 'tableresize', toolbar: [ ['Table']]} );
17                }
18
19                function removeEditor() {
20                        if ( !editor )
21                                return;
22
23                        // Destroy the editor.
24                        editor.destroy();
25                        editor = null;
26                        document.getElementById('editable').contentEditable = false;                   
27                }
28
29        </script>
30</head>
31<body>
32        <h1> CKEditor Inline Editor Sample </h1>
33       
34        <p>
35                <input onclick="createInlineEditor();" type="button" value="Create Inline Editor">
36                <input onclick="removeEditor();" type="button" value="Destroy Editor">
37        </p>
38        <br/><br/>
39        <div id="editable" contenteditable="true"> Sample text
40
41<table border="1" cellpadding="1" cellspacing="1" style="width:500px">
42        <tbody>
43                <tr>
44                        <td>a</td>
45                        <td>b</td>
46                </tr>
47                <tr>
48                        <td>c</td>
49                        <td>d</td>
50                </tr>
51        </tbody>
52</table>        </div>
53        <script>
54                var editor = CKEDITOR.inline( 'editable', {extraPlugins: 'tableresize', toolbar: [ ['Table']]} );
55        </script>
56</body>
57</html>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy