Ticket #13314: readonly7.html

File readonly7.html, 2.1 KB (added by Jakub Ś, 9 years ago)
Line 
1<!DOCTYPE html>
2<!--
3Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
4For licensing, see LICENSE.md or http://ckeditor.com/license
5-->
6<html>
7<head>
8        <meta charset="utf-8">
9        <title>Using the CKEditor Read-Only API &mdash; CKEditor Sample</title>
10        <script src="../ckeditor.js"></script>
11        <link rel="stylesheet" href="sample.css">
12        <script>
13                CKEDITOR.disableAutoInline = true;
14                var editor, editor2;
15
16                function setCKEReadOnly( readOnly ) {                   
17                        editor.setReadOnly( readOnly );
18                        editor2.setReadOnly( readOnly );
19                }
20
21        </script>
22</head>
23<body>
24        <h1 class="samples">
25                <a href="index.html">CKEditor Samples</a> &raquo; Using the CKEditor Read-Only API
26        </h1>
27        <div class="description">
28                <p>
29                        This sample shows how to use the
30                        <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setReadOnly">setReadOnly</a></code>
31                        API to put editor into the read-only state that makes it impossible for users to change the editor contents.
32                </p>
33                <p>
34                        For details on how to create this setup check the source code of this sample page.
35                </p>
36        </div>
37        <form action="sample_posteddata.php" method="post">
38                <p>
39                        <div contenteditable="true" id="editable"><img src="http://i.imgur.com/M3LOzdI.jpg"/></div>
40
41                        <div contenteditable="true" id="editable2"><img src="http://i.imgur.com/aD7V3hQ.jpg" width="320"/></div>                       
42                </p>
43                <p>
44                        <input id="readOnlyOn" onclick="setCKEReadOnly( true );" type="button" value="Make it read-only">
45                        <input id="readOnlyOff" onclick="setCKEReadOnly( false );" type="button" value="Make it editable again">
46                </p>
47                <script>                       
48                        editor = CKEDITOR.inline( document.getElementById( 'editable' ) );
49                        editor2 = CKEDITOR.inline( document.getElementById( 'editable2' ) );
50                </script>
51        </form>
52        <div id="footer">
53                <hr>
54                <p>
55                        CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
56                </p>
57                <p id="copy">
58                        Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
59                        Knabben. All rights reserved.
60                </p>
61        </div>
62</body>
63</html>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy