]> git.0d.be Git - panikdb.git/blob - panikdb/static/ckeditor/ckeditor/samples/readonly.html
start new regie home page
[panikdb.git] / panikdb / static / ckeditor / ckeditor / samples / readonly.html
1 <!DOCTYPE html>\r
2 <!--\r
3 Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
4 For licensing, see LICENSE.md or http://ckeditor.com/license\r
5 -->\r
6 <html>\r
7 <head>\r
8         <title>Using the CKEditor Read-Only API &mdash; CKEditor Sample</title>\r
9         <meta charset="utf-8">\r
10         <script src="../ckeditor.js"></script>\r
11         <link rel="stylesheet" href="sample.css">\r
12         <script>\r
13 \r
14                 var editor;\r
15 \r
16                 // The instanceReady event is fired, when an instance of CKEditor has finished\r
17                 // its initialization.\r
18                 CKEDITOR.on( 'instanceReady', function( ev ) {\r
19                         editor = ev.editor;\r
20 \r
21                         // Show this "on" button.\r
22                         document.getElementById( 'readOnlyOn' ).style.display = '';\r
23 \r
24                         // Event fired when the readOnly property changes.\r
25                         editor.on( 'readOnly', function() {\r
26                                 document.getElementById( 'readOnlyOn' ).style.display = this.readOnly ? 'none' : '';\r
27                                 document.getElementById( 'readOnlyOff' ).style.display = this.readOnly ? '' : 'none';\r
28                         });\r
29                 });\r
30 \r
31                 function toggleReadOnly( isReadOnly ) {\r
32                         // Change the read-only state of the editor.\r
33                         // http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setReadOnly\r
34                         editor.setReadOnly( isReadOnly );\r
35                 }\r
36 \r
37         </script>\r
38 </head>\r
39 <body>\r
40         <h1 class="samples">\r
41                 <a href="index.html">CKEditor Samples</a> &raquo; Using the CKEditor Read-Only API\r
42         </h1>\r
43         <div class="description">\r
44                 <p>\r
45                         This sample shows how to use the\r
46                         <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setReadOnly">setReadOnly</a></code>\r
47                         API to put editor into the read-only state that makes it impossible for users to change the editor contents.\r
48                 </p>\r
49                 <p>\r
50                         For details on how to create this setup check the source code of this sample page.\r
51                 </p>\r
52         </div>\r
53         <form action="sample_posteddata.php" method="post">\r
54                 <p>\r
55                         <textarea class="ckeditor" id="editor1" name="editor1" cols="100" 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>\r
56                 </p>\r
57                 <p>\r
58                         <input id="readOnlyOn" onclick="toggleReadOnly();" type="button" value="Make it read-only" style="display:none">\r
59                         <input id="readOnlyOff" onclick="toggleReadOnly( false );" type="button" value="Make it editable again" style="display:none">\r
60                 </p>\r
61         </form>\r
62         <div id="footer">\r
63                 <hr>\r
64                 <p>\r
65                         CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>\r
66                 </p>\r
67                 <p id="copy">\r
68                         Copyright &copy; 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico\r
69                         Knabben. All rights reserved.\r
70                 </p>\r
71         </div>\r
72 </body>\r
73 </html>\r