Ticket #12083: placeholder.html

File placeholder.html, 2.7 KB (added by Piotrek Koszuliński, 11 years ago)

Modified placeholder sample

Line 
1<!DOCTYPE html>
2<!--
3Copyright (c) 2003-2014, 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>Placeholder Plugin &mdash; CKEditor Sample</title>
10        <script src="../../../ckeditor.js"></script>
11        <script src="../../../samples/sample.js"></script>
12        <link rel="stylesheet" href="../../../samples/sample.css">
13        <meta name="ckeditor-sample-name" content="Placeholder plugin">
14        <meta name="ckeditor-sample-group" content="Plugins">
15        <meta name="ckeditor-sample-description" content="Using the Placeholder plugin to create uneditable sections that can only be created and modified with a proper dialog window.">
16</head>
17<body>
18        <h1 class="samples">
19                <a href="../../../samples/index.html">CKEditor Samples</a> &raquo; Using the Placeholder Plugin
20        </h1>
21        <div class="description">
22                <p>
23                        This sample shows how to configure CKEditor instances to use the
24                        <strong>Placeholder</strong> plugin that lets you insert read-only elements
25                        into your content. To enter and modify read-only text, use the
26                        <strong>Create Placeholder</strong> <span class="button_icon" data-icon="placeholder">&nbsp;</span> button and its matching dialog window.
27                </p>
28                <p>
29                        To add a CKEditor instance that uses the <code>placeholder</code> plugin and a related
30                        <strong>Create Placeholder</strong> <span class="button_icon" data-icon="placeholder">&nbsp;</span> toolbar button, insert the following JavaScript
31                        call to your code:
32                </p>
33<pre class="samples">
34CKEDITOR.replace( '<em>textarea_id</em>', {
35        <strong>extraPlugins: 'placeholder',</strong>
36        toolbar: [ [ 'Source', 'Bold' ], [<strong>'CreatePlaceholder'</strong>] ]
37});</pre>
38                <p>
39                        Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
40                        the <code>&lt;textarea&gt;</code> element to be replaced with CKEditor.
41                </p>
42        </div>
43        <form action="../../../samples/sample_posteddata.php" method="post">
44                <p>
45                        <label for="editor1">
46                                CKEditor using the <code>placeholder</code> plugin with its default configuration:
47                        </label>
48                        <textarea cols="80" id="editor1" name="editor1" rows="10">This is a [[sample placeholder]]</textarea>
49                        <script>
50
51                                CKEDITOR.inline( 'editor1', {
52                                        extraPlugins: 'placeholder'
53                                });
54
55                        </script>
56                </p>
57                <p>
58                        <input type="submit" value="Submit">
59                </p>
60        </form>
61        <div id="footer">
62                <hr>
63                <p>
64                        CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
65                </p>
66                <p id="copy">
67                        Copyright &copy; 2003-2014, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
68                        Knabben. All rights reserved.
69                </p>
70        </div>
71</body>
72</html>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy